遇到一則奇怪的問題, 使用 live cd(parted magic,knoppix)開機後, 可以對 device 做 fdisk, 但無法 format or mount, 會出先現 message: "/dev/sdx is apparently in use by the system; will not make a filesystem here!", 疑似為 live cd 中 lvm 的 bug, 需要使用以下指令解決./sbin/dmsetup status # Outputs status information for each of the device's targets
err.. 改天再來 debug 一下.
/sbin/dmsetup remove_all # remove all device definitions
ref: this.
[+/-] |
can't format or mount device with live cd |
[+/-] |
SimpleHTTPServer with Python |
如果需要提供臨時的 http service, 可以透過 Python 內建的 module: SimpleHTTPServer 來達成. python 真的很強大 ;) mkdir -p /tmp/tmp-www-root/
如果要停止服務, 只要按下 ctrl+c 就可以了.
cd /tmp/tmp-www-root/
echo 'hello world' > index.html
python -m SimpleHTTPServer 80 # bind to port 80
ref: this.
[+/-] |
compile source code in ubuntu 9.04 |
預設 ubuntu 是不會安裝一些 compile 用的 package & library, 需透過以下指令安裝.sudo apt-get install build-essential
ref: this.
[+/-] |
Ubuntu Skills |
只要你是使用 ubuntu, 就應該看看這份文件: UbuntuSkills, 位於 ubuntu.org.cn 的 wiki.
[+/-] |
GAppProxy in ubuntu 9.04
poster:
MarlboroMoo on
11:43
tag:
google app engine,
proxy,
ubuntu
/
Comments: (0)
|
什麼是 GAppProxy? 一個開源的 HTTP Proxy 軟件, 使用Python編寫, 運行於 Google App Engine 上. 所以我們可以用 GAppProxy 來翻牆啊啊啊啊啊 !(咳咳, @ o f f i c e ?) 或是使用一些限定身處 USA 才能使用的 web service, let's go !
- 申請 Google App Engine 帳號.
- 安裝 Python.
sudo apt-get install python
- 下載並解壓縮 Google App Engine SDK for Python 壓縮檔.
mkdir ~/gapp/ && cd ~/gapp/
wget http://googleappengine.googlecode.com/files/google_appengine_1.2.5.zip
unzip google_appengine_1.2.5.zip - 下載並解壓縮 GAppProxy 原始碼, 可以使用 fetchserver-1.0.0beta-fix.tar.gz 或是 svn 版本 (r97 已可 fetch 大檔案 & 看 youtube). 按照下面步驟來抓取 svn 版本.
cd ~/gapp/
svn checkout http://gappproxy.googlecode.com/svn/trunk/ gappproxy - 編輯 ~/gapp/gappproxy/fetchServer/ 目錄下的 app.yaml(將application: 參數改為你的 Google App Engine 名稱, version: 隨你喜歡更改) 和 index.yaml (除第一行 indexes: 外, 確定其他行的行首都用 # 來 mark 起來) 設定檔, 內容如下:
app.yamlapplication: YOUR_APP_NAME
version: 1
runtime: python
api_version: 1
handlers:
- url: /fetch.py
script: fetch.py
- url: /admin.py
script: admin.py
index.yamlindexes:
# AUTOGENERATED
# This index.yaml is automatically updated whenever the dev_appserver
# detects that a new type of query is run. If you want to manage the
# index.yaml file manually, remove the above marker line (the line
# saying "# AUTOGENERATED"). If you want to manage some indexes
# manually, move them above the marker line. The index.yaml file is
# automatically upoladed to the admin console when you next depoly
# your application using appcfg.py.
# Unused in query history -- copied from input.
#- kind: AccessDestination
# properties:
# - name: counter
# direction: desc
# Unused in query history -- copied from input.
#- kind: AccessFrom
# properties:
# - name: counter
# direction: desc - 將 fetchserver 上傳到 Google App Engine, 按照以下步驟進行(過程中會要求你輸入 gamil 的帳號和密碼.):
cd ~/gapp/
cp -r ./gappproxy/fetchServer/ ./google_appengine/
cd ./google_appengine/
appcfg.py update fetchserver - 編輯 lolcalproxy 設定檔 ~/gapp/gappproxy/lolcalproxy/proxy.conf , 指向你位於 Google App Engine 上的 fetchserver, 內容如下:
# GAppProxy configuration
# olcal_proxy
#olcal_proxy = host:port
#
# If olcal proxy needs authentication:
#olcal_proxy = user:passwd@host:port
# fetch server
#fetch_server = http://127.0.0.1:8080/fetch.py
fetch_server = http://YOUR_APP_NAME.appspot.com/fetch.py
#fetch_server = http://fetchserver-noolg.appspot.com/fetch.py - 啟動 lolcalproxy service, 按照以下指令進行:
~/gapp/gappproxy/lolcalproxy/proxy.py
- 設定你的 web browser 指向 lolcalproxy(127.0.0.1:8000), firefox 可以使用 FoxyProxy 來方便切換.
- Enjoy it ;)
[+/-] |
slowly ssh in ubuntu 9.04 |
使用以下設定來解決在 ubuntu 9.04 中, ssh 到遠端主機登入畫面緩慢出現的狀況.echo "GSSAPIAuthentication no" >> ~/.ssh/config
ref: this.
[+/-] |
book of linux's hack
poster:
MarlboroMoo on
20:40
tag:
linux,
linux hack
/
Comments: (0)
|
[+/-] |
world of warcraft in ubuntu 9.04 #2 |
幾個小 tip:
- 手動建立 WOW 的 icon, 按照以下步驟執行後, 可以在 "應用程式 -> 遊戲" 找到名為 World of Warcraft 的圖示.
wget http://kde-files.org/CONTENT/content-files/41569-wow-icon-scalable.svg
sudo mv 41569-wow-icon-scalable.svg /usr/share/icons/
echo '[Desktop Entry]
Encoding=UTF-8
Name=World of Warcraft
Name[hr]=World of Warcraft
Exec=wine "C:\Program Files\World of Warcraft\Launcher.exe" --opengl
Icon=41569-wow-icon-scalable.svg
Terminal=false
Type=Application
Categories=Application;Game;
StartupNotify=false' > /usr/share/applications/wow.desktop - 可以手動調整 wine 的解析度, 於 wow 中選擇. 執行以下指令啟動 WINE 控制台.
winecfg
切換到"顯示"的分頁,"視窗設定"的部份:勾選"允許視窗管理器裝飾視窗", "允許視窗管理器控制視窗", "模擬一個虛擬桌面", 桌面大小填入適合你的解析度.(以 1280x1024 解析度, 填入 1280x950 較適合, 1280x840, 則填入 1280x730). - 如果遊戲中出現人物不停搖屁股, 或是控制方向不聽使喚的情況, 請做此設定:
"系統 -> 偏好設定 -> 鍵盤 -> 自動重複按鍵", 取消勾選"當按下按鍵不放時重複輸出該字元".(目前已知為 xorg 的 bug)