Skip to content

Instantly share code, notes, and snippets.

Avatar

Stu Zhao zhaostu

View GitHub Profile
View numberspiral.go
package main
import (
"image"
"image/color"
"image/draw"
"image/png"
"log"
"math"
"os"
@zhaostu
zhaostu / fft.go
Last active Aug 2, 2018
PortAudio example
View fft.go
package main
import (
"math"
"math/cmplx"
)
func isPowerOfTwo(n int) bool {
for n&1 == 0 && n > 1 {
n >>= 1
View README.md

Usage

wget -qO- http://goo.gl/xkyeeW | bash

@zhaostu
zhaostu / android
Last active Dec 8, 2017
Android-x86 and Chromium OS grub2 entries.
View android
menuentry "Android-x86" {
savedefault
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
zhaostu / !.md
Last active Aug 25, 2020
Configure Synaptics/ALPS/ElanTech touchpad for Chromium OS.
@zhaostu
zhaostu / remove_residual_config.sh
Created Oct 21, 2012
One-liner to remov all residual config packages in Ubuntu
View remove_residual_config.sh
# Remove all the packages with residual configuration.
# http://stuzhao.blogspot.com/2012/07/removing-all-residual-config-packages.html
sudo apt-get remove --purge `dpkg -l | grep '^rc' | awk '{print $2}'`
@zhaostu
zhaostu / remove_old_kernels.sh
Created Oct 20, 2012
One-liner to remove old Linux kernels in Ubuntu
View remove_old_kernels.sh
## Note: This is only tested in the latest Ubuntu distributions.
## Please make sure packages to be removed are correct.
## http://stuzhao.blogspot.com/2012/10/remove-old-linux-kernels-in-ubuntu.html
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.