This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# | |
#author: rex | |
#blog: http://iregex.org | |
#filename len.py | |
#created: 2011-04-29 15:18 | |
import sys |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# | |
#author: rex | |
#blog: http://iregex.org |
This file contains hidden or 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 | |
export EDITOR='/usr/bin/vim' | |
export PS1="\[\e[36;1m\]\u\[\e[0m\]@\[\e[32;1m\]\h\[\e[0m\]:\[\e[31;1m\]\w\[\e[0m\]\n$" | |
alias a=alias | |
a grep="grep --color=auto -s" | |
#ls |
This file contains hidden or 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 | |
import gnomevfs | |
import sys | |
import commands | |
import os | |
try: | |
filename=os.path.abspath(sys.argv[1]) | |
except Exception, e: |
This file contains hidden or 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 | |
"""attachment mailer, send attachment via localhost/gmail""" | |
import os | |
import re | |
import sys | |
import smtplib | |
# For guessing MIME type based on file name extension | |
import mimetypes |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import re | |
import imaplib2 as imaplib | |
from email import Header | |
from email.parser import Parser | |
##USER CONFIG | |
HOST = 'imap.gmail.com' |
This file contains hidden or 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 | |
function psg() | |
{ | |
/bin/ps aux | grep -v 'grep' |grep -i $1 | |
} | |
function len() | |
{ | |
string=$1 |
This file contains hidden or 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
#converting utilities | |
alias b2u='iconv -f big5 -t utf-8' | |
alias g2u='iconv -f gbk -t utf-8' | |
alias sec='date "+%s"' | |
alias now='date "+%Y-%m-%d %H:%M"' | |
#show image resolution | |
alias resolution='identify $1 |awk '\''{print $3}'\''' | |
#count freqency | |
alias count='sort | uniq -c| sort -nr' |
This file contains hidden or 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 | |
function getMonth(){ | |
img="$1" | |
date=`identify -format "%[EXIF:DateTime]" $img |awk -F: '{print $1$2}'` | |
echo $date | |
} | |
mkdir -p misc | |
for i in `ls *jpg |head -n 1000` |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import sys | |
def encode(c): | |
"""show the other repr of unicode str c""" | |
ens=['utf-8', 'gbk', 'big5'] | |
print "Unicode:\t%s" % (repr(c)) | |
for en in ens: | |
try: |