Tuesday, May 10, 2016

Mac: Default email reader keep resetting to Mail

On Mac OS X El Capitan (10.11.4), I was trying to change the default email reader to MS Outlook. So I went to Mail > Preferences > General, and changed Default email reader to Outlook. However, if I re-open the Preferences dialog, I noticed the setting is reverted back to Mail.

I was able to resolve the issue by resetting LaunchServices. Open Terminal and run the following command:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed

OS X 10.11.4 - Setting the default email to one... | Apple Support Communities

Wednesday, March 30, 2016

Wireshark: Search for GET and POST requests

When analyzing a packet capture file (*.pcap) with Wireshark, it can be handy to view just the GET and POST requests.

To view GET requests, set display filter to:
http.request.method == "GET"

To view POST requests, set display filter to:
http.request.method == "POST"

To view both GET and POST requests, use the or operator:
http.request.method == "GET" or http.request.method == "POST"

Thursday, March 24, 2016

Mac: How to connect to a Windows shared folder

To connect to a Windows shared folder:
1. Open Finder
2. Open the Go menu > Connect to Server...
3. Enter smb://, followed by the shared folder path. Note that you should replace all the backslash '\' with forward-slash '/'.
e.g. smb://domain-or-ip-address/shared/folder/path

How to mount a Windows shared folder on your Mac

Wednesday, March 9, 2016

Android: Extract the current wallpaper

Note: Root access required

For Android 4.0 and below:

For Android 4.1 and above:

To pull the wallpaper with adb:
1. adb root
2. adb pull <path-to-wallpaper>
3. rename the file and append file extension .png or .jpg

How to extract default/current wallpaper from an Android Device; Root required - Droidiser

Monday, February 22, 2016

Linux: Secure copy (scp) cheatsheet

Copy the file "foobar.txt" from a remote host to the local host:
scp username@remotehost.com:foobar.txt /some/local/directory

Copy the file "foobar.txt" from the local host to a remote host:
scp foobar.txt username@remotehost.com:/some/remote/directory

Copy the directory "foo" from the local host to a remote host's directory "bar":
scp -r foo username@remotehost.com:/some/remote/directory/bar

Example syntax for Secure Copy (scp)

Monday, February 15, 2016

Atom: Change the Find results highlight color

Recently I started using Atom (a text editor). It works great out of the box. One thing kind of annoys me is the default highlight color for Find results. I want something with higher contrast so I can spot the Find results easily, especially when there's more then 1000+ matches in the text file. Turns out changing the highlight color is fairly easy

To change the highlight color:
1. Goto Atom > Open Your Stylessheet
2. Add the following code:
atom-text-editor::shadow .highlight.find-result .region {
    background-color: rgba(246, 255, 0, 0.20);

3. Save and restart Atom

How to change find and replace highlight color? - support - Atom Discussion

Thursday, February 11, 2016

Python: Install a specific package version with pip

To install a specific version:
pip install <package>==<version>

For example:
pip install requests-oauthlib==0.5.0

pip install — pip 8.0.2 documentation