2008年10月2日 星期四

Creat filesystem index for searhing purpose on Unix

if there are no updatedb and locate commands available, this is an alternative method on any unix-like os

1. using find to produce a list of all files' name and path

find / > fsindex

2. search for file

grep keyword fsindex

2008年9月24日 星期三

Verify SFV listings on Ubuntu

sfv is simple file verfication.

1. download and install cksfv which is no longer in the repository

sudo dpkg -i cksfv_1.3.5-1_i386.deb

2. verify files listed in .sfv

cksfv -f filename.sfv

Convert video by mencoder

mencoder is cross-platform command line video decoding, encoding and filtering tool. it can convert all the formats that MPlayer understands.

a converting example like below

mencoder in.video -oac mp3lame -lameopts preset=64 -ovc lavc -lavcopts vcodec=mpeg4 -ofps 25 -vf scale=320:240 -ni -o out.video

-oac #encode with the given audio codec (no default set).
-oac help #get a list of available audio codecs.
-<codec>opts #codec specific encoding parameters

preset=<value> #ABR encoding at average given kbps bitrate

-ovc #encode with the given video codec (no default set).
-oac help #get a list of available video codecs.

vcodec=<value> #employ the specified codec (default: mpeg4).
#windows media player comptiable format: msmpeg4, msmpeg4v2, wmv7

-ofps #specify a frames per second (fps) value for the output file
-vf scale=x:y #resize video

-ni #force usage of non-interleaved AVI parser (fixes playback of some bad AVI files).

-o #output filename

2008年9月18日 星期四

Run .Net applications on Ubuntu

1. you'll have to install wine and mono, standard compliant .NET compatible set of tools.

sudo apt-get install wine mono

2. run .net applications as common win32 program

wine /path/filename

3. you may suffer this kind of problem related to gdiplus.dll like below

wine: Call from 0x7b844b20 to unimplemented function gdiplus.dll.GdipCreateFontFamilyFromName, aborting

wine: Unimplemented function gdiplus.dll.GdipCreateLineBrushI called at address 0x7b844940 (thread 0009), starting debugger...

4. download gdiplus.dll from www.dll-files.com and put it in .wine/drive_c/windows/system32 then run again

2008年9月11日 星期四

TSocks on Slax

1. activate tsocks module

2. make a configuration file to specify socks server

vi /etc/tsocks.conf
--
server = ip
server_port =
server_type = 5 # socks version
local = ip/mask

server ip must
3. run non-socks aware applications from tsocks

tsocks [application [application's arguments]]

2008年8月21日 星期四

MoBlock on Ubuntu

1. add moblock package path to /etc/apt/sources.list

deb http://moblock-deb.sourceforge.net/debian hardy main
deb-src http://moblock-deb.sourceforge.net/debian hardy main

2. add the gpg key

gpg --keyserver wwwkeys.eu.pgp.net --recv 9072870B
gpg --export --armor 9072870B | sudo apt-key add -

3. update package lists and install moblock and its front-end gui, mobloquer

sudo apt-get update
sudo apt-get install moblock moblock-control mobloquer

4. choose which blocklists to be loaded
http://tbg.iblocklist.com/Lists/
http://www.bluetack.co.uk/forums/index.php?autocom=faq&CODE=02&qid=17

ads-trackers-and-bad-pr0n.gz #advertising
bogon.gz #bogus IP announcements
dshield.gz #hackers
edu.gz #educational institutions
fornonlancomputers.gz #LAN IP ranges
hijacked.gz #IP blocks that are being used without permission
iana-multicast.gz #http://www.iana.org/assignments/multicast-addresses
iana-private.gz #http://www.iana.org/assignments/ipv4-address-space/
iana-reserved.gz #http://www.iana.org/assignments/ipv4-address-space/
level1.gz #for p2p users
level2.gz #general corporate
level3.gz #paranoid list
Microsoft.gz #Microsoft Corp ranges that are not on Level1
proxy.gz #various proxy servers
rangetest.gz #suspicious IPs
spider.gz #automated programs also known as spiders or bots
spyware.gz #malicious SPYWARE and ADWARE IP Address ranges
templist.gz #sending corrupt or virus p2p data

BusinessISPs.zip should not be loaded because most people are in the ranges.
fornonlancomputers.gz and Bogon.zip must be not selected if there is lan traffic with this host.

5. moblock usage (need root privileges)

moblock-control start - inserts iptables rules and starts MoBlock
moblock-control stop - deletes iptables rules and stops MoBlock
moblock-control restart - restarts MoBlock
moblock-control reload - rebuilds the blocklist and reloads MoBlock
moblock-control update - updates the blocklists and reloads MoBlock
moblock-control status - gives the iptables settings and the status of the MoBlock daemon
moblock-control test - simple test to check if MoBlock is working

6. the use of files in /etc/moblock

blocklists.list #blacklist
allow.p2p #whitelist
guarding.p2p #real ip database which should be blocked built from blocklists.list
moblock.conf #configuration file

7. log location

/var/log/moblock.log #block log
/var/log/moblock-control.log #moblock-control status log

8. you can reconfigure moblock withing reinstalling

sudo dpkg-reconfigure moblock


9. allow port 1863 for msn, 5050 for yahoo, 5190 for icq

vi /etc/moblock/moblock.conf

WHITE_TCP_IN=""
WHITE_UDP_IN=""
WHITE_TCP_OUT="80 443 1863 5050 5190"
WHITE_UDP_OUT=""
WHITE_TCP_FORWARD="80 443 1863 5050 5190"
WHITE_UDP_FORWARD=""

you have to set WHITE_TCP_FORWARD if you want to have same whitelist ports on lan or packets from lan computers will be dropped in moblock_fw chain

2008年8月18日 星期一

Correct Putty settings to connect UTF-8 environment

Window -> Appearance -> Font settings
  Fixedsys, 12-point
Window -> Translation -> Character set translation on received data
  UTF-8