Skip to content

Instantly share code, notes, and snippets.

@githubutilities
githubutilities / README.md
Created April 10, 2015 05:03
WiFi penetration test

WiFi penetration test

@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
Last active August 29, 2015 14:18
Are Your Devices Bluetooth LE Ready
@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
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
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 2, 2015 10:30
Mac OSX Finder research

Mac OSX Finder Preference Little Experiment

.DS_Store known as Desktop Services Store, is used by Finder to store personal preference such as icon position and so on. It is good that Apple keep the preference locally by using .DS_Store but sometimes it might be annoying.

Experiment on .DS_Store

  • rearrange icon in your Picture folder
  • use Terminal to delete the .DS_Store file in Picture folder
  • relaunch Finder service using killall -KILL Finder command which will force Finder to reload .DS_Store
@githubutilities
githubutilities / README.md
Last active August 29, 2015 14:17
Maven Usage Logs

Maven Usage Logs

  • add maven mirrors to settings.xml for faster download speed.

settings.xml may live in:

  • The Maven install: $M2_HOME/conf/settings.xml
  • A user’s install: ${user.home}/.m2/settings.xml
  • Use mvn archetype:generate to scaffolding