As configured in my dotfiles.
start new:
tmux
start new with session name:
import email, getpass, imaplib, os | |
detach_dir = '.' # directory where to save attachments (default: current) | |
user = raw_input("Enter your GMail username:") | |
pwd = getpass.getpass("Enter your password: ") | |
# connecting to the gmail imap server | |
m = imaplib.IMAP4_SSL("imap.gmail.com") | |
m.login(user,pwd) | |
m.select("cs2043") # here you a can choose a mail box like INBOX instead |
As configured in my dotfiles.
start new:
tmux
start new with session name:
# coding=utf8 | |
import PIL | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
def text2png(text, fullpath, color = "#000", bgcolor = "#FFF", fontfullpath = None, fontsize = 13, leftpadding = 3, rightpadding = 3, width = 200): | |
REPLACEMENT_CHARACTER = u'\uFFFD' | |
NEWLINE_REPLACEMENT_STRING = ' ' + REPLACEMENT_CHARACTER + ' ' |
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the \
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)function scroll_to(splash, x, y) | |
local js = string.format( | |
"window.scrollTo(%s, %s);", | |
tonumber(x), | |
tonumber(y) | |
) | |
return splash:runjs(js) | |
end |
IPython Installation | |
1. Install Git | |
1. sudo apt-get install git | |
2. Install IPython from GitHub server | |
1. git clone --recursive https://github.com/ipython/ipython.git (this clones the git repo into a directory called ‘ipython’ located in the directory you run the command from) | |
3. Run the IPython setup script | |
1. cd into the ‘ipython’ directory created in the previous step | |
2. sudo python setup.py install | |
4. Set up a self-signed certificate for SSL (still results in warning in the browser but allows for SSL) |