Tagged: linux RSS Toggle Comment Threads | Keyboard Shortcuts

  • 5:39 pm on August 1, 2010 Permalink | Reply
    Tags: convert ISO, linux   

    CD-ROM is NOT in ISO 9660 format 

    If you found this error on linux.. you can use “iat” to convert it into iso9660

    To install

    sudo apt-get install iat

    Usage

    iat target_iso_file.iso

     
  • 4:07 pm on June 23, 2010 Permalink | Reply
    Tags: download, linux, , wget   

    download file using wget 

    [lang_en-us]In linux.. you can use wget as your download manager. Wget has many features to make retrieving large files or mirroring entire web or FTP sites easy. How to use it?.. actually it’s pretty simple.

    Say you want to download a url. Just type:[/lang_en-us]

    [lang_ms-my]Dalam linux,korang boleh gunakan wget sebagai download manager untuk download sebarang file.Wget mempunyai pelbagai fungsi yang aku boleh katakan sangat berguna sebagai “simple tetapi advance” download manager. Cara gunakannya agak mudah.. hanya menggunakan arahan wget seperti[/lang_ms-my]

    wget http://ibnuyahya.com/

    [lang_en-us]But what will happen if the connection is slow, and the file is lengthy? The connection will probably fail before the whole file is retrieved, more than once. In this case, Wget will try getting the file until it either gets the whole of it, or exceeds the default number of retries (this being 20). It is easy to change the number of tries to 45, to insure that the whole file will arrive safely:[/lang_en-us]

    [lang_ms-my]Satu soalan… apa yang akan terjadi jika sambungan internet korang terlalu perlahan dan fail yang nak di download tu sangat besar?. Pastinya mungkin korang akan hadapi masalah “connection fail” atau timeout. Dalam masalah ni,wget akan cuba download file tersebut sehingga selesai atau sehingga memenuhi had bilangan percubaan. Default had bilangan percubaan adalah 20 kali, tetapi kita boleh ubah dengan menggunakan arahan –tries. Contoh dibawah aku ubah had bilangan cubaan download menjadi 45 kali.[/lang_ms-my]

    wget –tries=45 http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-desktop-i386.iso

    [lang_en-us]Now let’s leave Wget to work in the background, and write its progress to log file log. It is tiring to type ‘–tries’, so we shall use ‘-t’.[/lang_en-us]

    [lang_ms-my]jika  malas nak tunggu wget selesai download .. boleh run wget sebagai background process dan log segala aktiviti didalam log file.  arahan –tries juga boleh digantikan dengan -t untuk arahan singkat[/lang_ms-my]

    wget -t 45 -o log http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-desktop-i386.iso &

    [lang_en-us]The ampersand at the end of the line makes sure that Wget works in the background. To unlimit the number of retries, use ‘-t inf’.

    if you want to resume your download file.. you can add -c parameter[/lang_en-us]

    [lang_ms-my]ampersand di akhir line membolehkan wget di jalankan di belakang tabir walaupun korang dah tutup terminal console korang.

    jika korang nak resume file download, korang boleh tambah arahan -c[/lang_ms-my]

    wget -c http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-desktop-i386.iso

    [lang_en-us] When you want to download multiple file.. you can use[/lang_en-us]

    [lang_ms-my]Untuk download file melebihi satu file dengan satu arahan[/lang_ms-my]

    wget http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-desktop-i386.iso http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-server-i386.iso

    [lang_en-us]or.. create a text file. Since..im not familiar with vi.. i’m using nano ;p[/lang_en-us]

    [lang_ms-my]ataupun lebih kemas kalau korang masukkan senarai url yang hendak di download kedalam text file. boleh gunakan vi kalau korang biasa dengannya. di sebabkan aku tak biasa, aku gunakan arahan nano je hehe[/lang_ms-my]

    nano /tmp/download.txt

    [lang_en-us]Then add your link.. put each link in a separate line[/lang_en-us]

    [lang_ms-my]Lepastu masukkan link korang. pastikan setiap link dipisahkan dengan line yang baru[/lang_ms-my]

    http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-desktop-i386.iso

    http://mirrors.cytanet.com.cy/linux/ubuntu/releases/10.04/ubuntu-10.04-server-i386.iso

    [lang_en-us]save and run[/lang_en-us]

    [lang_ms-my]Save dan run[/lang_ms-my]

    wget -i /tmp/download.txt

    [lang_en-us]The rest of the wget manual you can read from here http://www.gnu.org/software/wget/manual/wget.html#Top

    next time we explore aget command to enable multithread download just like usual download manager application ;) [/lang_en-us]

    [lang_ms-my]Untuk maklumat lanjut dan lebih terperinci.. korang boleh lawati http://www.gnu.org/software/wget/manual/wget.html#Top

    akan datang kita bincang pula macamana nak gunakan aget untuk fungsi multi-thread download macam kebanyak download manager buat.[/lang_ms-my]

     
  • 8:59 pm on May 19, 2010 Permalink | Reply
    Tags: concy, , linux, solat time, waktu solat   

    Put solat time in conky|Pasang jadual solat di conky 

    If you’re linux user and want to put solat time in your concy.. just do the following step. I make this code a few week ago because most of my time is in front of computer. So it would be easy if I put this solat time in the place that I can easily to see.

    1. create a php file name solat.php and put it in your webroot directory. Copy this code and paste in your solat.php . This code will get solat timetable from e-solat.gov.my . You can change url get parameter with your own need. Please refer to http://www.e-solat.gov.my/ for more detail.

    $data = file_get_contents('http://www.e-solat.gov.my/solat.php?kod=SGR03 & lang=BM&url=http://google.com');
    $data = strip_tags($data,'<table><tr><td></td></tr></table>');
    $data = str_replace(" ","",$data);
    
    $dom = new DOMDocument();
    $dom->prevservWhiteSpace = false;
    $dom->loadHTML($data);
    $trs = $dom->getElementsByTagName('tr');
    foreach( $trs as $tr){
    	$td = $tr->getElementsByTagName('td');
    	$result = array();
    	foreach($td as $row){
    		$result[] = trim($row->nodeValue);
    	}
    	$results[] = $result;
    }
    
    echo $results[5][0] . '       ' .$results[5][1] . "n";
    echo '   '. $results[6][0] . '      ' .$results[6][1] . "n";
    echo '   '. $results[7][0] . '     ' .$results[7][1] . "n";
    echo '   '. $results[8][0] . '      ' .$results[8][1] . "n";
    echo '   '. $results[9][0] . '        ' .$results[9][1] . "n";
    echo '   '. $results[10][0] . '   ' .$results[10][1] . "n";
    echo '   '. $results[11][0] . '       ' .$results[11][1] . "n";
    

    2. create shell script solat.sh and put into your concy script folder. Copy and paste this code inside solat.sh

    URI=http://localhost/rnd/solat/solat.php
    EXEC="/usr/bin/curl -s"
    $EXEC $URI
    

    [lang_en-us]Please change URL to your own. Usually http://localhost/solat.php if you put solat.php script inside your webroot directory

    3. Edit your .concyrc file and add this code

    ${font Radio Space:size=14}Solat Time
    ${font}
    ${texeci 900 ./scripts/solat.sh}
    

    result

     
    • Mario Auclair 9:03 pm on December 15, 2010 Permalink | Reply

      Fantastic blog! I really love how it?s easy on my eyes and also the information are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your rss feed which ought to do the trick! Have a nice day!

c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel