Skip to content

Instantly share code, notes, and snippets.


Stu Zhao zhaostu

View GitHub Profile
View numberspiral.go
package main
import (
zhaostu / fft.go
Last active Aug 2, 2018
PortAudio example
View fft.go
package main
import (
func isPowerOfTwo(n int) bool {
for n&1 == 0 && n > 1 {
n >>= 1


wget -qO- | bash

zhaostu / android
Last active Dec 8, 2017
Android-x86 and Chromium OS grub2 entries.
View android
menuentry "Android-x86" {
set root='(hd0,3)'
linux /android-4.0-RC2/kernel quiet root=/dev/ram0 androidboot.hardware=asus_laptop acpi_sleep=s3_bios,s3_mode SRC=/android-4.0-RC2
initrd /android-4.0-RC2/initrd.img
zhaostu / !.md
Last active Aug 25, 2020
Configure Synaptics/ALPS/ElanTech touchpad for Chromium OS.
zhaostu /
Created Oct 21, 2012
One-liner to remov all residual config packages in Ubuntu
# Remove all the packages with residual configuration.
sudo apt-get remove --purge `dpkg -l | grep '^rc' | awk '{print $2}'`
zhaostu /
Created Oct 20, 2012
One-liner to remove old Linux kernels in Ubuntu
## Note: This is only tested in the latest Ubuntu distributions.
## Please make sure packages to be removed are correct.
dpkg -l | awk '{print $2}' | grep "linux-\(image\|headers\)-[0-9]" | grep -v `uname -r | sed s/-generic//` | xargs sudo apt-get purge -y
You can’t perform that action at this time.