2013年1月31日 星期四

[html/css] 解決IE下youtube影片蓋住其他物件

跟著以下步驟 , 即可解決IE下的youtube嵌入影片時遮住其他物件的問題

原本iframe :
<iframe id='video' src="http://www.youtube.com/embed/xm_kl-MnbGY" frameborder="0" allowfullscreen></iframe>

網址最後加上 : ?wmode=transparent

變成 : 
<iframe id='video' src="http://www.youtube.com/embed/xm_kl-MnbGY?wmode=transparent" frameborder="0" allowfullscreen></iframe>






2013年1月30日 星期三

[GIT] 基本指令

#顯示目前索引有哪些檔案
#通常用在 , 如果不小心add或是要將已commit過的檔案從索引中移除而又不想要刪除檔案(也就是檔案仍存在)時使用
#顯示 sha1碼 , 及檔名
git ls-files --stage


#將t2.php從索引中移除
#通常與 git ls-files --stage 一起使用 , 先查詢要移除的檔案是否在索引中 , 再使用 git rm --cached t2.php 來移除
#並不會將檔案移除 , 只會將檔案從索引中移除
git rm --cached t2.php

#刪除repo,遞迴跟強制不詢問是否刪除。
$ rm -rf .git

#是看git 的commit線圖,要另外安裝
$ tig


init
#架一個server,本身不編輯檔案。如果架好了可以使用 git clone git@localhost:~/path   下載
$ git init --bare 



clone
git clone https://jexlin@bitbucket.org/jexlin/jexpoyi.git test
* 下載git的repo
* 指定下載後的資料夾名稱為test


remote
#查看remote目前有什麼
git remote

#刪除origin
git remote rm origin

#檢視目前origin的資訊
git remote show origin

#遠端branch更新到本機branch
git remote prune origin
* 遠端相關


config
#查看你的git設定內容。
#也可以使用cat ~/.gitconfig顯示你的.gitconfig設定
$ git config --list

#設定名稱;--global表示全域的設定。
$ git config --global user.name "jex"

#設定email
$ git config --global user.email "italwaysrainonme@gmail.com"
* git的設定檔


log
#加上--stat比不加上多出修改的地方
$ git log --stat

#精簡的log,每一次的commit資訊為一行,只顯示前7碼的SHA1及message
$ git log --oneline
* 查看commit紀錄


branch
#開一個分支叫做develop
$ git branch develop

#列出所有branch
$ git branch
  develop
* master

#顯示branch的資料
$ git branch -a
  develop
* master
  remotes/origin/master

#顯示branch的詳細資料
$ git branch -v
  develop 3536c6e 20130408 01:30 no send email and OK page
* master  3536c6e 20130408 01:30 no send email and OK page

#列出已經merge的branch
$ git branch --merged
  develop
* master

#列出尚未merge的branch
$ git branch --no-merged

#修改branch的名稱。,develop改成developXD
$ git branch -m develop developXD

#刪除branch
$ git branch -d developXD
Deleted branch developXD (was 3536c6e).

#看remote branch
$ git branch -r
  origin/master
* 分支


merge
#加上 --no-ff 作用是讓commit log紀錄您是開分支出去再merge回來的。
$ git merge --no-ff develop
* 合併分支
* 參考appleboy教學


add
#還不知道--patch用途
$ git add --patch
Only binary files changed.
* 增加進stage
* y 加到stage
* n 不要加到stage
* s 可以拆小一點hunk



checkout
#還原修改過的檔案
#1. 新增一個dd.txt的檔案,裡面文字輸入"123"
#2. git add dd.txt (加入stage)
#3. 將dd.txt的文字資料由123改為456
#4. 我後悔了,我想還原此次修改
#5. 輸入:$ git checkout -- dd.txt
#6. 資料確實還原為123了
$ git checkout -- 

#新增develop並且切換過去
$ git checkout -b develop

#myfeature會是由develop分支出來的branch
$ git checkout -b myfeature develop

#使檔案回復成最近一次commit的狀態
$ git checkout -- test.php

#強制回復己在add狀態被修改過的檔案, Untracked files則不受影響
git checkout -f

