Skip to content

Instantly share code, notes, and snippets.

View anthonywong's full-sized avatar
🏠
Working from home

Anthony Wong anthonywong

🏠
Working from home
  • Canonical
  • Hong Kong
View GitHub Profile
#!/bin/sh
pkill -x fcitx-qimpanel
pkill -x fcitx
sleep 1
cd ~/.config
t=$(mktemp -d) || exit
mv fcitx fcitx-qimpanel SogouPY SogouPY.users $t
echo "Config files moved to " $t
@anthonywong
anthonywong / installed_packages_order_by_size.sh
Created September 24, 2015 14:32
Output installed packages order by size
for package in $(dpkg -l | grep ^ii| awk '{ print $2 }'); do size=$(dpkg -s $package | grep Installed-Size | awk '{ print $2 }'); echo $package $size; done | sort -nr -k2
-o cache=yes
-o kernel_cache
-o compression=no
-o large_read
-o Cipher=arcfour
@anthonywong
anthonywong / BN(O)
Last active January 13, 2016 06:57
HKSAR and BN(O) passport visa-free country list
Adélie Land
Åland
Anguilla
Antigua and Barbuda
Arab Republic of Egypt
Argentine Republic
Aruba
Australian Antarctic Territory
Barbados
Belize
$ git log --pretty=format:"%an <%ae>" --abbrev-commit v3.0..HEAD --author=canonical|sort|uniq -c|sort -nr
212 David Henningsson <david.henningsson@canonical.com>
185 Ming Lei <ming.lei@canonical.com>
125 Maarten Lankhorst <maarten.lankhorst@canonical.com>
88 Seth Forshee <seth.forshee@canonical.com>
64 Tim Gardner <tim.gardner@canonical.com>
62 John Johansen <john.johansen@canonical.com>
58 Colin Ian King <colin.king@canonical.com>
50 Hui Wang <hui.wang@canonical.com>
@anthonywong
anthonywong / .bashrc
Last active September 14, 2016 13:57
my bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignorespace
" Vim
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
"set fe=taiwan
"set gfs=-adobe-courier-bold-r-normal--14-140-75-75-m-90-iso8859-1,-eten-fixed-medium-r-normal--16-150-75-75-c-160-big5-0
@anthonywong
anthonywong / Makefile
Created January 6, 2017 10:46
Makefile for compiling a single kernel module
obj-m := oops.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
SYM=$(PWD)
all:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
@anthonywong
anthonywong / 10-latin.conf
Last active March 22, 2017 12:50
Latin 字體 fontconfig 設定檔
<fontconfig>
<match target="pattern">
<test name="family">
<string>serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Serif</string>
</edit>
</match>
@anthonywong
anthonywong / 20-noto-cjk.conf
Last active September 18, 2017 22:47
思源/Noto CJK fonconfig 設定檔
<fontconfig>
<match target="pattern">
<test name="lang">
<string>zh-tw</string>
</test>
<test name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Noto Sans T Chinese</string>