ada di sini http://dmine.blogspot.com/2008/11/latex-vertical-text.html
01 Juli 2010
20 Juni 2010
specification pattern
16 Juni 2010
some useful daily scripts
Last update: 13 Feb 2011
I wrote several simple scripts to manipulate the content of files. Most of them are written in bash, but due to my lack of expertise sometimes I mixed bash with make, and perl. It will be very practical.. almost no explanation, but I'll try to gradually improve this article. Here are they:
- Find the files with specific content
find . -type f -name "*.bash" -print0|xargs -0 grep -ne "keyword"
- Change certain content of files in batch manner. Just copy these script into a command.bash, and change the permission then run it (command filenamepattern old new)
./command.bash "tt*" tir ti
The script:#!/bin/bash TMPDIR=/tmp fname=${1} old=${2} new=${3} tmpfile=${TMPDIR}/$$.tmp #echo "ls ${fname}" for mydataset in `ls ${fname}`; do echo "${mydataset}" cat ${mydataset} | sed -e "s/${old}/${new}/g" > ${tmpfile} mv ${tmpfile} ${mydataset} done - Delete a bunch of file
If you have thousand of files, rm * will not work, therefore here is an alternative. Create a makefile with the following entry and call make clean.clean: find . -name "*.log" -print -exec rm {} \; - Creating tags for emacs
find . -name "*.[chCH]" -print | etags -
In case you have only few filesetags file1 file2 ...
- Removing Hijriah calendar from islamicfinder.com praying timetable :). Often the hijriah date make me confuse and pick a wrong time. I do it in vi using this search and replace command.
:%s/[0-9]*\/[0-9]*\t//g
- Cleaning carriage return/line feed (crlf) but left double crlf. I use this for formatting my latex style text file (which uses crlf extensively) before I upload it into blogger.
cat fileinput |sed -n 'H;${g;s/\n/crlf/g;p}'| sed -n 'H;${g;s/crlfcrlf/\n\n/g;p}'| sed -n 'H;${g;s/crlf/ /g;p}' > file output - Resize pictures/images, 1024 is the width
mogrify -resize 1024 *.jpg
- Montage/combine/collate pictures into one
montage *.jpg -tile 1x2 -geometry 1024 combine.jpg
- Convert images into pdf
mogrify -format pdf *.jpg
- Download Al-Quran ayats.
#usage: # want to download albaqarah ayat 1 to 10 # to download other ayat you must change this script accordingly # just to list the download commands #$ bash dlayat.sh 1 10 # actually download #$ bash dlayat.sh 1 10 download i="${1}" j="${2}" download=0 if [ "${3}" == "download" ] then download=1 echo download fi while [ $i -le $j ] do padd="" if [ $i -lt 100 ] then padd="0" fi if [ $i -lt 10 ] then padd="00" fi if [ $download -eq 1 ] then wget http://www.everyayah.com/data/Ghamadi_40kbps/002${padd}${i}.mp3 else echo wget http://www.everyayah.com/data/Ghamadi_40kbps/002${padd}${i}.mp3 fi i=$[$i+1] done - Converting raw images into jpg in batch manner
#change the raw file extension accordingly thepath=${1} for file in `ls ${thepath}*.CR2`; do ufraw-batch --out-type=jpg ${file} done - To be continued..
Label: komputer
06 Juni 2010
service bagus telkom speedy

04 Juni 2010
laptop baru
Memang bukan "baru laptop", cuman axioo pico.
- wireless jalan, tapi harap hati2 kalau ingin beli, di manualnya ada seri dimana wifi adalah piranti optional
- key panah terlalu kecil sering kepencet sampingnya, untung cuma tombol ctrl
- tombol fn di pojok, cukup bermasalah buat yg suka pake ctrl di kiri. oooh emacs!
- webcam jalan juga.. tanpa instalasi apapun
- prosesornya support hyperthreading
- suaranya kecil banget. semoga baik2 saja kalo pake headphone
- tombol left & right click keras banget, kurang nyaman.
Label: komputer
16 April 2010
Environment kills the mind
h o p e
23 Februari 2010
resistance is futile!

acer: asli cepat rusak.
That's really true. Zero, I got a dead pixel on the screen from the beginning. First, I got problem with the charger/adapter in less than six months, fortunately they gave me a new one, even though I had to threatened them with law suit because they said my adapter was fake. Second, I lost electricity on my battery. Third, it constantly hang due to horizontal position changing, that force me to treat my mobile laptop as portable desktop. Four, I plug the hardisk off and boot from a usb disk dongle, I made my hardisk as external hardisk until now. Five, I didn't boot at all. From the sound I suspected it might be the DVD/CD-ROM, since I didn't have any moving parts except the fan. So I plug the CD-ROM. This picture is the destructive result.