#所有track中且修改過的檔案回復成最近一次commit的狀態
git checkout .
* 切換branch


commit
#--amend改變最後一次commit訊息
#1. 假設最近一次commit的訊息是QQQ
#2. 然候我修改了一份檔案,突然想到,剛剛的commit訊息打錯了
#3. 於是輸入:$ git commit --amend -m "XXX" ,將原本訊息的QQQ改成XXX
#註 : 但是注意,雖然語法有commit,但是並不會將剛剛修改的檔案commit到最近一次的commit
#     ,所以可以放心使用,只僅僅會改變最近一次commit的訊息而已,資料不會變動
$ git commit --amend
* 提交


diff
#比較上一個commit的差異
$ git diff HEAD^

#觀看非stage與上一版本的差異,未add過
$ git diff --

#觀看stage與上一版本差異,已add過
$ git diff --cached

#比較branch的差異
$ git diff branch

#查看差異的概要
$ git diff --stat

#比較兩個commit差異
$ git diff sha1..sha1
* 比較差異
* ctrl + z 離開


pull
#避免不必要的 Merge
#公司的高手教學:
#Joseph: 我們常常在 git pull 時會產生一次的 Merge 也就是針對你本地端的 Repo 跟 miiicasa 的 Repo
#        所以在 commit log 上都會有一堆 Merge 的訊息,但其實這個是沒必要的垃圾訊息,可用此避免。
#Ash Wu: 可以在 ~/.gitconfig 設定
#        [branch]
#          autosetuprebase = always
#        就可以預設 git pull --rebase 了,當然,需要不 rebase 的狀況可以用 git pull --no-rebase。
git pull --rebase
* 將repo從git server拉回本機


push
#加上 -f 是強制push, github之前的commit 紀錄會不見,只會有目前這個branch的commit 紀錄
$ git push origin master -f






---
參考資料:
http://blog.wu-boy.com/2011/03/git-%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6-branch-model-%E5%88%86%E6%94%AF%E6%A8%A1%E7%B5%84%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%B4%B9/

[GIT] 設定.gitignore 忽略檔案不被track

這是一個簡單的範例幫助你忽略某些檔案 , 使其不被track

2013年1月28日 星期一

[html/css]解決IE7下,display:inline-block失效問題

IE7不支援display:inline-block , 但是只要加上兩行css即可

*display:inline;      //只有IE7會解讀
zoom:1;                //只有IE支援 , 設定對象的縮放比例 , 作用通常是用來清除浮動

註 :
‧ 在屬性前加下劃線(_),那瀏此屬性只會被IE6解釋
‧ 在屬性前加星號(*),此屬性只會被IE7解釋
‧ 在屬性值後面加"\9",表示此屬性只會被IE8解釋


參考 :
http://sky.boncity.com/IT/CSS.html

2013年1月14日 星期一

[linux] 檔案權限


-rw-r--r--  1  root               root  177  Oct  5 02:24   index.html
-rw-r--r--  1  webadmin   root  425  Jan 12 21:37  test.php
       ↑        ↑       ↑             ↑        ↑                   ↑           ↑
1.權限 2.連結 3.擁有者 4.群組 5.檔案容量 6.修改日期 7.檔名


以下解釋各是代表什麼意義 :

1.   -rwxrw-r-x

* 第1位如果是檔案就會是 dash( - ) , 如果是目錄就會是 d

* 第2~4位是檔案擁有者之權限 , dash( - ) 代表沒有權限

* 第5~7位是檔案所屬群組之權限 , dash( - ) 代表沒有權限

* 第8~10位是其他人的權限 , dash( - ) 代表沒有權限
註:
        r = 讀取
        w = 寫入
        x = 執行
        排序是 rwx。
        1 = 允許,0 = 不准

2. 代表有多少檔名連結到此節點  (我還不太懂什麼意思)

3. 檔案擁有者的帳號

4.檔案所屬的群組

5.檔案容量 , 單位為bytes

6. 建檔日期或是最近修改日期

7. 檔名 , 檔名前多一個點( . )代表是隱藏檔



