This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# reading all files with type xlsx | |
import os, fnmatch | |
rootdir = '~/' # your root path | |
for subdir, dirs, files in os.walk(rootdir): | |
for file in files: | |
if fnmatch.fnmatch(file, '*.xlsx'): | |
print(os.path.join(subdir, file)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from openpyxl import load_workbook | |
target_directories = [file_names] | |
for wb_loc in target_directories: | |
print(wb_loc, " : ", " : ", " : ") | |
wb = load_workbook(wb_loc, read_only = True) | |
for sheet in wb: | |
print("SHEET TITLE", " : ", sheet.title, " : ", "SHEET MAX ROWS", " : ", sheet.max_row) | |
for index, current_row in enumerate(sheet.iter_rows()): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import odoorpc | |
odoo = odoorpc.ODOO('localhost', port=8070) | |
odoo.login('progate_07032017', 'admin', 'admin') | |
move_obj = odoo.env['account.move'] | |
with open('my_cs.csv', newline='') as csvfile: | |
odoo = odoorpc.ODOO('localhost', port=8070) | |
odoo.login('progate_07032017', 'admin', 'admin') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install adduser libldap2-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev node-less npm postgresql postgresql-client Postgresql-server-dev-9.5 python python-dev \ | |
python-babel python-dateutil python-decorator python-docutils python-feedparser python-gevent python-imaging \ | |
python-jinja2 python-ldap python-libxslt1 python-lxml python-mako python-mock python-openid python-passlib \ | |
python-psutil python-psycopg2 python-pychart python-pydot python-pyparsing python-pypdf python-reportlab \ | |
python-requests python-suds python-tz python-vatnumber python-vobject python-werkzeug python-xlsxwriter python-xlwt python-yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
odoo.py --save --config myodoo.cfg --stop-after-init | |
./odoo-bin -c myodoo.cfg | |
sudo su - postgres -c "createuser -s $USER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## https://unix.stackexchange.com/questions/13751/kernel-inotify-watch-limit-reached | |
cat /proc/sys/fs/inotify/max_user_watches | |
echo "fs.inotify.max_user_watches=524288" | sudo tee -a /etc/sysctl.conf | |
sudo sysctl -p |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Path C:\ -Name -Filter *<NAME WHAT YOU WANT>*.<EXTENTION> -Recurse -ErrorAction SilentlyContinue -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.odt | |
do | |
echo "converting file - $f" | |
odt2txt $f > $f.txt | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install dnsmasq | |
echo "address=/localhost/127.0.0.1" > /etc/dnsmasq.d/localhost.conf | |
echo "prepend domain-name-servers 127.0.0.1;" >> /etc/dhcp/dhclient.conf | |
sudo systemctl restart dnsmasq.service | |
sudo dhclient | |
# non systemd | |
/etc/init.d/dnsmasq restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-VideoDetails { | |
param ($targetDirectory) | |
$LengthColumn = 27 | |
$objShell = New-Object -ComObject Shell.Application | |
$total_duration = [timespan] '00:00:00' | |
Get-ChildItem -LiteralPath $targetDirectory -Include *.mp4 -Recurse -Force | ForEach { | |
if ($_.Extension -eq ".mp4"){ | |
$objFolder = $objShell.Namespace($_.DirectoryName) | |
$objFile = $objFolder.ParseName($_.Name) |
OlderNewer