Skip to content

Instantly share code, notes, and snippets.

:octocat:
coding …

Toomore Chiang toomore

:octocat:
coding …
Block or report user

Report or block toomore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am toomore on github.
  • I am toomore (https://keybase.io/toomore) on keybase.
  • I have a public key whose fingerprint is 422B 779C D894 982B C41E 85EE 3624 CAD7 8AFC 3169

To claim this, I am signing this object:

@toomore
toomore / find_nginx_conf.sh
Created Feb 11, 2015
gdb from the process's memory mappings
View find_nginx_conf.sh
# Set pid of nginx master process here
pid=4629
# generate gdb commands from the process's memory mappings using awk
cat /proc/$pid/maps | awk '$6 !~ "^/" {split ($1,addrs,"-"); print "dump memory mem_" addrs[1] " 0x" addrs[1] " 0x" addrs[2] ;}END{print "quit"}' > gdb-commands
# use gdb with the -x option to dump these memory regions to mem_* files
gdb -p $pid -x gdb-commands
# look for some (any) nginx.conf text
@toomore
toomore / main.go
Last active Aug 29, 2015
goamz ses first try.
View main.go
package main
import (
"fmt"
"net/mail"
"github.com/goamz/goamz/aws"
"github.com/goamz/goamz/exp/ses"
//"github.com/kr/pretty"
)
@toomore
toomore / plurkbot.py
Created Apr 3, 2013
睡覺前練習一下看看噗浪有沒有什麼改變 ... 好像沒有
View plurkbot.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import re
import sys
if __name__ == '__main__':
''' How to use.
python ./plurkbot.py {username} {password} {saysomething}
'''
@toomore
toomore / Mongodb_master_slave.py
Created May 20, 2012
MongoDB Master/Slave pymongo Tutorial
View Mongodb_master_slave.py
from pymongo import Connection
from pymongo.master_slave_connection import MasterSlaveConnection
Master = Connection()
Slaves = [Connection('127.0.0.1', 27018), Connection('127.0.0.1', 27019)]
db = MasterSlaveConnection(Master, Slaves).YOUR_dbs
print db.collection_names()
View What_is_new_in_photoimage.txt
2012/12/15
修正 上傳檔案名稱
2012/12/08
修正 同步上傳作品到 Facebook 相簿
2012/11/30
新增 建立 攝影活動 服務
2012/11/11
View Nexmo_SMS_Sender.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
text = u'這是一封測試簡訊 This a test SMS.'
endpoint = 'https://rest.nexmo.com/sms/json'
data = {
'username': '{yours}',
'password': '{yours}',
@toomore
toomore / offline_notify.py
Created Sep 9, 2011
退伍倒數的進化板!在 notify 顯示!
View offline_notify.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import gtk, pygtk, os, os.path, pynotify
pygtk.require('2.0')
except:
print "Error: need python-notify, python-gtk2 and gtk"
from datetime import datetime
View offline_mil.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from datetime import timedelta
intime = datetime(2011,02,15) # 入伍時間
outtime = datetime(2012,01,16) # 退伍時間
def cd(d):
''' 倒數天數 '''
View countdown_time.py
#!/usr/bin/env python
import datetime
import time
end = datetime.datetime(2010,11,6,11,30)
while 1:
time.sleep(0.8)
print '\r\n' * 30
You can’t perform that action at this time.