Saturday, June 06, 2009

??Google WebTookit Tool

升級GCC required by /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6

因為升級 gcc 4.1.2 -> 4.3.2
出現
required by /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/libstdc++.so.6

原來是一些設定沒更新
PClatop bin # gcc-config -l
[1] i686-pc-linux-gnu-4.1.2
[2] i686-pc-linux-gnu-4.3.2
#gcc-config 2
#source /etc/profile

#qfile libstdc++.so.6

這樣裝好的 chromium-bin就可以使用了

Thursday, June 04, 2009

xfce 單一視窗透明度transset

之前搞定,xfce 的視窗透明度compiz特別功能之一

但是我們要如何設置單一視窗的透明度呢?
因為想要聽歌的視窗,有跑歌詞,想要讓他透明化

在terminal下輸入,
transset .6
就會出現一個箭頭,點點那個箭頭就可以了。

Tuesday, May 26, 2009

Monday, May 25, 2009

[linux]cgi-bin目錄下其他檔案讀取jpg

[linux]cgi-bin目錄下其他檔案讀取jpg


#Options ExecCGI
#SetHandler cgi-script
AddHandler cgi-script .cgi .pl
Options ExecCGI Indexes

Sunday, May 24, 2009

[java]getRGB()

[java]getRGB()

getRGB()返回默认 sRGB ColorModel 中表示颜色的 RGB 值。(24-31 位表示 alpha,16-23 位表示红色,8-15 位表示绿色,0-7 位表示蓝色)。

要得到具体R,G,B颜色分量得做个位移
// Color color
int rgb = color.getRGB();
int r = (rgb & 16711680) >> 16;
int g = (rgb & 65280) >> 8;
int b = (rgb & 255);

也可以直接使用Color的getRed(),getGreen(),getBlue()方法得到r,g,b.

Thursday, May 21, 2009

automake helloworld

automake helloworld
試著一陣子網路上的文章都不能成功建立
找到一篇英文的資料成功了

參考

http://www.bilmuh.gyte.edu.tr/gokturk/introcpp/gnutools/node62.html

Sunday, May 03, 2009

gentoo ipv6設置

kernel下設定

Device Drivers --->
Networking support --->
Networking options --->
  <*> The IPv6 protocol (EXPERIMENTAL)
 
(IPv6 选项在其它应用程序中使用广泛,但不需要配置)(下面的选项只在你需要通过 ptrtd 进行 6to4 转换时选中)
[*] Network device support
  <*> Universal TUN/TAP device driver support


# emerge sys-apps/iproute2

# ip -6 addr show lo
1: lo: mtu 16436
  inet6 ::1/128 scope host
    valid_lft forever preferred_lft forever
  (以上显示出了当前网络工作情况)


# emerge freenet6
编辑你的 /etc/freenet6/tspc.conf
可以修改/etc/freenode6/tspc.conf,把里面的
server=anon.freenet6.net
改成
server=tb.ipv6.apol.com.tw
這樣就可以用IPV6了不受G*F*W*影響上一些網站

使用ipv6 proxy
如 *.sixxs.org
http://www.proxyboxonline.com/

Wednesday, April 29, 2009

install make libfetion

install make libfetion

源码下载: http://www.libfetion.cn/Linux_demoapp_download.html
解压命令:tar -zxvf linux_fetion-0.*.*.tar.gz
进入源代码目录: cd linux_fetion-0.*.*
(64位用户需执行: ./64_libfetion.sh 脚本)
运行编译命令: qmake-qt4;make
安装程序:./install.sh



Wednesday, April 22, 2009

Enabling a cgi directory for each user

因為要寫perl cgi程式
Enabling a cgi directory for each user
要讓普通使用者的public/cgi-bin/可以執行pl cgi 除了chmod 成 755


只要在apache2.conf or /etc/apache2/httpd.conf中加入一段:
代碼:


Options ExecCGI
SetHandler cgi-script

這樣就可以執行了!!

Thursday, April 16, 2009

xprofile


export LANG="zh_TW.UTF-8"
export LC_ALL="zh_TW.UTF-8"
export LC_CTYPE="zh_TW.UTF-8"
export LC_ALL="zh_TW.UTF-8"
exec /usr/libexec/gnome-settings-daemon &
export GCIN_DUAL_XIM_OFF=
export GCIN_XIM=gcin.UTF-8
export XMODIFIERS=@im=${GCIN_XIM}
exec gcin &

swiftweasel 軟體安裝加入列表的shell

#!/bin/sh
#
# This script installs Swiftfox

# Download Swiftfox
echo " "
echo "Password required to install to /opt directory..."
echo " "
cd /opt
#sudo wget http://getswiftweasel.com/builds/releases/3.0.4pre-1/swiftweasel-3.0.4pre-1-prescott.tar.bz2

# Install Swiftfox
echo " "
echo "Installing HAHA..."

# If there is an existing swiftweasel install here let's move it out of the way
#sudo mv swiftweasel swiftweasel.old

