Skip to content

Instantly share code, notes, and snippets.

Avatar
🚗
Hiring chip architect at NVIDIA Shanghai office.

Max Lv madeye

🚗
Hiring chip architect at NVIDIA Shanghai office.
View GitHub Profile
@madeye
madeye / loop
Created Nov 14, 2011
parallel loop
View loop
#include <omp.h>
int main(int args, char **argv) {
int procs = omp_get_num_procs();
omp_set_num_threads(procs);
#pragma omp parallel
while (1);
return 0;
}
@madeye
madeye / ProxySettings.java
Created Apr 4, 2012
Set proxy for Android Webview
View ProxySettings.java
package me.madeye;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.apache.http.HttpHost;
import android.content.Context;
@madeye
madeye / WifiProxyManager.java
Created Dec 21, 2012
Set Wifi Proxy for Android
View WifiProxyManager.java
package me.madeye;
import android.content.Context;
import android.net.ProxyProperties;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiManager;
import android.os.Handler;
import android.util.Log;
import java.util.List;
View gist:4491444
22213: shadowsocks-server
08048000 1708K r-x-- /usr/local/go/bin/shadowsocks-server
081f3000 68K rw--- /usr/local/go/bin/shadowsocks-server
08204000 4164K rw--- [ anon ]
08700000 261888K ----- [ anon ]
186c0000 2304K rwx-- [ anon ]
18900000 522240K ----- [ anon ]
b4ad5000 4K ----- [ anon ]
b4ad6000 8188K rw--- [ anon ]
b52d5000 256K rwx-- [ anon ]
View gist:5107642

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

View nicstat.c
/*
* nicstat - print network traffic, Kb/s read and written. Solaris 8+.
* "netstat -i" only gives a packet count, this program gives Kbytes.
*
* 25-Jul-2006, ver 0.92 (check for new versions, http://www.brendangregg.com)
*
* COMPILE:
* cc -lgen -lkstat -lrt -o nicstat nicstat.c
*
* USAGE: nicstat [-hsz] [-i int[,int...]] | [interval [count]]
View mrtg.cfg
# Created by
# /opt/local/bin/cfgmaker --global "WorkDir: /opt/local/www/munin" --output /opt/local/etc/mrtg.cfg --ifref=name --ifref=descr public@localhost
### Global Config Options
### Global Defaults
LoadMIBs: /etc/sma/snmp/mibs/IF-MIB.txt
EnableIPv6: no
View shadowsocks
case "$1" in
start)
/usr/bin/ulimit -n 51200
/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q 4096
/usr/sbin/ndd -set /dev/tcp tcp_conn_req_max_q0 8192
/opt/local/bin/ss-server -c /root/config.json -f /root/ss.pid
;;
stop)
/opt/local/bin/kill `cat /root/ss.pid`
;;
View gist:7180178
make[1]: Entering directory `/home/max/openwrt/trunk'
make[2]: Entering directory `/home/max/openwrt/trunk/package/libs/toolchain'
if [ -f /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean ]; then rm -f /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean; fi; echo "libc" >> /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install
if [ -f /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean ]; then rm -f /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/pkginfo/toolchain.default.install.clean; fi; echo "libgcc" >> /home/max/openwrt/trunk/staging_dir/target-mips_34kc_uClibc-0.
@madeye
madeye / sysctl.conf
Last active Jun 5, 2018
Optimized sysctl.conf for shadowsocks
View sysctl.conf
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912
net.ipv4.ip_local_port_range = 18000 65535
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_max_syn_backlog = 3240000
net.core.somaxconn = 3240000
net.ipv4.tcp_max_tw_buckets = 1440000