Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:18
Git Clone All My Public Gist Using Python

Git Clone All My Public Gist Using Python

  • git clone this gist
  • run python gist-backup.py

Feature

  • make the clone folder more human readable by using gist description
  • store downloaded gist in my-gists.json
@githubutilities
githubutilities / README.md
Created April 3, 2015 02:34
Google DNS Connection Troubleshooting

Google DNS Connection Troubleshooting

Symptoms and Analysis

  • restart en0 interface by sudo ifconfig en0 down && sudo ifconfig en0 up does not work
  • ping 8.8.8.8 connection ok, the icmp is working
  • ping localhost, gateway and the dns servers provided by network provider works find
  • both nslookup google.com 8.8.8.8 and dig baidu.com 8.8.8.8 got no A record in return, the DNS resolve is unsuccessful
  • port scan using nmap -Pn 8.8.8.8 does not return 53/tcp open port
  • after creating PPTP over PPP connection to other server, the above symptoms just disappeared
@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:18
Android Dev Setup

Android Dev Setup

Installing command line tools

  • brew install android-sdk

the android-sdk package depends on and also conflicts with android-platform-tools, so every time you update your android-sdk you have to reinstall android-platform-tools(try to brew unlink android-platform-tools.

  • run android to install the android packages
  • add ANDROID_HOME and ANDROID_SDK to environment PATH
@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:18
Are Your Devices Bluetooth LE Ready
@githubutilities
githubutilities / README.md
Created April 6, 2015 06:46
MySQL restore lost password

MySQL restore lost password

killall -TERM mysqld
mysqld_safe --skip-grant-tables

mysql
> use mysql;
> update user set password=PASSWORD('your-password') where User='root';
> flush privileges;
@githubutilities
githubutilities / README.md
Created April 10, 2015 05:03
WiFi penetration test

WiFi penetration test

@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:18
Ruby CheatSheet

Ruby Tools

# lookup for `INSTALLATION DIRECTORY` and `GEM PATHS` env variables
gem env

# install from local gem repository
gem install --local path_to_gem/filename.gem

# Interactive ruby shell
@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:19
C Tricks