Skip to content

Instantly share code, notes, and snippets.

View wsvn53's full-sized avatar

Ethan wsvn53

View GitHub Profile
@wsvn53
wsvn53 / sources.list
Last active January 23, 2018 08:13
ubuntu 16.04 mirrors.163.com
deb http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ xenial-backports main restricted universe multiverse
@wsvn53
wsvn53 / gist:7ef6150c17fced4296eb9d3e02fbb6f7
Created April 23, 2017 05:44
openwrt opkg.conf with shadowsocks
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/base
src/gz chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/luci
src/gz chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/telephony
src/gz chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/management
@wsvn53
wsvn53 / gist:b4f27d6bc7d6a1068d2f752dc2526141
Created April 23, 2017 05:44
openwrt opkg.conf with shadowsocks
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
src/gz chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/base
src/gz chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/luci
src/gz chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/packages
src/gz chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/routing
src/gz chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/telephony
src/gz chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05/x86/64/packages/management
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
sudo apt-get install ffmpeg
@wsvn53
wsvn53 / ubuntu-using-iscsi-target.md
Last active June 22, 2016 04:05
Using iSCSI target on Ubuntu 14.04

Install open-iscsi

sudo apt-get install open-iscsi

Configure client

vi /etc/iscsi/iscsid.conf

@wsvn53
wsvn53 / ros-enable-l2tp.sh
Last active September 17, 2016 10:05
Ros enable l2tp instructions.
/ip pool
add name=vpn-pool ranges=10.2.2.2-10.2.2.22
/ppp profile
set [find name=default-encryption] dns-server=10.2.2.1 local-address=10.2.2.1 remote-address=vpn-pool
/ppp secret
add name=帳號 password=密碼 profile=default
/interface l2tp-server server
@wsvn53
wsvn53 / dump-called.sh
Last active March 21, 2016 13:19
Dump all called functions using gdb.
program=$1;
tmp=$(mktemp);
readelf -s $program | awk '
{
if($4 == "FUNC" && $2 != 0) {
print "# code for " $NF;
print "b *0x" $2;
print "commands";
print "silent";
print "bt 1";
@wsvn53
wsvn53 / vpnc-enable-disable-ping.sh
Last active March 16, 2016 13:03
Auto enbale/disable ping request of gateway, for router check gateway avaliable.
/etc/vpnc/post-connect.d/enable-ping.sh
---------------------------------------
#!/bin/bash
echo "Connected.";
# enable host ping
while [ ! -z "$(iptables -L | grep icmp-net-unreachable)" ]; do
echo "==> delete icmp-net-unreachable";
iptables -D INPUT -p icmp -m icmp --icmp-type echo-request -j REJECT --reject-with icmp-net-unreachable;
done
@wsvn53
wsvn53 / reload.bash
Last active March 15, 2016 02:28 — forked from appden/reload.bash
Reload your bash profile in all open bash instances
# put this in your bash profile (change the line below if you use .bash_profile)
# refresh profile on USR1 signal
trap 'eval $(PATH= /usr/libexec/path_helper -s) && source ~/.profile' USR1
# send USR1 signal to all bash instances
reload_profile() {
ps -xo pid,command | grep ' \-bash' | awk '{print $1}' | while read pid; do
kill -USR1 $pid
done
@wsvn53
wsvn53 / install-openconnect.sh
Created March 13, 2016 09:08
Install openconnect on Ubuntu 14.04
sudo apt-get install network-manager-openconnect openconnect