TAG

首都機能移轉 (2) 歌詞 (2) 靠北文 (40) 戲言 (30) 糟糕 (7) ACG (23) Assembly (2) Boost (2) C (31) C++ (69) CMake (4) CSIE (67) Debian (34) Design_Pattern (2) Django (1) Eclipse (1) en_US (13) FFmpeg (3) FoolproofProject (26) FreeBSD (2) Git (4) GNU_Linux (65) IDE (5) Java (11) JavaScript (19) KDE (15) Khopper (16) KomiX (3) Kubuntu (18) Life (1) Lighttpd (2) Mac_OS_X (2) Opera (1) PHP (2) PicKing (2) Programing (21) Prolog (1) Python (7) QSnapshot (2) Qt (30) Qt_Jambi (1) Regular_Expression (1) Shell_Script (7) Talk (98) VirtualBox (7) Visual_Studio (13) Windows (18) zh_TW (36)
顯示具有 Debian 標籤的文章。 顯示所有文章
顯示具有 Debian 標籤的文章。 顯示所有文章

2012年5月14日 星期一

QSnapshot 0.1.1 released

其實我一直覺得這頁面很醜 ... 不過我真的不知道怎麼改.
本次修正包含了數項 bug 及 UI 改善.
Debian 有套件包可用, Ubuntu 提供 PPA.

2012年3月9日 星期五

QSnapshot

買了 Mac,卻發現 Mac 上的抓圖程式沒辦法抓視窗的子元件,於是我偷了 KSnapshot 的程式碼,偷了 Apple 上的範例程式,做出這個適用於 Mac OS,Windows 與 Linux 的抓圖程式。

2011年7月24日 星期日

Reuse existing KSnapshot on press PrintScreen

在 Debian 或 Kubuntu 的預設設定, 按下 PrintScreen 鍵會啟動 KSnapshot, 若再按下一次 PrintScreen, 則會再喚起一個 KSnapshot. 但這不是我想要的行為, 當我按下 PrintScreen 時就代表我想抓圖了, 不停地開啟新的 KSnapshot 有點蠢. 幸好 KSnapshot 有提供足夠的 D-Bus 介面, 這讓我們可以寫一個 script 操作已存在的 KSnapshot.

2011年6月23日 星期四

Configure Django with Lighttpd on Debian/Ubuntu

網路上找到的資料都有點不完全, 最近在逃避現實的過程中找到了一個比較簡單的方式, 供有需要的人參考.

2011年1月9日 星期日

Embed external viewers into Firefox

# aptitude install mozplugger
Then Firefox will open your default external viewers with tabs, instead of external windows.

2010年10月6日 星期三

Fix the jar file association for shared-mime-info

Java 的 jar 檔案關聯在 Debian 和 Kubuntu 上一直都被視為 application/zip,基本上這不是 KDE 的問題,而是 shared-mime-info 裡面的 /usr/share/mime/packages/freedesktop.org.xml 的判定條件錯誤,它沒有判斷 jar 檔的 PKZIP 表頭。打開這個檔案,找到 <mime-type type="application/x-java-archive"> 的區段,加入:
<magic priority="85">
  <match value="PK\003\004" type="string" offset="0" />
</magic>
再刷新 MIME 資料庫:
# update-mime-database /usr/shared/mime
jar 檔就會被正確判定了。

2009年12月25日 星期五

Suspend USB devices (turn the power off)

昨天朋友問我把 USB 裝置停電的實際命令,Google 了一下找到了方法,筆記一下。
首先要知道你的 USB 裝置代號,可以在插入後使用 dmesg 查看[?]。例:
[ 8944.330557] usb 1-8: USB disconnect, address 8
[ 9023.580525] usb 1-8: new high speed USB device using ehci_hcd and address 9
[ 9023.714733] usb 1-8: New USB device found, idVendor=0b27, idProduct=0163
[ 9023.714737] usb 1-8: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 9023.714739] usb 1-8: Product: USB Mass Storage Device
[ 9023.714741] usb 1-8: Manufacturer: USBest Technology
[ 9023.714743] usb 1-8: SerialNumber: 000000000016F3
[ 9023.714828] usb 1-8: configuration #1 chosen from 1 choice
[ 9023.715549] scsi7 : SCSI emulation for USB Mass Storage devices
[ 9023.715694] usb-storage: device found at 9
[ 9023.715696] usb-storage: waiting for device to settle before scanning
[ 9028.712208] usb-storage: device scan complete
[ 9028.713173] scsi 7:0:0:0: Direct-Access     Ut163    USB2FlashStorage 0.00 PQ: 0 ANSI: 2
[ 9028.717275] sd 7:0:0:0: [sdd] 1974271 512-byte logical blocks: (1.01 GB/963 MiB)
[ 9028.718294] sd 7:0:0:0: [sdd] Write Protect is off
[ 9028.718299] sd 7:0:0:0: [sdd] Mode Sense: 00 00 00 00
[ 9028.718301] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[ 9028.725637] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[ 9028.725645]  sdd: sdd1
[ 9028.837666] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[ 9028.837672] sd 7:0:0:0: [sdd] Attached SCSI removable disk
[ 9149.868714] Shorewall:net2fw:DROP:IN=eth0 OUT= MAC=00:1f:d0:37:37:0a:00:30:88:12:54:d6:08:00 SRC=189.1.169.123 DST=123.205.248.119 LEN=40 TOS=0x00 PREC=0x00 TTL=92 ID=256 PROTO=TCP SPT=6000 DPT=1433 WINDOW=16384 RES=0x00 SYN URGP=0
[ 9231.369074] sd 7:0:0:0: [sdd] 1974271 512-byte logical blocks: (1.01 GB/963 MiB)
[ 9231.369566] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[ 9231.370687] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[ 9231.370690]  sdd: sdd1
因為它寫 usb 1-8,所以要控制的 USB 接口代號就是 1-8,很簡單吧?反正找有 usb 字樣的就對了。底下的 sd 是表示它被分配到哪個磁區代號,因為這支是隨身碟才會是這樣,其他類型的裝置會有不同的訊息,不過這不是重點,所以沒差啦。
然後請到 /sys/bus/usb/devices 裡找剛剛的接口代號的資料夾,在那裡面找 power/level,該檔是一個文字檔,或者說看起來是文字檔,內容應該是 on。只要把 on 改成 suspend 就可以把電源切斷。注意不是 off,如果輸入錯誤的字串它會無法存檔,不用擔心會改錯。
以本例來說是 1-8 所以是:
# echo suspend > /sys/bus/usb/devices/1-8/power/level
電源燈就會熄了。
噢,當然你要有相當於 root 的權限。

2009年12月18日 星期五

Ubuntu 又被婊了

這陣子為了 CMake 嘗試轉用 KDevelop 做為開發平台,不過在其首頁上看到一個聳動的標題:Don’t install Ubuntu 9.10 if you want a stable KDevelop - apaku。究竟 Ubuntu 哪裡惹到 KDevelop 了呢?
原來是 Ubuntu 把 KDevelop 4 beta 5 放進 Karmic 的官方套件庫裡,導致 KDevelop 的 upstream 被一堆重複回報的 bug 淹沒,而且其中還有己在 beta 6 修正的 bug。
其實作者要抱怨的不是這堆實際上沒什麼用的 bug report,而是 Ubuntu 把尚未正式釋出的軟體放到正式釋出的套件庫裡。然後自動回報又設定成回報給 KDevelop upstream,而不是 Ubuntu 的 package maintainer,因此 upstream 才會一直收到重複的 bug report。
有人反駁目前穩定的 KDevelop 3 使用的是 KDE3,而現在己不再被 upstream 支援,因此對 Ubuntu 來說別無選擇。但是有趣的是 KOffice 在 Karmic 裡就有分成 koffice (for KDE3, stable) 和 koffice-kde4 (for KDE4, unstable)。
由於作者釋出 beta 的目的是為了測試,但是 Ubuntu 的釋出並不是為了讓使用者測試並回報 bug,並且由於 Ubuntu 本身定位成給新手使用的發行版,他們遇到 bug 大多不會自己解決,也不會看 bug 有沒有被回報過,或是自行從 upstream 下載己修正的最新版原碼回來使用。
作者本人的建議是,尚未正式釋出的軟體不是不能放,而是應該放到另外的套件庫,不要預設就能裝這些不穩定的軟體。他用過的其他發行版都不會有這些問題(Arch, Gentoo, Debian)。
以我正在重度使用的 Debian 來說,它雖龜毛,但是也有龜毛的好處。它的 stable 依然停留在 KDE3,避開了 KDE4 目前尚未被證明的穩定度;而 testing 和 unstable 則是用無接縫升級,因為它們一開始就明講這些軟體尚未經過足夠測試,其使用者多少會有點心理準備;它甚至還提供 experimental 來放那些連 unstable 的條件都無法滿足的軟體。Ubuntu 經常為了新軟體而犧牲其穩定度。

2009年11月3日 星期二

Khopper v0.2.2 released

Changes:
  • 修正 flac 的解碼問題
  • 新增 mp3 cbr 192 bps 的選項
  • 修正部分環境的編譯問題
