baysao’s blog

Convert Lingvo dict to Stardict dict format

Posted in Debian by baysao on 24 Tháng Ba, 2007

links to article

Get dicts :
LingvoCompactER.tar.gz
LingvoCompactRE.tar.gz
LingvoComputerER.tar.gz
LingvoComputerRE.tar.gz
LingvoEconomicER.tar.gz
LingvoEconomicRE.tar.gz
LingvoGrammaticalER.tar.gz
LingvoScienceER.tar.gz
LingvoScienceRE.tar.gz
LingvoUniversalER.tar.gz
LingvoUniversalRE.tar.gz

Printing in linux

Posted in Debian by baysao on 18 Tháng Ba, 2007

The easy way is using CUPS. We can control it via http://localhost:631.

1. With plain text file, you can print directly without pain by using lpr.

2. The common way to printing other document (images, webpages, pdf, ps, …) is convert it to postscript files and printing its.

+ Utilities a2ps can convert all other format to ps.

+ In particular, to work withs image you can see here. With pdf document, xpdf-utils, pdftk, pdfjam, … is usefuls.

+ Almost web browers support printing webpages directly on its.

3. Sometimes, you want to print with duplex pages (two side pages) but printer driver not support.

+ You can using psselect in psutils to make odd pages and even pages separate from origin ps document, and print its.

psselect -e origin.ps even.ps # make odd pages
psselect -r -o origin.ps odd.ps # make even pages in reverse order.

+ Other more easy way is using utilities mpage.

mpage -j 1%2 origin.ps # for print odd pages

mpage -r -j 2%2 origin.ps # for print even pages in reverse order.

4. Make virtual pdf printer. Using cups-pdf. This is a common method to convert other document format to pdf.

Transparent SOCKS proxy client

Posted in Debian by baysao on 18 Tháng Ba, 2007

It’s the way to help the program not support SOCKS implement.

1. Tsocks:

My simple config with /etc/tsocks.conf:

local = [local_address]
server = [sock_server]
server_type = [type]
server_port = [port]

Where is [local_address] is ip address will not using via SOCKS, [socks_server] and [port] is address and port SOCKS server, [type] is 4 or 5 for type of SOCKS server.

2. Dante:

In dante-client side, i edit /etc/dante.conf (in Debian base system) or /etc/socks.conf (in default). I.e, here is my config:

resolveprotocol: fake
route {
from: 0.0.0.0/0 to: 0.0.0.0/0 via: [sock_server] port = [port]
proxyprotocol: socks_v5
}

For detail, man socks.conf

3. Runsocks:

In my opinion, runsocks support SOCKS better than tsocks and dante. In some program as gyachi, squid not work with tsocks, dante-client, but runsocks works fine.

My config in /etc/libsocks5.conf:

noproxy – 172. – – –
socks5 – – – – [socks_server]:[port]

For detail, man runsocks.

Some Squid notes

Posted in Debian by baysao on 18 Tháng Ba, 2007

Squid Web Proxy Cache use as HTTP proxy server for internet sharing. There is some way, you want to setup own HTTP proxy server through other Proxy server as other HTTP or SOCKS proxy. There is some tips can help you do that :

1. Through other HTTP proxy server :

You can config on parameter cache_peer. I.e, I add this line in my squid.conf :

“cache_peer a.b.c.d parent 3128 0 no-query”

where is a.b.c.d is other HTTP proxy server, 3128 is port to connect through.

If other HTTP proxy server require authenticate, no-query -> login=user:pass. I.e,

cache_peer a.b.c.d parent 3128 0 login=xxx:xxx

2. Through other SOCKS proxy server :

I try using some sockify client to woking with Squid (2.6) as tsocks, dante but no success. Some one suggest using runsocks (Socks5), it works fine.

+ Install and config runsocks.

+ Run runsocks + squid. I run it through /etc/init.d/squid :

runsocks /etc/init.d/squid start

Hope it’s works.

Some GTK stuffs relate notes

Posted in Debian by baysao on 17 Tháng Ba, 2007

I’m not using GNOME as main Desktop Window Manager, but stills need run some GTK relate apps.

* Change font, themes, icons GTK+ by edit ~/.gtkrc-2.0. I.e:

gtk-font-name=”Tahoma 9″
style “user-font” { font_name=”Tahoma 9″ }
widget_class “*” style “user-font”
style “gtk-default-mine” { font_name=”Tahoma 9″ }
class “GtkWidget” style “gtk-default-mine”
gtk-icon-theme-name=”Neu”
gtk-theme-name = “Clearlooks-Vista”
gtk-can-change-accels = 1
include “/home/baysao/.themes/Clearlooks-Vista/gtk-2.0/gtkrc”
pixmap_path “/home/baysao/.themes/Clearlooks-Vista/gtk-2.0”

*  For GTK1, edit ~/.gtkrc. I.e:

style “gtk-utf-8”
{
#fontset=”-microsoft-tahoma-medium-r-normal-*-10-*-*-*-p-*-viscii1.1-1″
fontset=”-adobe-helvetica-medium-r-normal–12-*-*-*-*-*-*-*,\
-*-Nimbus Sans L-medium-r-normal–14-*-*-*-p-*-iso10646-1,\
-*-clearlyu-medium-r-normal–17-*-*-*-p-*-iso10646-1,\
-*-r-*-iso10646-1,*”
}
widget_class “*” style “gtk-utf-8”

*Change openoffice icons: download icons and put in /usr/lib/openoffice/share/config.

Emacs tips

Posted in Debian by baysao on 1 Tháng Ba, 2007

Change in .emacs:
* Fixing Garbage Characters in the Emacs Shell:

(add-hook ‘shell-mode-hook ‘ansi-color-for-comint-mode-on)

* From Benjamin Rutt : (tips for c-mode)

* Enable soft word wrapper : choose text-mode

* Festival for emacs: festival.el and how config festival works with alsa.

* Using ispell with aspell for spelling check : tips

* Emacs snapshort v.23.0.0.1 for Feisty.