Dizzy Dream of Android Development

These are my personal notes.

Sign APK

1. Generate Keystore (Only Once)

keytool -genkey -v -keystore chaos.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias app

2. Zipalign

/home/chaos/Android/Sdk/build-tools/26.0.1/zipalign -p -v 4 '/home/chaos/Websites/App/chaos/app-release.apk' '/home/chaos/Websites/App/chaos/chaos-1.0.6-aligned.apk'

3.Sign & Verify

The script file can be found in %ANDROID_HOME%/sdk/build-tools/24.0.3/ (the .jar is in the /lib subfolder). Use it like this

/home/chaos/Android/Sdk/build-tools/26.0.1/apksigner sign --ks '/home/chaos/.apkstudio/vendor/chaos.keystore' --out '/home/chaos/Websites/Nethunter/themes/Dreamhunter/source/app/download/chaos-1.0.6.apk'  '/home/chaos/Websites/App/chaos/chaos-1.0.6-aligned.apk' 


/home/chaos/Android/Sdk/build-tools/26.0.1/apksigner verify '/home/chaos/Websites/App/chaos/chaos-1.0.6.apk'

Read More

Kick Other SSH Clients on Linux

Show Online Users:

[root@test ~]# w

00:41:47 up 15 min,  2 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    00:28    8:42   0.07s  0.07s -bash
root     pts/1    1162.16.16.156   00:41    0.00s  0.02s  0.00s w

Show which is this connected client:

[root@test ~]# who am i

root pts/0 2013-12-31 14:30 (

pkill others:

[root@test ~]# pkill -kill -t pts/1

Check again:

[root@test ~]# w

00:42:12 up 16 min,  1 user,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0   00:28    4.00s  0.02s  0.00s w


If the other users are not disconnected, I suggest you kill the connection forcely:

[root@test ~]# pkill -9 -t pts/1










Enable BBR on Debian Stretch

BBR(Bottleneck Bandwidth and RTT) is a new congestion control algorithm for TCP released by Google. It’s added into Linux kernel since 4.9. Instead of regarding packet loss as the signal of congestion, BBR sequentially probes the bottleneck bandwidth and RTT.

Check if the kernel supports BBR:

uname -r    # kernel >= 4.9

After that, use lsmod | grep bbr to test if the output has the word “bbr“. If not:

modprobe tcp_bbr
echo "tcp_bbr" >> /etc/modules-load.d/modules.conf

Execute these commands:

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p


sysctl net.ipv4.tcp_available_congestion_control
sysctl net.ipv4.tcp_congestion_control