su
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666"' > /etc/udev/rules.d/51-android.rules
exit
cd ~
wget http://dl.google.com/android/android-sdk_r07-linux_x86.tgz
tar zxvf android-sdk_r07-linux_x86.tgz
cd android-sdk-linux_x86/
./tools/adb devices
./tools/adb shell
ref: this, this and this
| [+/-] |
Replace vino-server with x11vnc on ubuntu 10.04 |
vino-server效能不佳, 故以x11vnc替代之, 記得先停用vino-server:sudo apt-get install x11vnc vnc4server
vncpasswd
x11vnc --quiet -ncache 10 -bg -reopen -forever \
-rfbauth ~/.vnc/passwd -display :0
ref: this.
| [+/-] |
Jdownloader for ubuntu 10.04 |
Another file hosting download manager !sudo add-apt-repository ppa:jd-team/jdownloader
sudo echo 'deb http://ppa.launchpad.net/jd-team/jdownloader/ubuntu lucid main' > /etc/apt/sources.list.d/jd-team-ppa-lucid.list # fix wrong url
sudo apt-get update
sudo apt-get install jdownloader
| [+/-] |
Open anything from command line in ubuntu |
try this:gnome-open ./*
ref: this
| [+/-] |
Disabling the Touchpad Temporarily While Typing |
打字時暫時停用 touchpad .syndaemon -i 1 -d
ref: this
| [+/-] |
Network manager & reslov.conf |
防止 network manager 每次開機後修改 /etc/reslov.conf, 一個 dirty 的方法, 加上 immutable 的屬性:sudo chattr +i /etc/reslov.conf
如果要修改 reslov.conf, 先將 immutable 的屬性拿掉:sudo chattr -i /etc/reslov.conf
| [+/-] |
sun java jdk 6 in ubuntu 9.04 |
按照以下步驟安裝 Sun Java(TM) Development Kit (JDK) 6, 並設定為預設 java.sudo apt-get install sun-java6-jdk
update-java-alternatives -s java-6-sun
ref: this.
| [+/-] |
guake in ubuntu 9.04 |
guake , 一個 quake like 的 terminal, 只能說好用而已. 不過 9.04 apt soure 裡的版本(0.3.x), 設定 hotkey 有問題, 無法正常辨識 keyboard. 所以從 getdeb.net 下載安裝.wget http://old.getdeb.net/download/4288/0
sudo dpkg -i guake_0.4.0-1~getdeb1_i386.deb
| [+/-] |
create cd/dvd iso in ubuntu 9.04 |
建立 iso 最簡單的方式單然是用 dd 啦, 不然用 cat 也可以! dd if=/dev/cdrom of=/tmp/whatever.iso
cat /dev/cdrom > /tmp/whatever.iso
不過今天看到有人說這些方法都不好, 因為沒有辦法即時驗證 or 修復檔案, 原文如下:
Many like to use 'dd' for creating CD/DVD iso images. This is bad. Very那就按照以下步驟使用 readom 吧:
bad. The reason this is, is 'dd' doesn't have any built-in error
checking. So, you don't know if you got all the bits or not. As such, it
is not the right tool for the job. Instead, 'reaom' (read optical media)
from the wodim package is what you should be using. It has built-in
error checking. Similarly, if you want to burn your newly creating ISO,
stay away from 'dd', and use:
wodim -v -eject /path/to/image.iso
- 取得 readom, 位於 wodim 套件裡.
sudo apt-get install wodim - 確定 cd/dvd rom 的 device 沒有被 mount 起來.
umount /media/cdromX - 建立 iso.
readom dev=/dev/cdrom f=/tmp/whatever.iso
ref: this, this & this.
| [+/-] |
emesene in ubuntu 9.04 |
emesene 是在 ubuntu 裡可以取代 msn 的好 IM, 不過在 1.5 版之前有一個令人無法忍受的 bug, 在捲動聯絡人清單的時候很卡, 有時還會 hang 住 or 造成 cpu 的 loading, 不過 offical site 上面並沒有提供 9.04 的 deb 檔, 如果不想自己編譯 tarball, 就按照以下方法更新到 B.J. Stobiecki 維護的1.5 Weekly SVN build 吧.
- 新增 apt source list.
sudo echo '### emesene 1.5 from B.J. Stobiecki
deb http://ppa.launchpad.net/bjfs/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/bjfs/ppa/ubuntu jaunty main' >> /etc/apt/sources.list - 安裝.
sudo apt-get update
sudo apt-get install emesene - finish.
ref: this.
| [+/-] |
ssh tunnel with proxychains in ubuntu 9.04
poster:
MarlboroMoo on
19:49
tag:
proxy,
ssh tunnel,
ubuntu
/
Comments: (0)
|
如果想要讓所有的應用程式都使用 proxy or ssh tunnel, 可以透過使用 proxychains 來達成, 目前支援 HTTP, SOCKS4 and SOCKS5 的 proxy servers(HTTP proxy server 在某些應用程式, 例如 curl 中會出現 "access denied" 的 error, 用 SOCKS4 & SOCKS5 則一切正常).
安裝並使用 proxychains
- 使用 apt-get install 來安裝 proxychains
sudo apt-get install proxychains - 編輯 proxychains 設定檔: /etc/proxychains.conf, 將其中的 chain 型態改為 dynamic_chain, 並於設定檔最下方加入你的 proxy server(可以有多個), 如果 proxy server 需要帳號密碼, 直接寫在 proxy server 後方, 並以空格分開.
sudo vi /etc/proxychains.conf設定檔範例如下:...
...
dynamic_chain
#strict_chain
#random_chain
...
...
http proxy.hinet.net 80
http proxy.hack.net hack iamhack # username = hack , password= iamhack - 以下列的方法啟動你的應用程式, 以 curl 為例.
proxychains firefox如果覺得每個程式要這樣啟動很麻煩, 也可以直接啟動一個 shell, 只要在這 shell 裡執行程式都可以使用 proxy.proxychains bash
- 建立 ssh tunnel.
ssh -fND 6666 root@remote_host -p 80 - 將 ssh tunnel 加入 proxychains 的 proxy list 中.
echo 'socks4 127.0.0.1 6666' >> /etc/proxychains.conf - 執行程式.
proxychains wget www.google.com.tw
ref: this, this & 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.
| [+/-] |
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)
| [+/-] |
world of warcraft in ubuntu 9.04 #1 |
自從烏妖王阿薩司出現不久後, 就 quit WOW 了. 不過最近手癢又想重回愛澤拉斯去晃晃, 提外話. 在 ubuntu 下要安裝 WOW 目前的最佳選擇應該是使用 WINE . 按照以下步驟來安裝:
確認顯示卡是否支援:glxinfo | grep rendering出現以下訊息就 ok 了, 如果不是, 請確定你已經正確的安裝了顯示卡驅動程式.direct rendering: Yes
安裝並設定 WINE:
- 安裝 WINE, 使用 Ubuntu Tweak(my option) or 按照以下步驟安裝.
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | \
sudo apt-key add -
sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/jaunty.list \
-O /etc/apt/sources.list.d/winehq.list
sudo apt-get update
sudo apt-get install wine - 調整 WINE 的參數以符合 WOW 的運行環境, 執行以下指令啟動 WINE 控制台.
winecfg - 切換到"應用程式"的分頁, "Windows 版本"選擇"Windows 2000".
- 切換到"顯示"的分頁,
"視窗設定"的部份:除了"允許視窗管理器控制視窗"之外其餘不勾選.
"Direct 3D"的部份:"Vertex Shader 支援"選擇"硬體" - 切換到"音效"的分頁,
"音效驅動程式"的部份:只勾選"ALSA驅動" (如果不行, 試試看 OSS驅動 )
"Direct Sound"的部份:"硬體加速"選擇"完全". - 使用以下指令啟動 regedit:
wine regedit - 於 HKEY_CURRENT_USER -> Software -> Wine 機碼右鍵選擇 新建 -> 關鍵詞, 名稱填入 "OpenGL", 於 HKEY_CURRENT_USER -> Software -> Wine -> OpenGL 機碼右鍵選擇 新建 -> 字符串值, 名稱填入 "DisabledExtensions", 內容填入 "GL_ARB_vertex_buffer_object".
- 取得安裝程式, 去7-11買(my option) or 從官網下載.
- (從官網下載安裝程式請跳過此步驟.) 將安裝光碟中的檔案複製到系統中以方便日後安裝
sudo umount /dev/cdrom
sudo mount -t udf -o ro,unhide,uid=1000 /dev/cdrom /media/cdrom0
mkdir -p ~/wow-iso/
sudo cp -ra /media/cdrom0/* ~/wow-iso/
chmod -R 777 ~/wow-iso/
cd ~/wow-iso/ - 使用 WINE 開始安裝, 不要傻傻的等, 去撒尿 + 拉屎 + 洗澡之後, 應該就好了.
wine ./Installer.exe - 接著安裝程式應該會自動啟動 Launcher.exe 並準備開始更新, 第一次執行的時候有機會 hang 住 or error(我有遇到), 使用以下指令來重新啟動.
wine "C:\Program Files\World of Warcraft\Launcher.exe" --opengl - 看完一份頻果日報應該就更新完畢了 ;) 關閉 Launcher.exe, 並新增設定值至 WOW 安裝目錄下的 *.wtf 檔案之中.
cd "~/.wine/drive_c/Program\ Files/World of Warcraft/WTF/"
for this_config in *.wtf
do
echo 'SET gxApi "opengl"
SET ffxDeath "0"
SET ffxGlow "0"
SET ffxNetherWorld "0"
SET MasterSoundEffects "0"
SET SoundBufferSize "150"
SET SoundOutputSystem "1"' >> $this_config
done - 啟動遊戲吧!! "應用程式 -> Wine -> Programs -> 魔獸世界 -> 魔獸世界" or 使用以下指令來執行:
wine "C:\Program Files\World of Warcraft\WoW.exe"
| [+/-] |
gcin icons in ubuntu 9.04 |
default 的 gcin's icons .. err. 按照下面的步驟來更換.
- 到 gcin 的 forum 來選擇喜歡的 set 下載.
wget http://hyperrate.com/topic-files-dir/19/919-RP_Q4q6fnw/gcin_icons-20080229.tar.gz - 解壓縮檔案, 並將尬意的 set 中 *.png 檔案(我喜歡那圓滾滾的貓咪)置放於 ~/.gcin/icons/ 目錄下方.
tar zxvf ./gcin_icons-20080229.tar.gz
mkdir -p ~/.gcin/icons/
cp -r ./gcin_icons-20080229/catjiji/* ~/.gcin/icons/ - 重起 gcin 的服務.
killall -9 gcin && gcin & - Done.
| [+/-] |
7zip in ubuntu 9.04 |
在 ubuntu 9.04 裡要使用 7zip, 需要額外安裝套件, 參考以下步驟安裝.sudo apt-get install p7zip-fullref: this.