套件重新安裝
apt-get install --reinstall [套件]或是 :
dpkg -L [套件]
less /var/lib/dpkg/info/[套件].list
套件完整移除
apt-get remove --purge [套件] [套件] [套件] ...可以查你裝過哪些套件
ls /var/lib/dpkg/info/***
套件鎖定版本
- echo "gaim hold" | dpkg --set-selections # 將 gaim 鎖定版本
dpkg --get-selections "gaim" # 檢查: 出現 gaim hold # 狀態是 hold, 就不能被升級了. - vim /etc/apt/preferences # 內容如下, 把版本編號寫死.
- Package: gaim
- Pin: version 0.58*
套件解除鎖定
- echo "gaim install" | dpkg --set-selections
- dpkg --get-selections "gaim" # 檢查: 出現 gaim install # 狀態被重置為 install, 就可以繼續升級了
狀態檔案位置
- hold / install 這些狀態標誌都寫在 /var/lib/dpkg/status 裡, 也可以手動去修改變 hold / install 等狀態.
其它相關
- apt-get clean #/var/cache/apt/archives 會清掉 *.deb 檔
- apt-get update # 會更新 /var/lib/apt/lists 的資料
用命令播放影片音樂
讓系統自己尋找可能的 codec
gst-launch playbin2 uri=file:///[檔案]
指定codec
gst-launch filesrc location=[檔案] typefind=true ! aiurdemux name=demux demux. ! queue max-size-time=0 ! vpudec ! mfw_v4lsink demux. ! queue max-size-buffers=0 max-size-time=0 ! beepdec ! audioconvert ! 'audio/x-raw-int, channels=2' ! alsasink
畫面only, no sound
no vpu involved
gst-launch filesrc location=/home/linaro/1.mp4 typefind=true ! aiurdemux name=demux demux. ! queue max-size-time=0 ! ffdec_h264 ! mfw_v4lsink demux. ! queue max-size-buffers=0 max-size-time=0 ! beepdec ! audioconvert ! 'audio/x-raw-int, channels=2' ! alsasink
確認gstreamer裝了哪些plugin
gst-inspect
用命令叫totem播放影片音樂
export DISPLAY=:0
讓系統自己尋找可能的 codec
gst-launch playbin2 uri=file:///[檔案]
指定codec
gst-launch filesrc location=[檔案] typefind=true ! aiurdemux name=demux demux. ! queue max-size-time=0 ! vpudec ! mfw_v4lsink demux. ! queue max-size-buffers=0 max-size-time=0 ! beepdec ! audioconvert ! 'audio/x-raw-int, channels=2' ! alsasink
畫面only, no sound
gst-launch filesrc location=/home/linaro/1.mp4 typefind=true ! aiurdemux ! queue max-size-time=0 ! vpudec ! mfw_v4lsink
no vpu involved
gst-launch filesrc location=/home/linaro/1.mp4 typefind=true ! aiurdemux name=demux demux. ! queue max-size-time=0 ! ffdec_h264 ! mfw_v4lsink demux. ! queue max-size-buffers=0 max-size-time=0 ! beepdec ! audioconvert ! 'audio/x-raw-int, channels=2' ! alsasink
確認gstreamer裝了哪些plugin
gst-inspect
用命令叫totem播放影片音樂
export DISPLAY=:0
totem [檔案]
用命令放長音
speaker-test -t sine -f 1000 # 用sine波形 放1k的音
speaker-test -t sine -f 1000 # 用sine波形 放1k的音
使用 Totem 播放影片
1. sudo apt-get install totem-xine w32codecs
2. vim ~/.gnome2/Totem/xine_config
3. 找出 [decoder.external.real_codecs_path] [decoder.external.win32_codecs_path], 改成 [/usr/lib/w32]
shell裡的for in loop
for N in {0..10}
do grep -r [keyword] temp$N/
done
會在temp0 , temp1 , temp2 , ... temp10的資料夾裡grep [keyword]
{0..10}
可以換成0 1 2 3 4 5 6 7 8 9 10
也可以用*
for N in temp*/ ; do grep -r [keyword] $n/ ; done
會在temp*裡面找
SpeechSynthesis
shell裡的if ... else ...寫法
http://rickyju.pixnet.net/blog/post/33210112-shell-script-%3A-if-%E6%A2%9D%E4%BB%B6%E5%BC%8Fshell重覆送出adb shell reboot
for i in `seq 0 0.5 1000`;do adb shell reboot; sleep 50; done
SpeechSynthesis
ubuntu開關機時有個沒啥用的service speech-dispatcher佔時間
很多人在網路上問這是做啥的, 是個speech synthesis套件 語音合成用
沒機會用....關了他吧
sudo update-rc.d -f speech-dispatcher remove
看看你用啥driver顯示
lshs -c video
找到driver=
Shell 指令小撇步
一次要送好幾個連續指令時可以用 分號(;)或 &&
這兩種方法效果不同:
http://www.linuxquestions.org/questions/programming-9/bash-shell-and-and-and-%3B-699111/
設定 setuid bit
看看你用啥driver顯示
lshs -c video
找到driver=
Shell 指令小撇步
一次要送好幾個連續指令時可以用 分號(;)或 &&
這兩種方法效果不同:
No, they are not quite the same. With &&, the second command will only run if the first command finishes successfully, that is if it sends an exit code of 0. But with the semicolon, the second command will start right after the first one finishes, no matter whether it succeeds or not.
There's also ||, the "or" operator, where the second command will only run if the first one fails in some way (exit code is not 0; the command exited with an error).
There's also ||, the "or" operator, where the second command will only run if the first one fails in some way (exit code is not 0; the command exited with an error).
http://www.linuxquestions.org/questions/programming-9/bash-shell-and-and-and-%3B-699111/
設定 setuid bit
$ sudo su
sudo: must be setuid root
build code的時候有時會碰到
解法
# chwon root:root /usr/bin/sudo
# chmod 4755 /usr/bin/sudo
# reboot
新增一個檔案, 大小隨你決定
(ref. http://stackoverflow.com/questions/139261/how-to-create-a-file-with-a-given-size-in-linux )
最簡單的指令名字: dd
dd if=/dev/zero of=upload_test bs=file_size count=1
但dd有 4GB值上限,且作大檔時速度慢
延展/截斷檔案的工具: truncate
truncate -s 10G foo
Terminal中用組合鍵捲動畫面
[Shift]+[PgUp]/[PgDn] 上下頁
如果是GUI裡虛擬的terminal, 還有一個捲動方式
[Ctrl]+[Shift]+[↑][↓] 上下行
日期表示法
$(date +%N)
gsettings set org.gnome.desktop.media-handling automount false
日期表示法
$(date +%N)
gsettings set org.gnome.desktop.media-handling automount false
沒有留言:
張貼留言