# Extract the build
#sudo tar -jxf swiftweasel-3.0.4pre-1-prescott.tar.bz2

# Search for plugins
echo " "
echo "Searching for existing plugins, errors can be safely ignored..."
sudo cp swiftweasel.old/plugins/* swiftweasel/plugins
sudo cp /usr/lib/firefox/plugins/* swiftweasel/plugins
sudo cp /usr/lib/mozilla/plugins/* swiftweasel/plugins
sudo cp /usr/lib/mozilla-firefox/plugins/* swiftweasel/plugins
sudo cp /usr/lib/browser-plugins/* swiftweasel/plugins
sudo cp /usr/lib/xulrunner-addons/plugins/* swiftweasel/plugins

# Make sure root owns the Swiftfox directory
sudo chown -hR root:root swiftweasel

# Add link in /usr/bin
sudo ln -s /opt/swiftweasel/swiftweasel /usr/bin/swiftweasel

# Add Swiftfox to menu
#cd /usr/share/applications
#sudo wget http://getswiftweasel.com/builds/installer/Swiftfox.desktop

# Remove the downloaded tarball
#sudo rm /opt/swiftweasel-3.0.4pre-1-prescott.tar.bz2

echo " "
echo "Swiftfox has been installed. Happy Surfing!"
echo " "
exit

要加入程式啟動表內
#cd /usr/share/applications
vi swiftweasel.desktop

[Desktop Entry]
Comment=Web Browser
Comment[en_US]=Web Browser
Encoding=UTF-8
Exec=/opt/swiftweasel/swiftweasel
GenericName=Web Browser
GenericName[en_US]=Web Browser
Icon=/opt/swiftweasel/icons/mozicon128.png
Name=Swiftweasel
Name[en_US]=Swiftweasel
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=
Categories=Application;Network;

Wednesday, April 15, 2009

更改swiftweasel個人化名稱與中文化

swiftweasel一樣可以使用firefox 的插件

在使用zh-TW.xpi包中文化後
名字會自己變成Mozilla Firefox

我想把它改回去

vi

~/.sw3/swiftweasel/vzjhjvvg.default/extensions/langpack-zh-TW@f
irefox.mozilla.org/chrome/zh-TW.jar

然後更改
locale/branding/brand.dtd 內的
1 brandShortName "Swiftweasel">
2 brandFullName "Swiftweasel">
3 vendorShortName "Swiftweasel">

Tuesday, April 14, 2009

解決gsynaptics觸控版不能連點

vi /etc/X11/xorg.conf

在xorg.conf加入Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
InputDevice "Synaptics"
EndSection

Section "InputDevice"
Identifier "Synaptics"
Driver "synaptics"
Option "Device" "/dev/input/event5"
Option "Protocol" "auto-dev"
Option "Emulate3Buttons" "yes"
Option "SendCoreEvents" "true"
Option "SHMConfig" "true"
Option "SHMConfig" "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
EndSection

那個event5是
cat /proc/bus/input/device

I: Bus=0011 Vendor=0002 Product=0007 Version=25b1
N: Name="SynPS/2 Synaptics TouchPad"
P: Phys=isa0060/serio4/input0
S: Sysfs=/class/input/input5
U: Uniq=
H: Handlers=mouse0 event5
B: EV=b
B: KEY=6420 0 70000 0 0 0 0 0 0 0 0
B: ABS=11000003

根據實際狀況設定
xorg.conf 是使用
nvidia-xconfig
自動產生的

Monday, April 13, 2009

xorg-server-1.5-upgrade-guide要仔細看

昨天看到新消息,
所以今天有空就更新
xorg-server-1.5

要注意
make.conf
的input _devices加入evdev

不然又會發生鍵盤或者滑鼠不能用的窘境。

感覺比之前的load低多了

swiftfox 換成中文


about:config

general.useragent.locale

改成
zh-TW




http://releases.mozilla.org/pub/mozilla.org/firefox/releases/版本編號/作業系統/xpi/

下載 zh_TW.xpi

重開即可

Sunday, April 12, 2009

gentoo portage news

之前跟新完portage
* IMPORTANT: 1 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
輸入
eselect news read new


2009-04-06-x_server-1_5
Title Migration to X.org Server 1.5
Author Remi Cardona
Author Christian Faulhammer
Posted 2009-04-06
Revision 1

A lot of changes regarding device recognition and use by the X server
have been introduced in the 1.5 update. As that version is going
stable on all architectures, users should read the upgrade guide [0]
before actually updating the package.

[0] http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-1.5-upgrade-guide.xml


Friday, April 10, 2009

foxyproxy北京教育網使用

因為在使用ipcn要兩個小時輸入一次密碼,
而且有些網站也是不能連,
又有在使用gappproxy(Google app engine 寫的proxy)。
但是他受限於 Google app engine本身的限制。
下載1MB檔案,
所以在自動組態令碼,
使用ipcn.org站長提供的有教育網列表類的ip位置跟一些網址,
如果不再列表內的就改成使用gappproxy。

改最後一行
else return "PROXY localhost:8000; DIRECT";

即可。

Thursday, April 09, 2009

bc 除出小數點位數

輸入
scale=數字

數字是要顯示到小數點幾位

Saturday, April 04, 2009

移除wine軟體選單

在 ~/.local/share/applications/ 底下
可以刪除icon

終端機下
uninstaller
可以移除軟體

ie4linux離線安裝

wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux

DCOM98.EXE
http://download.microsoft.com/download/d/1/3/d13cd456-f0cf-4fb2-a17f-20afc79f8a51/DCOM98.EXE

mfc40.cab
http://activex.microsoft.com/controls/vc/mfc40.cab

249973USA8.exe
http://download.microsoft.com/download/win98SE/Update/5072/W98/EN-US/249973USA8.exe

ADVAUTH.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/ADVAUTH.CAB

CRLUPD.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/CRLUPD.CAB

HHUPD.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/HHUPD.CAB

IEDOM.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IEDOM.CAB

IE_EXTRA.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_EXTRA.CAB

IE_S1.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_S1.CAB

IE_S2.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_S2.CAB

IE_S5.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_S5.CAB

IE_S4.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_S4.CAB

IE_S3.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_S3.CAB

IE_S6.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/IE_S6.CAB

SCR56EN.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/EN-US/SCR56EN.CAB

SETUPW95.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/SETUPW95.CAB

FONTCORE.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/FONTCORE.CAB

FONTSUP.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/FONTSUP.CAB

VGX.CAB
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/CN/VGX.CAB
swflash.cab
http://download.macromedia.com/get/shockwave/cabs/flash/swflash.cab
在你的主文件夹中会有个".ies4linux"的隐藏文件夹,打开进入"downloads"目录,新建一个"files"文本文件,如果已经有了就打开它,粘贴进如下内容:
DCOM98.EXE
mfc40.cab
249973USA8.exe
ie6/CN/ADVAUTH.CAB
ie6/CN/CRLUPD.CAB
ie6/CN/HHUPD.CAB
ie6/CN/IEDOM.CAB
ie6/CN/IE_EXTRA.CAB
ie6/CN/IE_S1.CAB
ie6/CN/IE_S2.CAB
ie6/CN/IE_S5.CAB
ie6/CN/IE_S4.CAB
ie6/CN/IE_S3.CAB
ie6/CN/IE_S6.CAB
ie6/CN/SCR56EN.CAB
ie6/CN/SETUPW95.CAB
ie6/CN/FONTCORE.CAB
ie6/CN/FONTSUP.CAB
ie6/CN/VGX.CAB
swflash.cab
按照列表中的位置把上面提到的共20个下载文件部署正确,根目录就是当前的"downloads"目录!

./ies4linux --locale CN --no-gui

Sunday, March 29, 2009

firefox over ssh tunel

有時候就算你用了tunnel
但是DNS沒設定好,
在seamonkey中有直接可以選socks5 dns反解使用 ssh
firefox中
about:config
把 network.proxy.socks_remote_dns 設成 true

嘿嘿,youtube又能上了

Thursday, March 19, 2009

Linux下裝迅雷

裝完wine 裝了訊雷。

cp c:\WINDOWS\system32\下的動態鏈接庫msvcp60.dll和mfc42.dll到
~/.wine/drive_c/windows/system32 下。
然後wine迅雷就可以正常啟動迅雷下載使用了。
要注意的是下載文件的保存路徑要點瀏覽然後再選擇相應的保存路徑,
或者如此類似設置(z:\root \Desktop\)否則會提示錯誤的路徑

Linux下的千千靜聽 audacious加showlyric

在Linux下的好用播放軟體audacious
加上插件showlyric 就可以達到千千靜聽的效果(showlyric 可以至Ubuntu cn查找)

但是好像只支援簡體的id3

所以先用ConverZ把ID3轉成簡體字(BIG5轉GBK) 再用 easyTag
先設定讀入為GBK之後會幫忙轉UTF8這樣linux 下看就不會是亂碼了

xfce4透明度

如何再xfce加入透明度

在 /etc/X11/xorg.conf加入

Section “Extensions”
Option “Composite” “enable”
EndSection

重起X

在setting manger 的視窗軟體調教 就會出現
Composite選單
解決ShowLyric 不能透明問題

Thursday, March 12, 2009

090312java對binary image的處理

這裡寫下,在數字圖像處理方面,java的一些用法
java jai

Monday, March 09, 2009

[vim]程式碼自動排版

加強使用vi,
為了像 eclipse有程式碼自動排版的功能(shift + f)
在vi中
按esc
然後,gg跳回最上一行
shift + v 反白選取一行
shift + gg 反白全部
= 排版完成!

回來了

很久前註冊的flashc blogger,
但是一直沒再使用,
一開始google都還沒整合呢!
現在登入整合了,
到了北京,所以這個blog一樣是定位成寫技術文章。
重新出發!

算是我在北大生活的另外一個注記。