Monday, July 24, 2006

Open Source CLI downloader -wget - aget roxx

it's kinds of uncomfortable for me if i can't download all contents for article im reading because they're chapter-base or section-based. by doing that, the authors tend to forget to create one single html/pdf/or_whatever file. *sigh.don't get me wrong, i'm here wasn't to complain about the authors nor the articles. It's really nice if we only need to save/download a single file rather then a bounch of files with a weird name like "chap01_sec1_titleX_beginner.html".huhh.:D. anyways, back to the post title,yeahh downloader. lucky for us to had downloaders which are can download a whole directory to us. speaking of which CLI downloaders are fit for me, i picked wget and aget. why aget?, simply because wget didn't support simultaneous downloading. here is wget command to download all files inside a directory. We can control to lets wget recursively crawling to only a directory. when you're enable wget to recursively downloading files without controling how far it can crawl, your're in big trouble because wget will get all files inside the website which is we didn't want todo that.

shell>wget -r -k -l 1

-r for recursive
-k convert all links to local files
-l level of depth wget can crawl.

shell >wget -r -k -l 1
00:37:59 (1.23 KB/s) - `' saved [3267/3267]

=> `'
Connecting to||:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12,438 (12K) [text/html]

btw, if you want to download bash-scripting tutorial, link i provided is good resource for that. have a nice reading days ahead.
opps. im using aget when i want a simultaneous download. you can use aget with this example

shell> aget -n 10

-n how many thread you want to open

-happy downloading with open source tools.:p

Friday, July 14, 2006

qemu:another problems faded away

today, i played with fedora core at home which i installed 5-6 months back. the motivations behind this issue becouse i got 192MB sdram from a friend,hafiz.thanx,, i start to reinstall the ram and test it with my old/ancient pc running fedora core 4.hahh,my bios showed that i just had extra 192MB of ram.hahaha.gud.:D.when my fedora was booting smoothly, i figured out for how long this machine didn't do any sort of update.:D.hehh.kernel is still running on default installation which is 2.6.11.x.unstable, current kernel is, i was thinking to update this system.being a streamixless home, i decided to bring this machine to my workplace for upgrading the system.ohh, wait, why not just unplug the hdisk and runing it thru qemu.woow, nice idea. beside that, i bought a new tool called "usb 2.0 to ide cable".nifty tools i told u.i recommand u to have one(u can find it at lowyat).so i can plug my fedora hdisk to the usb cable and i ready to go.:D.qemu even asked me which kernel do i need to pick up upon booting.:D.seem like i gonna use this way to upgrade my two others machines running openBSD 3.8 and freebsd 6.0

shell>qemu -hda /dev/sda -m 128 -user-net
when, qemu start to booting my fedora core hdisk, i've had countered with simple problem regarding the Xorg setting.i fixed up this problem with a new setting for display screen set to, now i'm ready for my upgrading is screenshot for my fedora core updating itself with yum.:D.

i had to said that i hate yum so much.:D.hehhe.its freaking slow compare to port/portage system. btw,lucky me to had our malaysian base fedora mirror provided by oscc. you can check the mirror here. i also had centos4.2 on qemu img to be update, but dont worry, let finish this update first.:D.thanx to brilliant qemu features.

Friday, July 07, 2006

OpenBSD: network installation thru qemu

yesterday i tried to upgrade my openbsd 3.8 virtual machine running on qemu inside gentoo box. after reading a couples of docs/howto, i'm ready to give my openbsd3.8 an upgrade.goshh!!, cvs port is closed.demm.i had no choice now.since on official openbsd faq/doc recommanded to always install a brand new release with fresh install,i go for it.aha, now, waiting to my notebook done downloading all openbsd files to make iso cd,i getting tired. my stomach cry asking to be feed.:(.so, i decided to just install thru, i just download a file called floopy39.fs. then i create an image file for new openbsd installation.ohh,wait! i need to create a bootable floopy disk first.but i didn't have a floopy drive. thanx to qemu for allowing us to pass any bootable files to be boot. i create an image file for bootable floopy and copy all contents from floopy39.fs into it.

root@vm>qemu-img create openbsdfloopy.iso 2M
root@vm>dd if=floopy39.fs of=openbsdfloopy.iso

next is to create my installation file for openbsd3.9

root@vm>qemu-img create -f qcow openbsd3-9.iso 6G

then, i fired my qemu up to boot from openbsdfloopy.iso to install openbsd thru network.
root@vm>qemu -fda openbsdfloopy.iso -hda openbsd3-9.iso -m 64 -user-net -boot a

aha, more quicker actually compare with downloading openbsd files to convert them to iso. when installing openbsd, i picked network installation thru http by using mirror from japan{}.you can read more details on installation openbsd thru openbsd official docs page.:D.nah, i can go for dinner now and just let openbsd finish up for the rest.:D.

today, i issued command 'uname -a' on my vm, and i got:

OpenBSD 3.9 GENERIC#XXX i386

ahaa,, today i just installing a few network tools likes honeyd, snort and etc..etc.upps, i also need fluxbox and ease my daily need.:D.
ohh,one more thing.please buy an original cd from haven't got mine.:(.

Tuesday, July 04, 2006

tcpdump filter

these two weeks back, i was playing alot with network tools. one of the tools is tcpdump . usually i tend to ignore any sort of tcpdump filters trick. i just fired up my tcpdump with basic option like "-vv -n -s 1515 -x". but this is not a clean options for capturing packets. in this situation, what i plan to do is to avoid any non tcp traffics, traffics flying out thru my nic and to avoid traffics coming from unsuspicious hosts. so here is the tcpdump filter[note to myself,\0/].

tcpdump -vv -n -s 1515 -x tcp and 'port !22' and not host and not host

noticed here that tcpdump using bpf's style on filtering the filters. tcp option is only to capture tcp traffics, not host is an option not to capture traffics coming from this host. in this example, i can avoid capturing traffics from my host and not 'port !22' option to avoid any traffics coming from port 22:ssh. noticed here when using '!' u need to put an quote '' between !.'!' is just another reserved char in tcpdump. so, be careful when using any of tcpdump reserved char. actually, this is a basic command for tcpdump. there are alot of tcpdump tricks and tips out there. the best place to learn more about tcpdump is

at the other hand of network tools i played are scapy, ruby libpcap and rubyforger. huhh, maybe i'll reserved these tools for next post.heh.:D