adduser --system --shell /bin/bash --gecos 'git version control' --group --disabled-password --home /home/git git # copy my public key file (howang.pub) into /home/git cp howang.pub /home/git/ chown git:git /home/git/howang.pub # switch to the git user su - git # install and setup gitolite git clone git://github.com/sitaramc/gitolite mkdir -p $HOME/bin gitolite/install -to $HOME/bin bin/gitolite setup -pk howang.pub exit # clone the gitolite-admin repo git clone git@localhost:gitolite-admin cd gitolite-admin # here I edit the config files and add public keys # after that, commit and push to apply the new configurations git commit -m "updated config" git push origin master
星期三, 3月 06, 2013
在 linux 上使用 gitolite 架設 git 伺服器
基本上按著 gitolite 官方說明就可以,唯一難題是官方說明書沒教我們怎開設 gitolite 專用的登入帳號,花了點時間 Google 就有答案了。
星期四, 1月 17, 2013
Raspberry Pi 筆記
第一步,更新:
安裝並轉用 vim:
設定 reverse tunnel:
安裝 VNC:
安裝 Firefox:
安裝 Chrome:
播放 MP3:
設立 AirPrint:
設定時區:
播放 H.264 / MP4 影片:
暫停/繼續一個 process:
(將會持續更新...)
sudo apt-get update sudo apt-get upgrade -y
安裝並轉用 vim:
sudo apt-get install vim sudo update-alternatives --config editor
設定 reverse tunnel:
sudo apt-get install autossh # allow connect to SSH via port 65522 on server.tld autossh -NfR 65522:localhost:22 user@server.tld # add the above line with @reboot prefix in crontab crontab -e
安裝 VNC:
sudo apt-get install tightvncserver # run it once to set password tightvncserver # start vnc server with display 0 at 1920x1080 resolution vncserver :0 -geometry 1920x1080 -depth 24
安裝 Firefox:
sudo apt-get install iceweasel
安裝 Chrome:
# Install ttf fonts sudo apt-get install ttf-mscorefonts-installer ttf-wqy-zenhei # Install Chromium (Open Source version of Chrome) sudo apt-get install chromium-browser
播放 MP3:
sudo apt-get install alsa-utils ntpdate mpg123 python-virtualenv libshout3 libshout3-dev pkg-config python-dev sudo modprobe snd_bcm2835 sudo amixer cset numid=3 1 mpg123 filename.mp3
設立 AirPrint:
sudo apt-get install avahi-daemon avahi-discover libnss-mdns cups cups-pdf python-cups sudo usermod -aG lpadmin pi # add "Allow from @Local" to Location section of / , /admin and /admin/conf sudo vim /etc/cups/cupsd.conf # add mine types for AirPrint sudo echo '# # "$Id: $" # # AirPrint type image/urf urf string(0,UNIRAST<00>) # # End of "$Id: $". # ' | sudo tee /usr/share/cups/mime/airprint.types > /dev/null sudo echo '# # "$Id: $" # # AirPrint # Updated list with minimal set 25 Sept image/urf application/pdf 100 pdftoraster # # End of "$Id: $". # ' | sudo tee /usr/share/cups/mime/airprint.convs > /dev/null sudo service cups restart ### go to https://raspberrypi:631/ and setup the printer # download and run the airprint-generate script wget https://raw.github.com/tjfontaine/airprint-generate/master/airprint-generate.py chmod 0755 airprint-generate.py sudo ./airprint-generate.py -d /etc/avahi/services sudo service avahi-daemon restart 00>
設定時區:
sudo dpkg-reconfigure tzdata
播放 H.264 / MP4 影片:
omxplayer filename.mp4 ### Key bindings # Key Action # 1 Increase Speed # 2 Decrease Speed # j Previous Audio stream # k Next Audio stream # i Previous Chapter # o Next Chapter # n Previous Subtitle stream # m Next Subtitle stream # s Toggle subtitles # q Exit OMXPlayer # Space Pause/Resume # p Pause/Resume # - Decrease Volume # + Increase Volume # Left Seek -30 # Right Seek +30 # Down Seek -600 # Up Seek +600
暫停/繼續一個 process:
kill -STOP <pid> kill -CONT <pid>
(將會持續更新...)
星期一, 1月 14, 2013
不用任何外置裝置在 MacBook Air 上重裝 Window 7
標題很長,但因為我的處境太奇怪,所以只好寫成這樣...
方法主要根據 SevenForums 上的 How to Install Windows 7 FAST without a DVD or USB Device,再加上幾個步驟。
我的處境:
方法主要根據 SevenForums 上的 How to Install Windows 7 FAST without a DVD or USB Device,再加上幾個步驟。
我的處境:
- 電腦: Apple MacBook Air
- 沒有光碟機
- 沒有 USB Disk
- 主系統: Mac OS X 10.8
- BOOTCAMP 系統: Windows 8
使用軟件:
- VMware Fusion 5
- Windows XP
- ImageX
目的: 移除超難用而且兼容性太低的 Windows 8,重新安裝 Windows 7
步驟:
- 在 OS X 上,使用 vmware-rawdiskCreator 製成一個指向 BOOTCAMP 硬碟分割的 vmdk 檔案
- 修改我原有的 Windows XP VM(虛擬機) 的 VMware 設定檔 (vmx 檔),為 VM 加入 BOOTCAMP 硬碟
- 啟動 Windows XP VM,在 VMware 中掛載 Window 7 的 ISO 檔
- 在 XP 中格式化 BOOTCAMP 硬碟分割
- 根據 How to Install Windows 7 FAST without a DVD or USB Device 的方法,使用 ImageX 工具把 Windows 7 的 install.wim 套用到 BOOTCAMP 碟碟分割中
- 把 Windows XP VM 關機,修改 vmx 檔,刪去原有 Windows XP 的虛擬硬碟
- 重新啟動 Windows XP VM,這次使用 Windows 7 的 ISO 檔 boot 機,選擇 "Repair my computer" 並開啟 Command Prompt (命令提示字元)
- 輸入:
- 把 Windows XP VM 關機(重要:千萬不要在 VM 中用 BOOTCAMP 碟碟分割開機,會令安裝失敗的)
- 重新啟動電腦,使用 BOOTCAMP 開機,Windows 7 會自動完成安裝 ^.^
/Applications/VMware\ Fusion.app/Contents/Library/vmware-rawdiskCreator create /dev/disk0 1 "/Users/howang/Desktop/bootcamp" ide
ide0:0.present = "TRUE" ide0:0.fileName = "/Users/howang/Desktop/bootcamp.vmdk"
imagex /apply d:\sources\install.wim 5 e:\
c:\windows\system32\bcdboot c:\windows d:\boot\bootsect /nt60 c:
星期三, 3月 18, 2009
星期三, 10月 03, 2007
學校check學生的xanga?
一看標題,咦!?不是舊聞嗎?對!不過基於某些原因近日我回想此事有感而發,希望分享一下意見。很多人在forum大吐苦水,學校追究他/她在xanga上寫的言論,受害人多數認為xanga是私人的網上日記,不應被學校干涉。其實受害人的xanga本身可以在網上被任何人觀看,既然寫了在xanga上,就要有心理準備該日記會被任何人閱讀,受害人根本沒有考慮這一點,就把很多不見得人的文字寫上,被看到被追究是自找的。沒錯我自己也曾把不能被某些人看見的事寫在網誌中,但很多到了現在被那些不應看到的人看到也不重要了。我也曾利用xanga去查看究竟別人怎樣看我,當然寫的人不會直接對我說,但這卻令我知道那些人喜歡我,那些人討厭我,從而進行自我反思,並找出別人討厭我的原因,繼而改善我的待人接物態度,取得更好的人際關係,但世人並不是個個都像我,現實中,看的可能是老闆,可能是上司,也可能是敵人,結果會是怎樣,也不用多說吧。如果大家有什麼不吐不快,不妨試試隱藏自己的身份,又或者善用blogger的權限管理,打造真正私人的網誌。
xanga?算把啦,支持blogger無廣告、速度快!
xanga?算把啦,支持blogger無廣告、速度快!
訂閱:
文章 (Atom)
