顯示具有 Linux 標籤的文章。 顯示所有文章
顯示具有 Linux 標籤的文章。 顯示所有文章

2012年9月1日 星期六

Setting ThinkPad TrackPoint

Whatever I try, the rc.local still won't work when it boots or reboots.
That's mean I need to run the command manually to change trackpoint speed, sensitivity.


#!/bin/bash
echo -n xxx > /sys/devices/platform/i8042/serio1/speed
echo -n yyy > /sys/devices/platform/i8042/serio1/sensitivity
exit 0
put this shell in /bin/xxx.sh is a little more convenient to use.

2012年1月11日 星期三

Mint update google chrome

since chrome in my mint won't auto-update

so

sudo apt-get install google-chrome-stable

either flashplayer

sudo apt-get install adobe-flahplugin

2011年11月21日 星期一

terminal 快捷鍵


Ctrl + a : 移到行首
Ctrl + e : 移到行尾
Ctrl + u : 刪除到行尾
Ctrl + k : 刪除到行尾
Ctrl + f : 光標以字元向右移動
Ctrl + b :光標以字元向左移動


Alt + f : 光標以單字向右移動
Alt + b :光標以單字向左移動

Ctrl + l:清除螢幕

最小化当前窗口 = Alt + F9
最大化当前窗口 = Alt + F10 

ctrl+alt+f2=linux终端用户(alt + f7返回xwindows,alt+ <- 或-> 进行终端切换)
桌面選擇= Ctrl + Alt + 下箭头,然后按住 Ctrl + Alt 和左/右箭头选择桌面
http://linuxtoy.org/archives/bash-shortcuts.html

2011年10月29日 星期六

LAMP

#how to install lamp - apache2 , mysql , php

sudo apt-get install apache2

#test if http://localhost/  has been works.
_________________________________________________
#install php5 and dependecy

sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart
_________________________________________________
#install mysql

sudo apt-get install mysql-server

#set mysql root password

_________________________________________________

Then get phpmyadmin to control you MySQL by browser

follow instruction in such sample.config file
and rename to erase 'sample'

It should be put in /var/www/

ps.
if  http://localhost/phpmyadmin is not found

check /etc/apache2/apache2.conf
remember restart

PS
if phpmyadmin has something wrong
remove all php5
install php5 / php5-mysql / php5-mcrypt at same time

2011年9月13日 星期二

Linux-tar

tar是Linux上用來封裝(打包)檔案用的

tar [-j|-z] [-cv] -f tar_name target
打包target

tar [-j|-z] [-tv] -f tar_name
察看tar之檔

tar [-j|-z] [-xv] -f tar_name [-C director]
解開tar
-C可指定愈放置檔案之目錄
預設是在當前目錄

-j -z 不要亂加
-j為支援bzip2,tarname要是*.tar.bz2
-z為支援gzip,tarname要是*.tar.gz

-c 打包
-t 察看
-x 解開
-v 顯示詳細內容
-f 檔案
一般用此即可
tar -cvf xxx.tar file
tar -xvf xxx.tar [-C director]

2011年8月15日 星期一

Linux vim copy and paste

if copy and paste can't work

in vim

:h gui-clipboard

add this line in _vimrc
source $VIMRUNTIME/mswin.vim

2011年6月9日 星期四

Ubuntu/Mint 系統邊框 標題列不見

mint ubuntu 系出同門,通常發生的問題一樣

今天開mint赫然發現 邊框跟標題列不見了
所以沒辦法按最小化或是x

參考網路上的方法
首先到home 按ctrl+h 顯示隱藏檔案
將.gonf(如果有.gonfd也要)重新命名

接著 重新啟動gnome
sudo /etc/init.d/gdm restart
(接著不知為啥,文字介面跑一跑就停了,手動重開機後,就恢復了

參考:http://fouvy.info/2011/02/02/ubuntu_gnome_reset/

Linux-sudoer

當要執行一些指令時,可能需要具有管理者的身份
可以先用su切換到root或是
sudo 指令

程式會去檢查/etc/sudoers 該使用者是否有執行sudo的權限
#install sudo
su
apt-get intstall sudo

#add user to sudoers
su

visudo

user ALL=(ALL) ALL (使用者帳號 登入者的來源主機名稱 可切換的身份 可下達的指令)

設定完該使用者即可使用sudo 執行root的指令

2011年5月31日 星期二

Linux-vim gvim settings

#get colors ex:freya (my favorite color

#set
mkdir ~/.vim
cd .vim
mkdir colors
cp colorfile ~/.vim/colors/colorfile

#set vimrc(~/.vimrc)
#gvim_Startup Settings
set autoindent (自動縮排
colorscheme colorname (預設顏色 ex:colorscheme freya
set nu(行號

#if it can't work ,check the file's right
ls -all (to check colorfile's right

# 4space replace tab(tab usually
set expandtab (insert space whenever tab be pressed
set tabstop=4 (the characters of one tab, use :retab that make file match this settings
set shiftwidth=4 (the insertion of the indent

#有可能會有格式錯誤情況
doc2unix colorfile

此提供很多顏色可預覽http://code.google.com/p/vimcolorschemetest/

2011年5月24日 星期二

Linux-cgit

//install git
sudo apt-get install git

//if can't find git
sudo vim /etc/apt/sources.list
>>deb http://ftp.de.debian.org/debian squeeze main
sudo apt-get update

//get cgit and git code
git clone git://hjemli.net/pub/git/cgit
cd ~/cgit
make get-git

//install need lib and package
sudo apt-get install

zlib1g.dev
libssl.dev
curl
make
cc
apache2

//install cgit
sudo make
sudo make install

//setting apache2
sudo vim /etc/apache2/sites-available/default

ScriptAlias /cgit/ /var/www/htdocs/cgit/    #http://localhost/cgit/cgit.cgi
<Directory "/var/www/htdocs/cgit/">
    AllowOverride None
    Options +ExecCGI
    Order allow,deny
    Allow from all

</Directory>

//config 由於cgit不會自己建立設定檔,手動複製範例來改
cp ~/cgit/cgitrc.5.txt /etc/cgitrc

2011年5月18日 星期三

Linux-Vim

//install vim on Linux mint/debian/ubuntu
sudo apt-get install vim

//gui
sudo apt-get install vim-gnome

//open
vim >>terminal直接進入vim
gvim >>terminal另外開啟gvim

**su 登入為root後 無法透過terminal開啟gvim

Linux Mint10-Samba

//Samba share (無須帳號密碼

//install samba
sudo apt-get install samba

//vim /etc/samba/smb.conf(設定檔
[share](win 之目錄名稱
comment = share(註解
path = /var/share/
guest ok = yes
writable = yes
browseable = yes

//更改資料夾權限
chmod 777 /samba path

//win 網路芳鄰即可使用