Taiwan is a independent country. Chinese are forbidden into,台灣是我的國家,不是他媽中國的一部分,去你媽的中國人
2012/2/6
flush the memory space of cache
free pagecache
echo 1 > /proc/sys/vm/drop_caches
free dentries and inodes
echo 2 > /proc/sys/vm/drop_caches
free force cache
echo 3 > /proc/sys/vm/drop_caches
At last, remember to type
echo 0 > /proc/sys/vm/drop_caches
echo 0 > /proc/sys/vm/drop_caches
Another method,
Method 2:
echo 1 > /proc/sys/vm/drop_caches
or
sysctl -w vm.drop_caches=1
Method 3:
fcntl(fd, F_SETFL, O_DIRECT)
Method 4:
sysctl -w vm.vfs_cache_pressure=n (n > 100)
this make kernel to free cache frequencily.
2011/2/12
To make HUAWEI E800 modem usb care working for Linux-like OS (Mandriva 2010.2)
2011/2/10
Installing browser plug-ins (Adobe Flash)
2010/8/27
security for sshd server
Touch directories recursively
2010/7/22
PC-clusters on Fedora 13 by using MPICH2
PC-cluster:
NFS + NIS + (SSH or RSH) + intel compiler + MPICH2
1. update your system
* Set up your network to make it work well
* yum update OR yum upgrade
* Shut down the firewall and SELinux
=>System => Administration => Firewall=> disable
=>System => Administration => SELinux management => disable
=> vim /etc/selinux/config => SELINUX=disabled
=> vim /boot/grub/menu.lst => add "selinux=0" in back of kernel
* Shut down the service you do not need because we don't have firewall
=> sendmail, iptables, ip6tables, httpd, cup and etc.
2. hosts
* The inner computer must can be checked each others
=> 192.168.10.1 n1
=> 192.168.10.2 n2
=> 127.0.0.1 n1 localhost
* This is very important step. If you have the message as using mpd later like that
=> conn error in connect_rhs: Connection refused
(connect_rhs 979): failed to connect to rhs at 127.0.0.1 48503
(enter_ring 886): rhs connect failed
failed to enter ring
* This due to the n2 always connect to itself as checking the hosts file
* You have to change the localhost to the last line, and put 192.168.10.2 n2 in first line
3. NFS
rpm: nfs , nfs-utils, rpcbind (before fedora 7 is portmap)
on n1
* I want to share the /home and /opt to n2
* vim /etc/exports
=> /home 192.168.10.0/24(rw,async,no_root_squash)
=> /opt 192.168.10.0/24(ro,async)
* restart the nfs and rpcbind
* observe whether it work
=> check /var/log/messages
=> showmount -e n1
=> netstat -utln
=> rpcinfo -p n1
On n2
* restart rpcbind
* Can it find the n1 share
=> showmount -e n1
* Mount n1 share to n2
=> mount -t nfs n1:/home /home
=> mount -t nfs n1:/opt /opt
* edit the /etc/fstab
=> n1:/home /home nfs defaults 1 2
=> n1:/opt /opt nfs async,auto,ro,exec,nouser
4. NIS
rpm: yp-tools,ypbind,ypserv,rpcbind
on n1 (NIS server):
**set nis domainname
=>nisdomainname aaa
=>nisdomainname aaa
To be continued
2010/7/4
Linux Code Editor, programming editor, Syntax Highlight
2010/6/22
Usage of sed II: insert a line into files
2010/5/7
VirtualBox on Mandriva 2010
2010/5/6
Using VNC to login from other OS to linux
2010/4/7
Content Management System
A content management system is software that keeps track of every piece of content on your Web site, much like your local public library keeps track of books and stores them. Content can be simple text, photos, music, video, documents, or just about anything you can think of. A major advantage of using a CMS is that it requires almost no technical skill or knowledge to manage. Since the CMS manages all your content, you don't have to.
More popular CMSs are on http://php.opensourcecms.com/
For example:
- Portial:phpnuke, Xoops ,Joomla
- Forums:phpbb ,discuz, smf, vbb, ipb
- eCommerce:osCommerce, phpShop
- Blogs:Lifetype, Wordpress, Movable Type
Joomla homepage in taiwan: http://www.joomla.org.tw/
2010/3/2
The user home in apache mandriva 2010
You have to install it by typing "urpmi mod_userdir"
2010/2/4
The difference between different kernel in Mandriva Linux
2009/12/22
set up your own blogger by WordPress
Install Google Chrome browser (beta)
2009/12/8
Usage of mencoder II
mencodermencoder output.avi -of mpeg -ovc lavc -lavcopts vcodec=mpeg1video -oac copy -o outputmpg.mpginput.avi-of mpeg -ovc lavc -lavcopts vcodec=mpeg1video \
-oac copyother_options-ooutput.mpg
mbd=<0-2> (also see *cmp, qpel)
Macroblock decision algorithm (high quality mode), encode each macro block in all modes and choose
the best. This is slow but results in better quality and file size. When mbd is set to 1 or 2,
the value of mbcmp is ignored when comparing macroblocks (the mbcmp value is still used in other
places though, in particular the motion search algorithms). If any comparison setting (precmp,
subcmp, cmp, or mbcmp) is nonzero, however, a slower but better half-pel motion search will be
used, regardless of what mbd is set to. If qpel is set, quarter-pel motion search will be used
regardless.
0 Use comparison function given by mbcmp (default).
1 Select the MB mode which needs the fewest bits (=vhq).
2 Select the MB mode which has the best rate distortion.
trell
Trellis searched quantization. This will find the optimal encoding for each 8x8 block. Trellis
searched quantization is quite simply an optimal quantization in the PSNR versus bitrate sense
(Assuming that there would be no rounding errors introduced by the IDCT, which is obviously not
the case.). It simply finds a block for the minimum of error and lambda*bits.
lambda
quantization parameter (QP) dependent constant
bits
amount of bits needed to encode the block
error
sum of squared errors of the quantization
2009/11/10
How to apply mencodes to convert image (jpg,png) to movie or animation (avi,mpeg)
MEncoder is capable of creating movies from one or more JPEG, PNG or TGA files. With simple framecopy it can create MJPEG (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files.
Explanation of the process:- MEncoder decodes the input image(s) with
libjpeg(when decoding PNGs, it will use libpng). - MEncoder then feeds the decoded image to the chosen video compressor (DivX4, XviD, ffmpeg msmpeg4, etc...).
Examples
The explanation of the -mf option can be found below in the man page.
Creating a DivX4 file from all the JPEG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi \*.jpg
Creating a DivX4 file from some JPEG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25 -ovc divx4 -o output.avi frame001.jpg,frame002.jpg
Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25 -ovc copy -o output.avi \*.jpg
Creating an uncompressed file from all the PNG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25:type=png -ovc rawrgb -o output.avi \*.png
Note: Width must be integer multiple of 4, it's a limitation of the RAW RGB AVI format.
Creating a Motion PNG (MPNG) file from all the PNG files in the current dir:
mencoder -mf on:w=800:h=600:fps=25:type=png -ovc copy -o output.avi \*.png
Creating a Motion TGA (MTGA) file from all the TGA files in the current dir:
mencoder -mf on:w=800:h=600:fps=25:type=tga -ovc copy -o output.avi \*.tga
reference: http://web.njit.edu/all_topics/Prog_Lang_Docs/html/mplayer/encoding.html
Examples. The explanation of the -mf option is in the man page.
Creating an MPEG-4 file from all the JPEG files in the current directory:
mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc \
-lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -ooutput.avi
Creating an MPEG-4 file from some JPEG files in the current directory:
mencoder mf://frame001.jpg,frame002.jpg-mf w=800:h=600:fps=25:type=jpg \
-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -ooutput.avi
Creating an MPEG-4 file from explicit list of JPEG files (list.txt in current directory contains the list of files to use as source, one per line):
mencoder mf://@list.txt-mf w=800:h=600:fps=25:type=jpg \
-ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -ooutput.avi
You can mix different types of images, regardless of the method you use — individual filenames, wildcard or file with list — provided of course they have the same dimensions. So you can e.g. take title frame from PNG file, and then put a slideshow of your JPEG photos.
Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current directory:
mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc copy -oac copy -ooutput.avi
Creating an uncompressed file from all the PNG files in the current directory:
mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc raw -oac copy -ooutput.avi
Note
Width must be integer multiple of 4, it is a limitation of the RAW RGB AVI format.
Creating a Motion PNG (MPNG) file from all the PNG files in the current directory:
mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc copy -oac copy -o output.avi
Creating a Motion TGA (MTGA) file from all the TGA files in the current directory:
mencoder mf://*.tga -mf w=800:h=600:fps=25:type=tga -ovc copy -oac copy -o output.avi
reference: http://www9.mplayerhq.hu/DOCS/HTML/en/menc-feat-enc-images.html
My example convert png to xvid
mencoder mf://*.png -mf w=800:h=600:fps=12:type=png -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -o output.avi
2009/10/28
Bluefish-tool of webdesign
Homepage: http://bluefish.openoffice.nl/
2009/10/20
Add more color fot xmgrace
***********************************************
@map color 16 to (60,179,113), "MediumSeaGreen"
@map color 17 to (0, 149, 182), "BondiBlue"
@map color 18 to (123, 160, 91),"Asparagus"
@map color 19 to (181, 166, 66), "Brass"
@map color 20 to (150, 75, 0), "Brown"
@map color 21 to (240, 220, 130), "Buff"
@map color 22 to (255, 20, 147), "DeepPink"
@map color 23 to (255, 99, 71), "Tomato"
@map color 24 to (209, 226, 49), "Pear"
@map color 25 to (128, 128, 0), "Olive"
@map color 26 to (0, 0, 128), "NavyBlue"
@map color 27 to (212, 175, 55), "Gold"
@map color 28 to (185, 78, 72), "Deepchestnut"
@map color 29 to (233, 150, 122), "DarkSalmon"
@map color 30 to (139, 0, 139), "DarkMagenta"
***************************************************************
2009/8/17
Some option of PETSc
1cup:
./run.exe -inputfile input.txt -ksp_type preonly -pc_type lu -pc_factor_shift_nonzero -snes_rtol 1.e-5 -snes_max_it 6 -iterations 5000000 -snes_monitor -dump_data_cycle 200 -CONSTANT_TIME_STEP -dump_data 3020