This file contains hidden or 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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <errno.h> | |
| #include <unistd.h> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <arpa/inet.h> | |
| #include <netinet/in.h> | |
| #include <signal.h> |
This file contains hidden or 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 | |
| oldgw=10.211.55.1 | |
| vpngw=10.100.0.1 | |
| poff | |
| route del default gw $oldgw | |
| route del default gw $vpngw | |
| route add default gw $oldgw |
This file contains hidden or 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 | |
| #set the VPN service name | |
| VPN="" | |
| function xxre () { | |
| echo "VPN is not connected!" | |
| echo "Reconnecting!" | |
| networksetup -connectpppoeservice $VPN | |
| sleep 5 | |
| } | |
| ifconfig|grep ppp0||xxre |
This file contains hidden or 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 | |
| year=2010 | |
| mon=01 | |
| day=01 | |
| case $mon in | |
| 01) monname="Jan" ;; | |
| 02) monname="Feb" ;; | |
| 03) monname="Mar" ;; | |
| 04) monname="Apr" ;; |
This file contains hidden or 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 | |
| # sudo chmod +x tc;sudo mv tc /usr/bin | |
| if [[ -z "$1" ]] | |
| then | |
| printf %s "\ | |
| Nifty Timestamp Convertor by Lex Tang | |
| tc 2012/12/12 | |
| tc 1355283413 | |
| " | |
| exit |
This file contains hidden or 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/expect | |
| set timeout 60 | |
| while {1} { | |
| spawn /usr/bin/ssh -NCD :7070 [email protected] | |
| expect { | |
| "password:" { send "111111\r" } | |
| } | |
| interact { | |
| timeout 60 { send " " } | |
| eof { exp_continue } |
This file contains hidden or 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 | |
| # sh evernoteAdBlock.sh | |
| cd ~/Library/Application\ Support/Evernote/promos/ | |
| rm `ls|grep -v stats.plist` | |
| chmod 555 ../promos |
This file contains hidden or 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 | |
| PATH=$PATH:/usr/local/sbin:/Volumes/data/stuff/code/android-sdk-macosx/platform-tools | |
| for file in `ls|grep .apk` | |
| do | |
| echo $file | |
| adb install $file | |
| done |
This file contains hidden or 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/env python | |
| # | |
| # Refined by @phuslu | |
| # Flora_Pac by @leaskh | |
| # www.leaskh.com, [email protected] | |
| # | |
| # based on chnroutes project (by [email protected]) | |
| # | |
| import re |
This file contains hidden or 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 | |
| function changeDns () { | |
| networksetup -setdnsservers $1 $2 | |
| sleep 1 | |
| dns=`grep nameserver /etc/resolv.conf|head -1|cut -f2 -d " "` | |
| echo $dns | |
| } | |
| changeDns Wi-Fi empty | |
| echo "server=$dns" > /usr/local/etc/dnsmasq/dns.conf |
OlderNewer