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 sqlite3 | |
def get_chrome_cookies(): | |
conn = sqlite3.connect('/home/<username>/.config/chromium/Default/Cookies') | |
query = 'select name, value, path from cookies where host_key=".livejournal.com";' | |
return [{"name": r[0], "value": r[1], "path": r[2]} for r in conn.execute(query)] |
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
chrome://net-internals/#dns |
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
http://askubuntu.com/questions/346804/one-ubuntu-laptop-on-wifi-occasionally-makes-other-laptops-connection-slow | |
sudo sh -c "echo 'blacklist wl' >> /etc/modprobe.d/broadcomm-blacklist.conf" | |
sudo sh -c "echo 'brcmsmac' >> /etc/modprobe.d/broadcomm.conf" | |
" | |
When I do this, I end up with no kernel driver in use and no wifi. | |
Actually, it looks like brcmsmac was already blacklisted in a different modprobe.d/ file, created by bcmwl. I commented that out and rebooted and brcmsmac was active. |
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
# timezones | |
tz_utc = pytz.utc | |
tz_ua = pytz.timezone('Europe/Kiev') | |
# get aware ukraine time | |
time_ua = datetime.now(tz_ua) | |
print "Aware ukraine time:", time_ua | |
# transform to utc | |
time_utc = time_ua.astimezone(tz_utc) | |
print "Aware utc time:", time_utc | |
# make naive |
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 datetime import datetime | |
import pytz | |
tz_utc = pytz.utc | |
tz_ua = pytz.timezone('Europe/Kiev') | |
def aware_time_to_naive(t): | |
return t.replace(tzinfo=None) |
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
First of all launch the Group Policy Editor by clicking Start, then type gpedit.msc and hit Enter. | |
Now navigate to the User Configuration > Windows Settings > Scripts(Log on/Log off) option. |
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
1. MySQL community edition (installer, 32bit) will install python connector | |
2. No additional packages are needed | |
3. Connection url would be like this: mysql+mysqlconnector://root:root@localhost/my_db_name |
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
1. binary dependencies from here: | |
http://blog.victorjabur.com/2011/06/08/modules-python-library-compiled-for-windows-32-and-64-unofficial-windows-binaries-for-python/ | |
a) pycrypto-2.3.win32-py2.7.exe | |
b) paramiko-1.7.7.1.win32-py2.7.exe | |
2. just pip install fabric | |
3. Add C:\Python27\Scritps to PATH |
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 matplotlib | |
matplotlib.rcParams['savefig.dpi'] = 2 * matplotlib.rcParams['savefig.dpi'] | |
http://nbviewer.ipython.org/gist/minrk/3301035 | |
http://calebmadrigal.com/big-graphs-ipython-notebook/ |
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 i in $(seq 1 8); do gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-$i "['<Control>F$i']"; done | |
What happens here: | |
Settings are stored in dconf (see man 7 dconf) and can be visually accessed by dconf-editor (not installed by default) or gsettings (recommended API for command line). Next steps are clear. |
OlderNewer