Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Thursday, February 23, 2012

How to support exFAT on ubuntu

sudo apt-add-repository ppa:relan/exfat
sudo apt-get update
sudo apt-get install fuse-exfat

Success on 11.04


If you use 10.04, you should continue below.
Success on 10.04
sudo mkdir /media/Data
sudo mount -t exfat-fuse /dev/sda6 /media/Data


[Unmount]
sudo umount /media/Data


Note:
'/dev/sda6/ is Device ID, please check in System -> Administration ->  Disk Utility.

Friday, August 19, 2011

Friday, February 18, 2011

grep

-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.


-A NUM,--after-context=NUM
Print NUM lines of trailing context after matching lines. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.

-C [NUM], -NUM, --context[=NUM] 
Print NUM lines of output context. Places a line containing a group separator (--) between contiguous groups of matches. With the -o or --only-matching option, this has no effect and a warning is given.

Monday, June 28, 2010

7z in Ubuntu

sudo apt-get install p7zip-full

//x: Extract with full paths
7z x 7zfile

Thursday, March 26, 2009

Delete large number of file by 'find and rm'

find ./ -iname 'test-file-*' | xargs rm -rf

rm 有最大刪除檔案的限制,大概是 2 萬個,若超過會出現錯誤訊息。
The maximum file limitation of deletion one time about 20 thousand.

引用:使用 find 搭配 rm 刪除大量檔案

Wednesday, March 11, 2009

VSFTPD

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

Monday, February 16, 2009

ADB on windows and Ubuntu Linux

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

Thursday, November 6, 2008

Remote desktop and SSH on 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

Wednesday, November 5, 2008

Disable system beep~~

1. vi ~/.inputrc
set bell-style none
2. vi ~/.vimrc
set vb
3. vi ~/.bashrc
alias less='less -Q'

Reference:
關閉惱人的嗶嗶聲