Quantcast
Channel: Vincent's Memo » shell
Browsing latest articles
Browse All 10 View Live

Extract file from password-protected rar file.

Extracting file from files is very easy. unrar x files.rar # using x will also extract directories. unrar e files.rar # only extract files. Sometimes when this file is password protected. I will have...

View Article


h264 encoded by mencoder

Using mencoder to create h264 video. I use h264 encoded video to stream my movies in my home. Here is how I do it. mencoder "$input" -o "$output" -of lavf -lavfopts format=mp4 -mc 0 \ -vf...

View Article


‘for’ in shell part 2.

In this post, we can loop some specific file types or other list seperated with space. What if we want to do for loop from 1 to 10 ? Here is the example. #!/bin/bash for ((i = 0;i < 10; i++)) do...

View Article

Using mplayer to capture video screenshot

Three ways to capture video screenshot by using mplayer. 1. mplayer -vf screenshot test.avi then press ‘s’ to capture 1 snapshot. 2. Actually, it is the same as 1, but the difference is this one will...

View Article

怎麼看實體ram的分佈 ?

在 linux 要怎麼看實體 ram 的分佈以及大小呢 ? 使用以下指令: lshw sudo lshw | grep "bank" -A 10 結果輸出如下: *-bank:0 description: DIMM 1066 MHz (0.9 ns) product: None vendor: None physical id: 0 serial: None slot: A0 size: 1GiB...

View Article


Image may be NSFW.
Clik here to view.

Crop image by using ImageMagick

怎麼使用 imagemagick 來 crop image。 convert -crop ${width}x${height}+${posX}+${posY} original output # ${width} - image 的寬度 # ${height} - image 的高度 # 兩個結合起來就是只要 crop 多大的區域。 # ${posX} 和 ${posY} 就是要從 image...

View Article

Remote capture webpage to image.

如何透過遠端抓取網頁並且轉成image檔呢? Google了許久,大多都必須搭配 X server 才有辦法使用。 不過即使是需要 X server 也可以用個虛擬的方法來使用。 下面列出幾個我找到可以用的軟體 1. wkhtmltoimage 2. cutycapt 3. khtml2png 4. Pywebshot 5. python-webkit2png...

View Article

Image may be NSFW.
Clik here to view.

how to use array in shell ?

怎麼在 shell 裡面用 array ? 最簡單的用法如下: #!/bin/bash array=("a" "b" "c") # shell array 必須用 space 分隔 echo ${array[0]} echo ${array[1]} echo ${array[2]} echo ${#array[@]} echo ${array[@]} # 以下就是輸出 a b c 3 a b c...

View Article


Shell 的一些基本用法_1

以下列出一些 bash shell 的基本用法,至少目前我都有用到了。 $# – 變數有幾個 $? – exit status $@ – 所有變數 $* – 所有變數 以下用一些範例來說明: # test.sh #!/bin/bash echo $# echo $@ echo $* >./test.sh 1 2 3 4 4 # 四個變數 1 2 3 4 # 列出所有變數 1 2 3 4 #...

View Article


SoftAP in linux debian

為什麼要這麼麻煩而不使用 adhoc wireless 來 share 網路呢 ? 原因是因為我的 xoom 使用 ics 後,已經不支援 adhoc mode 了,所以只好想辦法達成我想要的目的。 下面就是解決方法: 確定無線網卡是否支援。 lspci -k | grep -A 3 -i "network" 03:00.0 Ethernet controller: Atheros...

View Article
Browsing latest articles
Browse All 10 View Live