This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Add following content in .config/openbox/rc.xml --> | |
<!-- After saving, execute "openbox --reconfigure" to refresh --> | |
<!-- Ref: https://wiki.archlinux.org/index.php/Openbox#Window_snap_behaviour --> | |
<keybind key="W-Left"> | |
<action name="UnmaximizeFull"/> | |
<action name="MaximizeVert"/> | |
<action name="MoveResizeTo"> | |
<width>50%</width> | |
</action> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pre-requisities: sudo apt-get install libsvga1 libsvga1-dev | |
gcc -lvga helloworld.c -o helloworld | |
sudo ./helloworld | |
# output: | |
# (on screen: a small red point displaying for 5 sec) | |
# (on console: [svgalib: allocated virtual console #8]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### IO redirecting ### | |
# "2" is stderr | |
kill -HUP >killout 2>killerr.txt | |
# add stderr to the same file as stdout | |
kill -l 1234 >killout 2>&1 | |
# output to "Recycle Bin" | |
kill -l 1234 >/dev/null 2>&1 | |
# redirect stdin | |
more < killout.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vi hello.c | |
# #include <stdio.h> | |
# | |
# int main() { | |
# printf("Hello world!\n"); | |
# exit(0); | |
# } | |
$ gcc -o hello hello.c | |
hello.c: In function ‘main’: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create and format the partitions | |
fdisk /dev/sda | |
# n (new partition) | |
# +100M (for /boot) | |
# n | |
# +15G (for / including /usr) | |
# n | |
# +8G (for /var) | |
# n | |
# (for the rest, extended) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### emerge package management (need root access) ### | |
### "emerge" is a tool manipulating Gentoo's package management tool "Portage" ### | |
# update portage tree | |
emerge --sync | |
# search package | |
emerge --search pdf | |
emerge --searchdesc pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: http://www.gentoo.org/doc/zh_cn/gentoo-x86-quickinstall.xml | |
########################################################################## | |
##### part 1: boot with gentoo minimal ##### | |
# boot | |
gentoo | |
# config network | |
net-setup eth0 | |
ifconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install userena | |
pip install django-userena | |
# a simple catpcha for django | |
pip install django-simple-captcha | |
# install dependencies for pil and captcha | |
sudo apt-get install libjpeg libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev | |
# install pil | |
pip install pil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Checkout source | |
svn co SVN_URL [PATH] [--username USERNAME] [--password PASSWORD] [-r REVISION] | |
# Add an unversioned(new) FILE or DIR to the version control system | |
svn add FILE | |
# show the current conflict/modified/new status of working directories and files | |
svn status | |
# You should always do a manual svn status --show-updates before trying to commit | |
# changes in order to check that everything is OK and ready to go. |