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
#!/bin/bash | |
# my title | |
echo -e '\x1b]0;my title\x07' |
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
#!/bin/bash | |
echo $LINES | |
echo $COLUMNS | |
# or | |
tput lines | |
tput cols |
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
#!/usr/bin/env python | |
# encoding=utf-8 | |
# get terminal size | |
import curses | |
if __name__ == '__main__': | |
curses.setupterm() | |
print curses.tigetnum('lines') |
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
#!/usr/bin/env python | |
# encoding=utf-8 | |
import os, sys | |
import sqlite3 | |
class PortableDB(object): | |
def __init__(self, db_path): | |
self.conn = sqlite3.connect(db_path) | |
self.cursor = self.conn.cursor() |
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
git config filter.rcs-keyword.clean 'perl -pe "s/\\\$Revision[^\\\$]*\\\$/\\\$Revision\\\$/"' | |
git config filter.rcs-keyword.smudge 'perl -pe "s/\\\$Revision[^\\\$]*\\\$/\\\$Revision: `env -i git svn info | grep Revision | awk '\''{print $2}'\''`\\\$/"' | |
# example usage: | |
# echo 'test.py filter=rcs-keyword' >> .gitattributes | |
# git add test.py .gitattributes | |
# need manual checkout file | |
# rm test.py | |
# git checkout test.py |
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
Options ExecCGI FollowSymLinks Includes MultiViews | |
RewriteEngine On | |
#RewriteCond %{HTTP_HOST} ^[^.]+\.ratazzi\.org$ | |
#RewriteRule ^(.*) %{HTTP_HOST}$1 [C] | |
#RewriteRule ^([^.]+)\.ratazzi\.org(.*) /static/$1$2 [L] | |
RewriteCond %{HTTP_HOST} ^static.ratazzi.org$ [NC] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d |
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
# gevent on OS X Lion | |
sudo python setup.py install -I /opt/local/include/ -L /opt/local/lib |
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
#!/usr/bin/env python | |
# encoding=utf-8 | |
import eventlet | |
eventlet.monkey_patch() | |
import sys, os | |
import xmlrpclib | |
import subprocess | |
def download(): |
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
aria2c \ | |
--continue=true \ | |
--log=/home/ratazzi/aria.log \ | |
--log-level=warn \ | |
--seed-time=0 \ | |
--file-allocation=none \ | |
--human-readable=false \ | |
--allow-overwrite=true \ | |
--always-resume=true \ | |
--bt-hash-check-seed=false \ |
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
" 2html.vim | |
colorscheme ratazzi | |
exec "TOhtml" | |
exec "xa" | |
# run in terminal | |
gvim log.txt -e -c "source 2html.vim" |