Dizzy Dream of Android Development

These are my personal notes.

Sign APK

1. Generate Keystore (Only Once)

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

2. Zipalign

1
/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

1
/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' 

Verify:

1
/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:

1
[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    162.16.16.155    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:

1
[root@test ~]# who am i
root pts/0 2013-12-31 14:30 (162.16.16.155)

pkill others:

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

Check again:

1
[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    162.16.16.155   00:28    4.00s  0.02s  0.00s w

Notice:

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

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

一个人的安静体验

能认真听呼吸声时,我才发现一只总想忙碌下去的自己。

一个人一生里,没什么事情、不需要工作不需要学习不需要照顾不需要陪伴的时间很少,能自己无事,不看电视手机、不去聊天刷动态的时候真的很少。一个人安静地、不紧不慢地思考的时间,很少。

你能做一个没有别人的白日梦吗?白日梦里,多少还会有别人吧。

人要是没有任何交际,脑海里不对任何人有任何的期许和想象——甚至需要的话,这应该是一个神,而不是一个人。

生活里就是充斥着别人的影子,或是,生活是由别人的影子织好的。

想幸福快乐吗?那就必须看破这荒谬欺人的幻象。

想有安全感吗?唯有对自己诚实如一,才能让扎实的感觉成长。

思想的草原上荒芜人烟,像一场大梦一样。

[OLD] Enable BBR on Debian Stretch

注意

本文的内容已经合并,失效,或已不具有参考价值,请查看给出的重定向链接。

重定向至: Ubuntu (Debian) 服务器的初始化配置


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:

1
uname -r    # kernel >= 4.9

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

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

Execute these commands:

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

Test:

1
2
sysctl net.ipv4.tcp_available_congestion_control
sysctl net.ipv4.tcp_congestion_control

Read More

Mastodon