2018年7月12日 星期四

ANA 20000哩

東北仙台(Sendai) or 北陸富山(Toyama) + 札幌行
北海道 旭川 新千歲 函館

2012年10月2日 星期二

Sublime Text 2

http://www.sublimetext.com/

key bindings:

Ctrl + P : goto Anything
Ctrl + R : goto Symbols
Ctrl + F (Ctrl + Shift + F) : Find (in files)
Ctrl + Shift + P : Command Palette
Ctrl + / : Toggle comments
Ctrl + t, Ctrl + t (Ctrl + t, Ctrl + b) : Ctags
Ctrl + F2 (F2) : Bookmarks
Ctrl + Alt + B, Ctrl + Alt +H : Hex Viewer
Alt + O : open .h
Ctrl +M : move between bracket
Ctrl + Z (Ctrl + Y) : Undo (Redo)
Ctrl + [ (Ctrl + ]) : add indent (remove indent)
Ctrl + J : Join Line

Plugins:

Package Control (and restart ... )
Ctags
Hex Viewer
Tortoise
SFTP

2012年5月2日 星期三

Ubuntu 12.04 LTS

apt-add-repository ppa:tualatrix/ppa
apt-add-repository ppa:ubuntu-wine/ppa
apt-add-repository ppa:transmissionbt/ppa
apt-add-repository ppa:webupd8team/java
 apt-get install vim vim-gnome vim-scripts gcin ubuntu-tweak chromium-browser git-svn qgit filezilla virtualbox meld unetbootin acroread skype wireshark openssh-server subversion git-cvs multiget wine pcmanx-gtk2 p7zip-full unrar-free exuberant-ctags sshfs tree squashfs-tools dpkg-dev build-essential mktemp gparted smbfs lame curl chromium-browser xz-lzma xz-utils samba

2011年7月12日 星期二

freenx

http://notepad2.blogspot.com/2011/05/install-freenx-server-on-ubuntu-1004.html

*** remember to use root instead of sudo if you need a proxy to internet

authorization problem via nx, please edit...
/usr/share/polkit-1/actions/org.freedesktop.udisks.policy

2011年5月10日 星期二

Some cloud services

http://www.jobbole.com/entry.php/724

Pylons on dotcloud

http://rgarcia.github.com/2011/04/28/deploying-a-pylons-app-on-dotcloud.html

2011年5月8日 星期日

Dropbox client on dotcloud

* Dropbox
http://www.ollix.com/blog/2011/04/27/backup-databases-dropbox-dotcloud-platform/

gitosis on dotcloud

* have a python server on dotcloud (for less package dependency problem)
* get gitosis with wildcard patches
git clone https://github.com/mzupan/gitosis.git

* create your ssh rsa key
ssh-keygen -t rsa

* install gitosis with dotcloud acccount (since it is the only account you can have)
cd gitosis/
python setup.py install
gitosis-init < ~/.ssh/id_rsa.pub

* some git settings...
git config --global user.email "zheharry@gmail.com"
git config --global user.name "Harry"

* add user binaries in your PATH env of .bashrc
export PATH=/home/dotcloud/env/bin:${PATH}

* change executive attributes
chmod +x ~/repositories/gitosis-admin.git/hooks

* modify ~/repositories/gitosis-admin.git/hooks/
git-update-server-info ---> git update-server-info

* modify ~/.ssh/authorized_keys
command="/home/dotcloud/env/bin/gitosis-serve

2011年5月5日 星期四

nginx

http://b.gkp.cc/2010/10/12/setup-nmp-on-ubuntu-1010/

2011年5月4日 星期三

dotcloud + Drupal 7.0

*use Ubuntu 11.04
sudo apt-get install python-setuptools
sudo easy_install dotcloud

* create namespace (plz change all of "helloworld" for your application)
dotcloud create helloworld

* create services
dotcloud deploy -t php helloworld.www
dotcloud deploy -t postgresql helloworld.pgsql

********** you need to wait for your server available ****************

* download Drupal 7.0 from http://drupal.org/project/drupal
tar zxf drupal-7.0.tar.gz
cd drupal-7.0
git init
git add .
git commit -am 'drupal 7.0'

* setup postgresql at first
dotcloud ssh helloworld.pgsql
# createuser --pwprompt --encrypted --no-createrole --no-createdb drupal
# createdb --encoding=UTF8 --owner=drupal drupal

* tune some settings on your local drupal-7.0
** 000-nginx.conf
location ~ \.php$ {
fastcgi_index index.php;
}

** fastcgi.conf
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffers 256 4k;
fastcgi_intercept_errors on;
## allow 4 hrs - pass timeout responsibility to upstrea
fastcgi_read_timeout 14400;
fastcgi_index index.php;
fastcgi_param PATH_INFO $fastcgi_script_name;

** php.ini
; nginx fix
cgi.fix_pathinfo = 0

** postinstall
#!/bin/sh
[ -d ~/drupal-files ] || mkdir -p ~/drupal-files
ln -sf ~/drupal-files ~/current/sites/default/file

** copy sites/default/settings.php.sample to sites/default/settings.php and modify it with proper settings (not sure if you need to do this)
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => 'drupal',
'username' => 'drupal',
'password' => 'drupal',
'host' => 'pgsql.helloworld.dotcloud.com',
'port' => '4015',
'driver' => 'pgsql',
'prefix' => '',
),
),
);

* and then push your local drupal-7.0 to server
dotcloud push helloworld.www drupal-7.0