看起來很少,可是花了我不少時間在 trace 別人的 code ....

2009年10月7日 星期三

Mount any VBox-compatible disk image on the host

If you encountered this message while building:
.: 32: Can't open /etc/vbox/vbox.cfg
You should add this line
INSTALL_DIR=/usr/lib/virtualbox
to the building script.
If you encountered fuse mount option error while executing, you should patch the source code:
- fuse_opt_add_arg (&fuseArgs, "");
+ fuse_opt_add_arg (&fuseArgs, "vdi");
and rebuild it.
You can simply unmount it using umount command.

2009年10月4日 星期日

Fix the bitmap render of wqy-zenhei

如果你的文泉驛正黑在升級之後某個 range[?] 的字型變成點陣字,可以用如下方法修正:
# rm /etc/fonts/conf.d/66-wqy-zenhei-sharp.conf
放心,它是個 symbolic link,日後有需要再從 /etc/fonts/conf.avail/66-wqy-zenhei-sharp.conf link 回來就好。
原因?我也不知道,因為 66-wqy-zenhei-sharp.conf 設定的是 12~16 的範圍,不知道為什麼會影響到 8~11 ... 可能是 fontconfig 的 bug 吧。

2009年9月11日 星期五

Packages in Opera's FTP repository

There is a deb repository that provides apt service. But packages in that one are still depends on Qt3. Packages which are built with Qt4 are only avaliable in FTP repository. Weird Opera.

2009年8月27日 星期四

Enable frame buffer in grub2

With legacy grub, if you want to enable frame buffer built in kernel, the option "vga=xxx" is needed in boot command.
However, grub2 provides a newer way to enable the feature. You should set gfxpayload=1280x1024x32, and insmod vbe manually if needed. So where to add? I write it to /etc/grub.d/40_custom, as it is an user custom hook script.
cat <<EOF
insmod vbe
set gfxpayload=1280x1024x32
EOF
You can use vbeinfo in grub2 shell to look up which modes are available.
By the way, DO NOT FORGET to run:
# update-grub
to make newer grub.cfg generated.

2009年8月13日 星期四

Resolve the BADSIG problem when updating apt list

I recently encounter an update problem during updating sources list:
W: GPG error: SOURCE Release: The following signatures were invalid: BADSIG KEY SENDER
I have no idea how this happened, but have fixed this. First I tried this:
# apt-get clean
# cd /var/lib/apt
# mv lists lists.old
# mkdir -p lists/partial
# apt-get clean
# apt-get update
Well, but no use. So I tried another way:
# apt-get update -o Acquire::http::No-Cache=True
Then it works.

2009年7月2日 星期四

Do not install or upgrade ia32-apt-get

ia32-apt-get just breaks your apt repository, it will screw up your package list. So don't upgrade ia32-libs from 2.7 to newer version until it DO fix this mess.
I don't know how can it upload to unstable ... it is just **HORRIBLE**!

2009年6月20日 星期六

Multiboot using Grub2

最近跟著潮流(?)改成 grub2 做為開機管理程式,但是在我升級之後,它沒抓到存在我電腦裡的另一個作業系統。解決方法很簡單,安裝 os-prober 套件,再重新設定一次 grub2 就好。
# aptitude install os-prober
# dpkg-reconfigure grub-pc
第二步會出現選擇 grub 要安裝的硬碟,選 /boot 掛的那顆就好;這樣它就會自動抓到其他的開機區段了。
os-prober 是 grub-pc 的 Suggest 套件,個人認為應該提上 Recommend 才對的。

2008年12月24日 星期三

KDE 4.2 snapshot packages for Debian

就像這篇所提到的,Debian因為龜毛政策沒辦法在官方套件庫中納入KDE 4.2的Beta套件,於是我們的神--Debian Qt/KDE Maintainers就自己開了一個非官方的套件庫,提供勇者們方便地嚐鮮KDE 4.2,以及bug回報。
這個套件庫事先聲明,期望不要太高,因為它們的品質並沒有符合官方的標準[?],更新週期大約是每週一次,不過這也不保證,反正他們有空就會更新。
用Debian到現在我大概可以理解為什麼有人說Debian對開發者很不客氣....光是看那堆打包者守則就快暈了,想要讓套件進unstable還要測試好一段時間,就連KDE 4.1.0也沒有完全進入unstable,而4.1.3還在experimental,搞不好就會直接被將來的4.2.0蓋掉,進不了unstable。
其實unstable+experimental就己經能夠滿足一般桌上使用的需要了,可想而知Debian對穩定的龜毛程度...