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
/* | |
* spell.c --- spell corrector | |
* | |
* Copyright (C) 2007 Marcelo Toledo <[email protected]> | |
* | |
* Version: 1.0 | |
* Keywords: spell corrector | |
* Author: Marcelo Toledo <[email protected]> | |
* Maintainer: Marcelo Toledo <[email protected]> | |
* URL: http://www.marcelotoledo.org |
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/python | |
# for scanned page, this simple script | |
# split and dump each page into two png files. | |
# | |
# then these pages can be combined into one pdf | |
# file again. | |
# | |
# To merge png files into one pdf, I prefer to | |
# load pngs files with f-spot, and print the images |
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 | |
DIR=${HOME}/.dwm | |
if [ -f "${DIR}"/dwmrc ]; then | |
/bin/sh "${DIR}"/dwmrc & | |
else | |
while true; do | |
xsetroot -name "`date`" | |
sleep 1 | |
done & | |
fi |
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
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Theme/Colors | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" in putty client, set the configuration: | |
" Connection -> Data -> Terminal-type string to "xterm-color" | |
" set term=sun-color | |
syntax on | |
set nu | |
"colorscheme vibrantink |
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
debug_level 0 | |
#log_output flash.log | |
# Daemon configuration | |
telnet_port 0 | |
tcl_port 0 | |
gdb_port 0 | |
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 BaseHTTPServer, SimpleHTTPServer | |
import ssl | |
httpd = BaseHTTPServer.HTTPServer(('', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler) | |
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='server.pem', server_side=True) | |
httpd.serve_forever() |
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
# Simple python script to check each steps of RSA calculation. | |
# Keys. | |
n = 0xAA9DE43925350CD9C0F1F98017FFD882BCFE524122212E764C6D529989B4192169B30559BDFA0F6F3037C3FDF54E18D2A36028E1940BEF14A472D50814A1089861B541491E2CA61652012FBC9E381CD744860F22EB4DD4274AF5C87EF5D05BD5040D8BA550A0FA59C1AFF7B354DF565B531B4ECF4DE731F5998F651BE25146E7 | |
ns = 'AA9DE43925350CD9C0F1F98017FFD882BCFE524122212E764C6D529989B4192169B30559BDFA0F6F3037C3FDF54E18D2A36028E1940BEF14A472D50814A1089861B541491E2CA61652012FBC9E381CD744860F22EB4DD4274AF5C87EF5D05BD5040D8BA550A0FA59C1AFF7B354DF565B531B4ECF4DE731F5998F651BE25146E7' | |
e = 0xEDBE77C1 | |
p = 0xE091BB42189DEA18CF8EE01A2407A6F0DF154C026948CBBE2857584885D60C08E1CD91FB47C35D07E337FF162201BEF10E6D9CBAE975AA086A0E6C6ABD85DE65 | |
q = 0xC27F0DB3D6B798AD36340B56A402467476433A9034953DE611062ECEE87E2A2A46EEFA4900DE013B13191CD0FC84ABFB4CAE01AD22E6F19D4C97AB76CA02455B |
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/python | |
# powerpc-gekko-objdump -d example.elf | python cg.py | dot -Tpng > cg.png && eog cg.png | |
import re, sys | |
f_re = re.compile('^[0-9a-f]* <([a-zA-Z0-9_]*)>:$') | |
c_re = re.compile('\tbl *[0-9a-f]* <([a-zA-Z0-9_]*)>') | |
_blacklist = set(['sys_init', 'SYS_ResetSystem', 'puts', 'getButtons', |
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
# This script is used to export changes between two commits | |
# into two folders for people don't have hg to review code. | |
# | |
# Usage: | |
# python hgfolderdiff.py rev1 rev2 diffs.zip | |
# | |
# export change files in two revisions into two directories, | |
# and then archive to zip file. | |
# | |
import os, subprocess, sys |
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/python3 | |
import sys | |
def MyCount(string): | |
tmpStr = "" | |
for c in string: | |
if ord(c)>=255 and (c not in ",。!¥()《》【】『』、?~·:“”‘’;"): tmpStr += c | |
return len(tmpStr) | |
if __name__=="__main__": |
OlderNewer