* and then connects http://www.helloworld.dotcloud.com/install.php
re-try it and make sure you see the progress bar during "creating database"

Good Luck...

2011年4月11日 星期一

host android git mirror site with gitosis

* use wildcard support gitosis
https://github.com/mzupan/gitosis

* gitosis-post-update problem
http://blog.binfalse.de/2010/10/lost-my-gitosis-post-update/

* get android in repositories folder android/
repo init -u git://git.android-x86.org/manifest.git --mirror
repo sync
(have a cup...)

* modify writable field with wildcard to restricted users
* get manifest at first
git clone git@<serverip>:android/manifest

* change git server upstream to your server by edit default.xml
fetch=git@"<serverip>:/android/"
* and then push back to server
git commit -am 'update local server'
git push

* create your local copy
repo init -u git@<serverip>:android/manifest.git
repo sync


reference:
http://gregmeiste.com/post/3842942731/mirror-android-repositories-on-a-local-server

2011年3月16日 星期三

Debian on Nextvod

debian-rootfs-20101014
http://goo.gl/w1PD1

sysv-rc: /usr/sbin/update-rc.d
dpkg: /usr/sbin/install-info
dpkg: /usr/bin/dpkg
dpkg: /usr/bin/dpkg-split
dpkg: /usr/bin/dpkg-deb
dpkg: /usr/bin/dpkg-query
debianutils: /bin/run-parts

mkdir -p /var/lib/dpkg
mkdir -p /var/lib/dpkg/updates/
mkdir -p /var/lib/dpkg/info/
touch /var/lib/dpkg/available
touch /var/lib/dpkg/status

/etc/apt/trustdb.gpg
/etc/apt/trusted.gpg

http://ftp.debian-ports.org/debian/pool-sh4/main/a/apt/apt-utils_0.8.12_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/a/apt/apt_0.8.12_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/a/apt/libapt-pkg-dev_0.8.12_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/b/bzip2/libbz2-1.0_1.0.5-6_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/r/readline6/libreadline6_6.1-3_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/g/gnupg/gpgv_1.4.11-3_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/g/gnupg/gnupg_1.4.11-3_sh4.deb
http://ftp.debian-ports.org/debian/pool-sh4/main/libu/libusb/libusb-0.1-4_0.1.12-17_sh4.deb

/usr/lib/libstdc++.so.6.0.12
/usr/lib/libz.so.1.2.3.3

apt-get -f install libgcc1 libc-bin
apt-get -f install libacl1 libattr1
apt-get -f install coreutils
apt-get -f install libc6 libstdc++6 zlib1g debian-archive-keyring libdb5.1 gcc-4.5-base readline-cmmon libncurses5 dpkg install-info xz-utils libselinux1 liblzma2

2011年3月10日 星期四

STLinux (for nextvod usage)

* Install on Ubuntu
http://www.stlinux.com/faq?q=node/361

* STAPI
http://www.hwport.com/wiki.php/STLinuxInstall

* Cross-compile for transmission
http://code.google.com/p/wydevices/wiki/Howto_install_STLinux23
http://code.google.com/p/wydevices/wiki/Howto_crosscompile_transmission2_for_wydevices

* rtorrent
http://libtorrent.rakshasa.no/wiki
http://libtorrent.rakshasa.no/browser/trunk/rtorrent/doc/rtorrent.rc?rev=latest

** STLinux should have
stlinux23-sh4-curl-dev
stlinux23-sh4-openssl
stlinux23-sh4-zlib

** hacks if you cannot find libs
/usb/lib/libstdc++.la
/usb/lib/libstdc++.so
/usb/lib/libcurl.so

** sigc++
./configure --host="sh4-linux" --prefix="/opt/STM/STLinux-2.3/devkit/sh4/target/" --libdir="/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib" --disable-documentation
make
make install

** libtorrent
./configure --host=sh4-linux --prefix=/opt/STM/STLinux-2.3/devkit/sh4/target/ --enable-aligned --libdir="/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib"

** xmlrpc-c
*** fix lib/expat/gennmtab/Makefile at first. use host's gcc, instead of sh4-linux-gcc
./configure --host=sh4-linux --prefix=/opt/STM/STLinux-2.3/devkit/sh4/target/ --libdir="/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib"

** rtorrent
./configure --host=sh4-linux --prefix=/opt/STM/STLinux-2.3/devkit/sh4/target/ --libdir="/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib" --with-xmlrpc-c=/opt/STM/STLinux-2.3/devkit/sh4/target/bin/xmlrpc-c-config

** lighttpd
./configure --host=sh4-linux --prefix=/opt/STM/STLinux-2.3/devkit/sh4/target/ --libdir="/opt/STM/STLinux-2.3/devkit/sh4/target/usr/lib" --with-openssl

** pack rpms by checkinstall
http://checkinstall.izto.org/
sudo checkinstall -D --install=no --pkgarch=sh4 --maintainer=Harry --nodoc --strip=no

* Nextvod
https://www.nextvod.com.tw/tw/yiwangle/opensource.jsp
http://stevennick.pixnet.net/blog
http://snowwolf725.blogspot.com

2011年1月6日 星期四

ubuntu forward

sudo iptables -A FORWARD -o usb0 -i eth0 -s 10.0.0.0/24 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A POSTROUTING -t nat -j MASQUERADE
sudo iptables-save | sudo tee /etc/iptables.sav


add "iptables-restore < /etc/iptables.sav" in /etc/rc.local

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