Skip to content

Instantly share code, notes, and snippets.

Chiu-Ki Chan chiuki

Block or report user

Report or block chiuki

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@chiuki
chiuki / uninstall_instrumentation_tests.sh
Created Nov 29, 2017
Script to remove instrumentation tests
View uninstall_instrumentation_tests.sh
#!/bin/bash
for p in `adb shell pm list instrumentation | cut -f2 -d: | cut -f1 -d/`; do
echo -n "Uninstalling $p... "
adb uninstall $p
done
@chiuki
chiuki / CheckCN.java
Created May 2, 2017
Check the CN of a certificate from a server. The certificate can be self-signed, and the server does not have to be HTTP.
View CheckCN.java
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.SocketFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
@chiuki
chiuki / .bashrc
Last active Aug 3, 2017
Bash prompt with time, path, git branch and exit status
View .bashrc
function prompt_command {
exitstatus="$?"
BOLD="\[\033[1m\]"
RED="\[\033[1;31m\]"
GREEN="\[\e[32;1m\]"
BLUE="\[\e[34;1m\]"
PURPLE="\[\e[35;1m\]"
CYAN="\[\e[36;1m\]"
OFF="\[\033[m\]"
You can’t perform that action at this time.