7z in Ubuntu
June 28, 2010 at 2:42 am | Posted in ubuntu | Leave a commentTags: Ubuntu
sudo apt-get install p7zip-full
//x: Extract with full paths
7z x 7zfile
grep
April 26, 2010 at 8:08 am | Posted in android | Leave a commentTags: Ubuntu
-i, –ignore-case
Ignore case distinctions in both the PATTERN and the input files. (-i is specified by POSIX.)
-R, -r, –recursive
Read all files under each directory, recursively; this is equivalent to the -d recurse option.
-v, –invert-match
Invert the sense of matching, to select non-matching lines. (-v is specified by POSIX.)
-w, –word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore.
Delete large number of file by ‘find and rm’
March 26, 2009 at 1:04 am | Posted in android | Leave a commentTags: tips, Ubuntu
find ./ -iname ‘test-file-*’ | xargs rm -rf
rm 有最大刪除檔案的限制,大概是 2 萬個,若超過會出現錯誤訊息。
The maximum file limitation of deletion one time about 20 thousand.
VSFTPD
March 11, 2009 at 2:15 am | Posted in android | Leave a commentTags: Ubuntu, vsftp
sudo apt-get install vsftpd
sudo vi /etc/vsftpd.conf
1. anonymous_enable=NO
2. local_enable=YES
3. write_enable=YES
sudo /etc/init.d/vsftpd restart
ADB on windows and Ubuntu Linux
February 16, 2009 at 6:59 am | Posted in android | 5 CommentsTags: adb, Ubuntu
On windows:
If you’re developing on Windwos (32-bit only), you need to install the USB driver for adb:
1. Download the driver ZIP file and unzip it.
2. Connect your Android device via USB. When the Found New Hardware Wizard appears, you’ll be asked if you’d like Windows Update to search for software, select No, not this time and click Next.
3. Select Install from a list or specified location and clieck Next.
4. Select Search for the best driver in these locations. Browse and select the unzipped file.
5. Click Finish. You’re all set.
On Ubuntu Linux
1.
Plug-in your device then exec command ‘lsusb’ then you will see the list of current usb devices
Bus 003 Device 023: ID 18d1:d00d
We will see a device is appeared when it plug-in and disappeared when it plug-out. That device is we wanted and take my environment as an example it is located at line 1, “Bus 003 Device 023: ID 18d1:d00d”, without device provider.
2. Login as root and create this file: /etc/udev/rules.d/50-android.rules
For Gusty/Hardy, edit the file to read:
SUBSYSTEM==”usb”, SYSFS(idVendor)==”18d1“, MODE=”0666″
For Dapper, edit the file to read:
SUBSYSTEM==”usb_device”, SYSFS(idVendor)==”18d1“, MODE=”0666”
P.S. the “18d1” is hard coded in android/kernel/drivers/usb/gadget/android_adb.c
#define DRIVER_VENDOR_ID
2. Nwx execute:
chmod a+rx /etc/udev/rules.d/50-android.rules
3. Restart udev to make the rule active.
sudo /etc/init.d/udev restart
Remote desktop and SSH on Ubuntu
November 6, 2008 at 5:07 am | Posted in android | Leave a commentTags: Remote desktop, SSH, Ubuntu
[SSH]
Ubuntu 預設沒有 SSH, 必須自行安裝。
sudo apt-get update
sudo apt-get install ssh
安裝完檢查有無 start ssh
ps -aux | grep ssh
若有看到 /usr/bin/ssh 就代表已經 started。
若無,手動啟動
sudo /etc/init.d/ssh restart
[遠端桌面]
1. 打開 ubuntu 內的系統 -> 偏好設定 -> 遠端桌面
勾選
– 允許其他使用者觀看你的桌面
– 允許其他使用者控制你的桌面
– 設定使用者輸入密碼
(如果勾選 “詢問你以確認” 一欄則每次登入桌面時便要在 ubuntu 內確認)
2. 下載一個 VNC Free Edition Viewer for Windows 免費軟件 (可以不填資料, 直接按 processed downloads)
下載網址: http://www.realvnc.com/cgi-bin/download.cgi
3. 執行下載回來的 vnc-4_1_2-x86_win32_viewer.exe
– 在 server 一欄填入 ubuntu 電腦的 IP
(如果不知道 ubuntu 電腦的 IP, 在 ubuntu 終端機內輸入 “sudo ip addr show” 便會顯示正確 IP)
– 連接好 Ubuntu 後便會跳出輸入密碼的窗口, 輸入密碼後便可登入及操作你的 Ubuntu
Disable system beep~~
November 5, 2008 at 2:19 pm | Posted in android | Leave a commentTags: tips, Ubuntu
1. vi ~/.inputrc
set bell-style none
2. vi ~/.vimrc
set vb
3. vi ~/.bashrc
alias less='less -Q'
Reference:
關閉惱人的嗶嗶聲
Create a free website or blog at WordPress.com.
Entries and comments feeds.