Skip to content

Instantly share code, notes, and snippets.

View wynemo's full-sized avatar
🤣
快落的时光总那么少

Nemo.Zhang wynemo

🤣
快落的时光总那么少
View GitHub Profile
@wynemo
wynemo / supervisord.conf
Created August 18, 2012 14:50
supervisord.conf 8 18 backcup
[program:501fun]
command=/home/zdb/uwsgi-0.9.8.6/uwsgi
--uid zdb
-x /home/zdb/webpy_uwsgi.xml
--vhost
user=zdb
autostart=true
autorestart=true
stdout_logfile=/sites/501fun/logs/501funlog.log
stderr_logfile=/sites/501fun/logs/501funerr.log
@wynemo
wynemo / disable_incoming_icmp.sh
Created August 20, 2012 02:45
disable incoming icmp
#/etc/rc.local
iptables -A OUTPUT -p icmp -o eth0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -s 0/0 -i eth0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type destination-unreachable -s 0/0 -i eth0 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type time-exceeded -s 0/0 -i eth0 -j ACCEPT
iptables -A INPUT -p icmp -i eth0 -j DROP
@wynemo
wynemo / dnsmasq_log.conf
Created August 31, 2012 13:36
dnsmasq log query
log-queries
log-facility=/var/log/dnsmasq.log
#sudo /etc/init.d/dnsmasq restart
#sudo tail -f /var/log/dnsmasq.log
#android.clients.google.com
@wynemo
wynemo / guile_install.txt
Created October 16, 2012 15:54
scheme learning
$ sudo aptitude install guile-1.8
$ guile
(trace function-name)
Then, whenever this function is called, it will print a message to the screen showing what arguments it was called with. When the procedure returns, it will print a message showing what value that call returned.
To turn off tracing, use the command:
(untrace function-name)
Or, to turn off all tracing, simply:
#/tmp/foo_dir -> ubuntu12:/tmp/foo_dir/
#--delete delete extraneous files from destination dirs
#--delete-excluded also delete excluded files from destination dirs
#--exclude=PATTERN exclude files matching PATTERN
rsync -avzP --delete --exclude=".svn" --delete-excluded /tmp/foo_dir/ ubuntu12:/tmp/foo_dir/
PyRSS2Gen==1.1
@wynemo
wynemo / ubuntu12.04_python2.6.md
Created December 2, 2012 08:18
install python2.6 on ubuntu12.04

###trick

if you create a new wget child process "wget http://foo.bar", but redirect child stdin and stdout to the same pipe, wget will give you something like this

  0K .......... .......... .......... .......... ..........  0%  105K 2h1m
 50K .......... .......... .......... .......... ..........  0%  158K 1h41m
100K .......... .......... .......... .......... ..........  0%  302K 81m58s
@wynemo
wynemo / ssl_proxy.md
Last active December 13, 2016 17:43 — forked from anonymous/stunnel.conf

虚拟机 ubuntu 12.04

$ sudo aptitude install stunnel
$ sudo aptitude install squid3

squid3的默认http端口是3128

/etc/stunnel/stunnel.conf中的foreground = yes, 是用来调试用的 如果用superviord来管理stunnel 这个选项也会用得到

/etc/stunnel/stunnel.pem, 这个pair是这样得到的