----------
參考:
http://linux.vbird.org/linux_basic/0210filepermission.php  鳥哥
http://blog.xuite.net/frle/Ubuntu/22671285

[linux] 基本指令

#看系統內核等信息
$ uname -a
Linux jexpoyi 2.6.32-042stab059.7 #1 SMP Tue Jul 24 19:12:01 MSK 2012 x86_64 x86_64 x86_64 GNU/Linux

#查看系統資訊 (等同輸入 cat /proc/version )
$ more /proc/version
Linux version 2.6.32-042stab059.7 (root@rh6-build-x64) (gcc version 4.4.6 201203
05 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Tue Jul 24 19:12:01 MSK 2012


#查看目前Linux版本
$ cat /etc/issue
Ubuntu 12.04.1 LTS \n \l

#顯示linux版本
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:        12.04
Codename:       precise

#看程式執行狀態
$ ps -aux

#與 ps-aux 類似,不過它是動態的
$ top

#假如修改過的檔案,要再讓它重新執行一次(例如:設定檔)
$ source  .bash_profile



locate
$ locate fb.php
/usr/share/phpmyadmin/libraries/tcpdf/fonts/dejavuserifb.php
/var/www/test/fb.php
* 尋找檔案位置
* 找不到檔案時,先更新資料庫(/var/lib/mlocate/), 輸入 updatedb


find
$ find ./ -name fb.php
./test1/fb.php
./fb.php
* 尋找檔案的指令,會將欲尋找的檔案找出來,語法:
* find 路徑 -name 檔名


whereis
$ whereis bin
bin: /usr/local/bin
* 尋找檔案,whereis 利用曾經找過的系統資訊內的資料去找檔案,所以速度會很快 * 不過,如果 whereis 找不到的話,並不代表該檔案真的不存在!


date
$ date
Sat Apr 20 17:57:56 MSK 2013
* 顯示主機日期及時間


mkdir
$ mkdir qqq
* 建立資料夾


rmdir
$ rmdir qqq
* 刪除資料夾


touch
$ touch qq.php
* 建立qq.php檔案

rm
$ rm qq.php       #刪除qq.php檔案
$ rm -i qq.php    #會詢問你是否要刪除qq.php檔案
$ rm -fr .*       #(-f為包含隱藏檔) (-r為遞迴) (. 為目前目錄下) (* 為所有檔案)
$ rm -r qq        #刪除qq資料夾並且刪除裡面的所有檔案
* 刪除資料夾/檔案


ifconfig
$ ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10075 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10075 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:818061 (818.0 KB)  TX bytes:818061 (818.0 KB)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.2  P-t-P:127.0.0.2  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:1003984 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1074673 errors:0 dropped:122 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:269505597 (269.5 MB)  TX bytes:274804896 (274.8 MB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:142.4.51.133  P-t-P:142.4.51.133  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

* 查看IP等相關資訊


pwd
$ pwd
/var/www/test
* 顯示目前所在目錄


mv
$ mv qq.php test/qq2.php
* 剪下,也可以重新命名
* 將 qq.php 搬移到目前目錄的 test 資料夾下,並且命名為 qq2.php


cp
$ cp fb.php test/qq.php      #將 fb.php 複製到 test 資料夾下,並重新命名為 qq.php
$ cp -r assets test/assets   #將 assets 資料夾裡的所有資料複製到 test/assets 裡
* 複製,用法同 mv


wget
$ wget http://pic.pimg.tw/ycc328/1331079583-1491181324.jpg
--2013-04-20 18:29:18--  http://pic.pimg.tw/ycc328/1331079583-1491181324.jpg
Resolving pic.pimg.tw (pic.pimg.tw)... 23.0.165.33, 23.0.165.42, 23.0.165.40
Connecting to pic.pimg.tw (pic.pimg.tw)|23.0.165.33|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15551 (15K) [image/jpeg]
Saving to: `1331079583-1491181324.jpg'

100%[===========================================================>] 15,551      --.-K/s   in 0.06s

2013-04-20 18:29:19 (263 KB/s) - `1331079583-1491181324.jpg' saved [15551/15551]
* 下載。
* wget 後面接要下載的網址


clear
$ clear
* 清除終端機上的畫面


cat
$ cat -n phpinfo.php
     1  $
* 顯示檔案內容及行數


echo
$ echo "Hello World!" >> qq.php
* 增加資料到 qq.php ,如果檔案不存在就會自動建立 * 如果檔案已存在,會新增至 qq.php 最後一行


ls
#顯示目錄下的檔案權限, 擁有者..等等
ls -l

#檔案大小那邊會換算成我們習慣的方式(G, M, K)
ls -lh       
drwxr-xr-x 15 webadmin root 4.0K Mar 19 21:09 application
drwxr-xr-x  6 webadmin root 4.0K Apr  7 21:25 assets


#顯示目錄下的檔案(包含隱藏檔)
ls -a

ls | more    # 分頁 q : 離開
ls | less    # 分頁 (操作如同vim,但不需要加ctrl)
             # d : 下12筆,
             # b、w : 上一頁,
             # f : 下一頁,
             # j 、e : 下一筆,
             # g : 回到第一筆,
             # k : 上一筆,
             # h : help

#顯示檔案的inode id
$ ls -ia
1451762 .           1443270 .mysql_history  1576628 assets
1451760 ..          1443190 .php_history    1443160 djfl
1577046 .cache      1443425 .ssh            1443313 index.php
1443151 .git        1576655 .vim            1443315 license.txt
1443307 .gitconfig  1442269 .viminfo        1576661 system
1443272 .gitignore  1443276 .vimrc          1577048 test
1443312 .htaccess   1576553 application     1576831 user_guide

* 顯示所在目錄的內容


chown
情況1:
drwxr-xr-x 4 root     root 4096 Apr 20 18:46 test1        #原本擁有者及群組都是root
$ chown webadmin:webadmin test1                           #將擁有者及群組都改為webadmin
drwxr-xr-x 4 webadmin webadmin 4096 Apr 20 18:46 test1    #結果擁有者及群組都是webadmin

情況2(省略群組->只會改擁有者):
drwxr-xr-x 4 webadmin root 4096 Apr 20 18:46 test1          #原本擁有者為webadmin,群組為root
$ chown root test1                                          #只輸入root(省略群組)
drwxr-xr-x 4 root     root 4096 Apr 20 18:46 test1          #結果只會修改擁有者,群組不變
* 改變檔案/資料夾的擁有者,以下為語法:
* chown 擁有者:群組 [檔案/資料夾]


chgrp
drwxr-xr-x 4 webadmin webadmin 4096 Apr 20 18:46 test1      #原本群組為webadmin
$ chgrp root test1                                          #將群組改為root
drwxr-xr-x 4 webadmin root 4096 Apr 20 18:46 test1          #結果群組改為root了
* 改變群組


chmod
#測試1
drwxr-xr-x 4 webadmin root 4096 Apr 20 18:46 test1          #原本權限為755
$ chmod 777 test1                                           #將權限改為777
drwxrwxrwx 4 webadmin root 4096 Apr 20 18:46 test1          #結果權限被改為777了

#測試2
-rw-r--r-- 1 webadmin root   20 Apr 21 11:18 test.php       #原本
$ chmod +x test.php                                         #全部都加上執行權限
-rwxr-xr-x 1 webadmin root   20 Apr 21 11:18 test.php       #結果

#測試3
-rw-rw-rw- 1 webadmin root   20 Apr 21 11:18 test.php       #原本
$ chmod u+x test.php                                        #只有擁有者加上執行權限
-rwxrw-rw- 1 webadmin root   20 Apr 21 11:18 test.php       #結果
* 改變讀、寫和執行權限
* 如果對檔案權限還不熟請參考此頁
* chmod +x 補充 :
u 代表 user
g 代表 group
o 代表 others
a 代表 all
註1: 以上寫在 +x 前面
註2: 省略前面不寫只寫 +x 代表全部,也就是等於a+x

du
$ du -s test1    # test1 為資料夾
192     test1
* 檔案佔用大小


df
$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/simfs      5.0G  1.1G  4.0G  22% /
none             64M  8.0K   64M   1% /dev
none             13M  1.1M   12M   8% /run
none            5.0M     0  5.0M   0% /run/lock
none             64M     0   64M   0% /run/shm
* 檔案系統


top
$ top
top - 19:17:18 up 98 days, 53 min,  2 users,  load average: 0.00, 0.00, 0.00
Tasks:  29 total,   1 running,  28 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.0%us,  0.0%sy,  0.0%ni,100.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    131072k total,    95824k used,    35248k free,        0k buffers
Swap:   131072k total,    70300k used,    60772k free,    42824k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      20   0 24132  576  124 S    0  0.4   0:03.63 init
    2 root      20   0     0    0    0 S    0  0.0   0:00.00 kthreadd/2919
    3 root      20   0     0    0    0 S    0  0.0   0:00.00 khelper/2919
  135 messageb  20   0 23896    8    4 S    0  0.0   0:00.02 dbus-daemon
  199 root      20   0 15144    8    4 S    0  0.0   0:00.00 upstart-socket-
  311 root      20   0 19068  296  200 S    0  0.2   0:11.57 cron
  354 syslog    20   0 12708  480  348 S    0  0.4   0:29.11 syslogd
  452 root      20   0 49912  364  240 S    0  0.3   0:10.29 sshd
  486 root      20   0 78620    4    0 S    0  0.0   0:00.00 saslauthd
  487 root      20   0 78620    4    0 S    0  0.0   0:00.00 saslauthd
  652 root      20   0 14924    8    4 S    0  0.0   0:00.00 xinetd
  705 root      20   0 89040  676  444 S    0  0.5   2:47.09 sendmail-mta
 5741 www-data  20   0  293m  10m 3928 S    0  8.1   0:00.40 apache2
 8776 root      20   0 17188    8    4 S    0  0.0   0:00.00 upstart-udev-br
 8778 root      20   0 21528    8    4 S    0  0.0   0:00.00 udevd
 9002 bind      20   0  988m 4280 1804 S    0  3.3   0:02.09 named
10087 www-data  20   0  291m 9424 4156 S    0  7.2   0:00.12 apache2
11062 www-data  20   0  292m 9436 3816 S    0  7.2   0:00.17 apache2
13348 mysql     20   0 1206m 9100 2396 S    0  6.9  24:26.62 mysqld
13486 www-data  20   0  290m 6936 3380 S    0  5.3   0:00.12 apache2
15767 root      20   0 23308  156  108 S    0  0.1   0:00.29 vsftpd
27373 www-data  20   0  292m 8660 3360 S    0  6.6   0:00.06 apache2
27499 root      20   0  289m  320  208 S    0  0.2   0:53.43 apache2
31845 root      20   0 73316 3492 2688 S    0  2.7   0:00.01 sshd
31857 webadmin  20   0 73316 1980 1152 S    0  1.5   0:00.25 sshd
31858 webadmin  20   0  4356  728  612 S    0  0.6   0:00.03 sh
32132 root      20   0 73316 3580 2772 S    0  2.7   0:00.08 sshd
32144 root      20   0 18096 2064 1500 S    0  1.6   0:00.04 bash
32291 webadmin  20   0 17164 1312 1052 R    0  1.0   0:00.00 top
* 工作監控
* q 或 ctrl + c 離開


who
#查線上使用者(也就是目前有誰登入進來)
$ who
webadmin pts/0        Apr 20 17:51 (61.58.172.120)
root     pts/1        Apr 20 18:46 (61.58.172.120)

#與who用途相同
$ w
 18:46:50 up 103 days, 22 min,  1 user,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
webadmin pts/0    180-176-112-131. 18:40    0.00s  0.00s  0.00s w



uptime
$ uptime
 19:20:02 up 98 days, 55 min,  2 users,  load average: 0.00, 0.00, 0.00
* 顯示負載


fsck
$ fsck
fsck from util-linux 2.20.1
* 顯示檔案系統


export
$ export
export HOME='/var/www'
export LOGNAME='webadmin'
export MAIL='/var/mail/webadmin'
export OLDPWD='/var/www'
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games'
export PWD='/var/www/test'
export SHELL='/bin/sh'
export SSH_CLIENT='61.58.172.120 2392 22'
export SSH_CONNECTION='61.58.172.120 2392 142.4.51.133 22'
export SSH_TTY='/dev/pts/0'
export TERM='xterm'
export USER='webadmin'
* 查看config設定


grep
#尋找目前資料夾下含有字串"qq"的檔案
$ grep "qq" ./*
./test.php:echo 'qq';

#查詢目前資料夾下包括子資料夾下的含有"memcache"字串的檔案
$ grep "memcache" -r ./*

# 找 "function" 字串那一行且含有 "Submit"
$ grep -r "function" | grep "Submit"

# 找 "function" 字串那一行但不含有 "Submit"
$ grep -r "function" | grep -v "Submit"
* 搜尋字串


&&
$ cd test&&ls                 #執行cd test然候再執行ls
phpinfo.php  test.php
* 中斷


背景執行
#放入背景
ctrl + z

#看背景有哪些程式在執行
$ jobs
[1] + Stopped                    vim test

#叫出第一個背景的程式
$ fg %1

#停止在背景執行的第一個程式
$ kill -9 %1
$ jobs
[1] + Killed                     vim test




stash
#放進暫存
git stash

#查看暫存
git stash list

#取出暫存 
git stash pop

#如果暫存有多個,可以指定要還原哪個commit ID 
git stash [commit ID]



dd
#產生10mb的檔案
#count是幾次 ; bs是大小
dd if=/dev/zero of=/mnt/xfs/test1/aaa count=10 bs=1024k



帳號相關指令
#增加使用者
#使用者建立後預設目錄為/home/jex_lin,但目錄不會自動產生,可以在建立完使用者後建立/home/jex_lin目錄
useradd jex_lin

#修改密碼
#使用者初次建立後要使用它來設定密碼
passwd jex_lin

#刪除使用者
userdel

#使用者相關設定
usermod

#查詢使用者相關資訊
id



磁碟狀態相關指令
#只列出sd磁碟
ls /dev/sd*

#列出所有磁碟(hd及sd)
ls /dev/[sh]d* 

#找出你系統中的根目錄所在磁碟,並顯示相關資訊
df /

#全部檔案系統和各分割區的磁碟用情形
df -a

#查看檔案系統
df -T

#目前硬碟使用的情形
df -h

#查閱目前系統所有的partition有哪些
fdisk -l

#確認一下它是否可以分割
fdisk -l /dev/sda1

#輸入h可以查閱可使用的指令
fdisk /dev/sda1



awk
$ df -h | grep /dev/sda1 | awk '{print $0"=>"$1" "$2" "$3}'
/dev/sda1       226G  2.1G  212G   1% /=>/dev/sda1 226G 2.1G
* 處理欄位
* $0為全部,$1為第一個欄位,依此類推




以下未測:
vi /etc/fstab add-> /dev/sdbb1 /media(要掛的目錄) auto 0 2 (未測) 開機自動mount
unmount /media (未測) 卸載
mkfs -t ext4 /dev/sdb1 (未測)格式化mkfs
fsck /dev/sdb1 (未測) 檢查檔案系統
shutdown (-h) -r + 10 (未測)關機
halt (未測)關機
init 6 (未測)重開機



-------
參考資料 :
http://www.lslnet.com/linux/f/docs1/i22/big5203819.htm
http://blog.longwin.com.tw/2005/11/screen_teach/

2013年1月9日 星期三

[javascript][正則] textarea還原空白及換行


str = '將 textarea 的值放到這個變數';

 //當遇到兩個空白轉換成兩個&nbsp;  註 : 這麼做是為了有其他考量 , 如果只是純文字資料沒有其他標籤符號 , 那轉換一個空白就可以了 .

str2 = str.replace(/  /g, "&nbsp;&nbsp;");

 //textarea換行轉成<br>
str2 = str2.replace(/\n/g,"<br>");

//顯示結果
alert(str2);