2010年11月4日 星期四

git

Enhanced shell prompt
One specificity of git over something lke subversion is that all your branch stay in the same directory.
Thanks to the git completion extensions available in git-core, you can enhance your shell prompt to display the name of the branch you are working on. For example, if you set:

PS1='\u@\h:\w$(__git_ps1 " (%s)") \$ '

2010年11月2日 星期二

Virtualbox

VBoxManage.exe modifyvm "Ubuntu 10.04 for WRL4" --natpf1 "guestssh,tcp,,22,,22


VBoxManage.exe startvm "Ubuntu 10.04 for WRL4" --type headless

2010年10月25日 星期一

network-manager 3g modem debug

NM_SERIAL_DEBUG=1 NM_PPP_DEBUG=1 /usr/sbin/NetworkManager --no-daemon

refer:
http://ubuntuforums.org/showthread.php?t=1466490

https://bugs.edge.launchpad.net/ubuntu/+source/network-manager/+bug/259028

http://www.ubuntu-tw.org/modules/newbb/viewtopic.php?viewmode=thread&topic_id=8730&forum=3&post_id=110840

http://www.facebook.com/note.php?note_id=104520692922518

2010年8月1日 星期日

Ubuntu Customize Kit (uck)

#(get latest uck and unetbootin)
# http://sourceforge.net/projects/uck/files/
# apt-get install unetbootin
#(get latest ubuntu desktop iso)
# http://www.ubuntu.com/desktop/get-ubuntu/download
#(run uck)

# steps:
# choose UCK form Applications
# "zh"
# "en" and "Zh-TW"
# default locale "en"
# locate ISO
# customize ISO manually
# gnome
# enter console ...
echo "deb http://download.virtualbox.org/virtualbox/debian maverick non-free" >> /etc/apt/sources.list
echo "deb http://archive.canonical.com/ubuntu maverick partner" >> /etc/apt/sources.list
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
wget -q -O - http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
sh -c 'echo "deb http://archive.getdeb.net/ubuntu lucid-getdeb apps" >> /etc/apt/sources.list.d/getdeb.list'
apt-add-repository ppa:tualatrix/ppa
apt-add-repository ppa:ubuntu-wine/ppa
apt-add-repository ppa:chromium-daily/ppa
apt-add-repository ppa:transmissionbt/ppa
apt-add-repository ppa:dnjl/virtualization
add-apt-repository ppa:portis25/ppa
add-apt-repository ppa:fkrull/deadsnakes

oneiric updates
add-apt-repository ppa:ferramroberto/java
http://www.ubuntugeek.com/install-mplayer-and-multimedia-codecs-libdvdcss2w32codecsw64codecs-on-ubuntu-11-10-oneiric.html
http://www.gaggl.com/2011/10/installing-java6-jdk-on-ubuntu-11-10/

#(add universe, universe repository)
sed -i -e "s/^# \(.*multiverse\)$/\1/g" /etc/apt/sources.list
sed -i -e "s/^# \(.*universe\)$/\1/g" /etc/apt/sources.list
apt-get update

#(add mediabuntu)
wget http://www.medibuntu.org/sources.list.d/$(lsb_release -cs).list --output-document=/etc/apt/sources.list.d/medibuntu.list
apt-get update
apt-get --yes -q --allow-unauthenticated install medibuntu-keyring
apt-get update

apt-get install linux-headers-server linux-image-server

apt-get install vim vim-gnome vim-scripts gcin ubuntu-tweak chromium-browser git-svn qgit filezilla virtualbox-3.2 meld deja-dup rapidsvn unetbootin acroread skype pidgin gimp wireshark sun-java6-jdk openssh-server subversion git-cvs multiget wine pcmanx-gtk2 p7zip-full unrar-free exuberant-ctags libelf-dev libreadline-dev autoconf sshfs transmission tree gfxboot squashfs-tools dpkg-dev build-essential mktemp w32codecs libdvdcss2 smplayer non-free-codecs dmraid inkscape netbeans qemu kvm libusb-dev guvcview libsigc++-dev libcurl4-openssl-dev gparted qt4-designer qt4-dev-tools libc6-dev libvdpau-dev wvdial smbfs texi2html texinfo texlive libssl-dev lame curl libbfd-dev intltool xz-lzma xz-utils pac

#(others: uck, Hiradio Tray...)
#(put latest .deb from http://sourceforge.net/projects/uck/files/ on ~/tmp/remaster-apt-cache)
#(Hiradio http://champyen.blogspot.com/)
#(use dpkg -i )

#max/min/close button
gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.defaults --type string --set /apps/metacity/general/button_layout ":minimize,maximize,close"
#gconftool -s /apps/metacity/general/button_layout -t string "menu:minimize,maximize,close"

#usb permission
sed -i -e "`grep -n libusb /lib/udev/rules.d/50-udev-default.rules -A 1 | tail -n 1 | cut -d- -f1` s/664/666/" /lib/udev/rules.d/50-udev-default.rules

#(use bash, not dash)
dpkg-reconfigure dash

#(FINISH!!!)
# type "exit" to finish the iso

#(optional: run unetbootin for USB live stick)

uck-remaster是UCK的流程文件,我們可以在」customizing」段加入自定義腳本。

UCK腳本調用流程(參見: uck-remaster文件):
1. 解壓鏡像文件:uck-remaster-unpack-iso
2. 解壓初始化鏡像: uck-remaster-unpack-initrd
3. 解壓根文件系統: uck-remaster-unpack-rootfs
4. 調用自定義腳本。
5. 壓縮初始化包: uck-remaster-pack-initrd
6. 壓縮根文件系統包: uck-remaster-pack-rootfs
7. 製作鏡像文件: uck-remaster-pack-iso
8. 清理: uck-remaster-clean

reference: http://blog.163.com/alex_kame/blog/static/14546748201071022122305/

2010年7月29日 星期四

kernel debug in qemu with eclipse

http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html

2010年7月26日 星期一

ubuntu kernel/compile

http://blog.avirtualhome.com/2010/05/05/how-to-compile-a-ubuntu-lucid-kernel/

https://help.ubuntu.com/community/Kernel/Compile

2010年7月13日 星期二

debootstrap

#!/bin/sh
sudo debootstrap --arch=mips --foreign \
--include aptitude,vim,openssh-server,gcc-4.3,python \
lenny /opt/nfsroot/mips http://www.emdebian.org/grip


(On target)
cd debootstrap
./debootstrap --second-stage


(very good step-by-step)
http://nabeko-notebook.blogspot.com/2010/04/emdebian-on-arm-by-debootstrap.html

(locales)
http://www.wayhorn.com/node/8