Dory

And now I have - CADIE

Subscribe to RSS feed

Arch Linux (or why I'm so in love)

It's been a months since I installed Arch Linux in a Linux VM in my company laptop running Win7. Everything has been so perfect so far.

I'm gonna write this blog in the spirit of "The Arch Way": Simple, Correct, Control, Open, Free.
  • Complete control of my system: Arch, by default installs only a bare minimum set of tools just to get the computer to boot into command line. From there I get to build it up into whatever shape I wanted. This was the reason I tried Arch in the first place: To try out FVWM and E17. Even though it takes some work to get the system up and running, it's nowhere as intimidating as Slackware or Gentoo: everything is so clearly documented, and there even a "Beginner-friendly" guide to help. I get to choose which driver to load, in what order, which daemon to run, and when. And instead of having to make dozens of symlinks around or dig into menus of configurations and Google, it was done in only 2 lines in 1 configuration file!
  • Ultra light-weight: Since I started with a bare minimum system, there is absolutely no bloat. There is no "open-vm-tool" and "virtualbox-ose-guest" preinstalled (like in Ubuntu and openSuSE), there is no 30 daemons running in background doing who-knows-what, and there is no loading of all kernel modules that the OS can find. Even with a DE, I got to choose what to put in. It's never been simpler to replace network-manager with wicd, or installing new input method, or get subpixel working.
  • Simple to administer: Since almost all configuration can be (and can only be) done in a single rc.conf file, it's easy to see what's going on. I was never able to get subpixel to work properly in OpenSuSE 11.3; yet with Arch, getting subpixel to work (even in FVWM) can be done in 2 commands!
  • Easy to clone: Since there is no "automatic hardware detection" (dunno what it does - my machine is working perfectly without it) and no hidden auto config, cloning to another machine is so easy. In fact, I cloned my VM to my laptop and desktop without any problem. All I needed to do was to remove open-vm-tools, install new display driver, add in some power-saving daemon for the laptop, and it's done.
  • Awesome community: I used to browse through Ubuntu forum, only to find that there are 100 people with the same problem as yours complaining about it in 12 different topics, getting annoyed by questions like "Where is the terminal?", and still no one have solved the problem. Arch community is different. Everyone knows something. There is hardly a post on the forum that was left unanswered. Worst case is probably "Woohoo! It's a bug! Let's go file a bug report upstream!" It's just lovely.
  • Rolling release: The fact that Arch is a rolling release means that I can get the most cutting edge software without having to reinstall, or go install software from some random repo and break something else.

Here's a screenshot of my laptop running smoking hot Gnome-shell:

Yuno what it is.

I don't generally like mashups. Most of them failed to bring out anything better in the songs that they based on.

This one is different. This Wiz Khalifa x Hidamari Sketch mashup by nakinyko is composed of just pure awesomeness. The concept is so clever: "Two songs about color", one of them is "Black and Yellow". Did I mention black rappers and anime music don't always go together? "Black and Yellow"? The mix is good without any seam. And don't tell me he didn't think of Yuno when mixing in "You know what it is", there's no way anyone would believe that bigsmile.

Mashups should be like this: better than any of the original songs alone.

Enjoy! ("_____" X)

Alexandra Wallace

From Alexandra Wallace: "I made a mistake. My mistake, however, has lead to the harassment of my family, the publishing of my personal information, death threats, and being ostracized from an entire community. Accordingly, for personal safety reasons, I have chosen to no longer attend classes at UCLA."

I don't get it. Didn't she learn anything from all this? So the reason she chose not to continue at UCLA was because she was "ostracized" from the community? How come she didn't realize that it was she who "ostracized" herself from the community, and is also the only one who can fix that? True that she sent an apology, but anyone who reads that can clearly see that she just freaked out and was not really sorry at all! I'm angry. She made it sounds like she did nothing wrong, and she's running away because people didn't like her. Aw, come on, emo kid, don't cry. Running away from your problem doesn't make things better. Grow up and learn! Face it. YOU are humiliated because YOU did something embarrassing. And YOU run away because YOU chose not to face the problem, not because of US UCLA STUDENTS, dammit.

Can't really put all the blame on her, though, because she did make a good point in her video (besides the cell phone thingy): parents really affect how their kids grow up. How can she accepts the diversity, while her dad supports her in creating a website about "Asians in the library"? In case you didn't know, her dad wrote on his blog about how his daughter is shooting videos and asked him about a domain name for "Asians in the library". He knows about it, yet did nothing about it. Talk about teaching "American manners"? Okay.

UCLA can't do anything about Alexandra Wallace in particular, quoting free speech. But what it can do, being one of the most diverse universities, is to improve admission criteria and required curriculum. I'm pretty sure Chancellor Block already got an earful of that already, looking at his Facebook page. I hope he would do something we all hope he does, seeing this as a chance of improvement and not just another embarrassing scandal that needs to be forgotten.

aria2

I've been looking for a good download manager/accelerator for my router. I needed one that can be invoked from the command line; can be remotely managed; can log to a file; able to download from HTTP, FTP, Torrent; and doesn't hog all the precious RAM my router has (okay, my router now has 128MB ram, and I'm not even using 1/3 of that yet, but using less RAM is always good right?).

- I tried transmission-daemon: almost perfect. Really good, but only "almost". Problem? No HTTP/FTP downloads. (well, it _does_ hog ram, though).
- I resorted to wget. Really simple, supports resuming, resource-friendly. Problem? No torrent and no parallel download.

I kinda gave up on the idea for a while, resorting to using transmission for torrent and writing a php wrapper page to start wget remotely. That is, until I stumbled upon aria2. It really delivers everything that its home page advertised. And I became hooked in no time. Not only it replaced wget on my router, it also replaced all the download managers on my laptop. What I love the most about aria2 is the ability to download from multiple sources at the same time (not only multiple chunks form the same source)! With this, I can speed up downloading of linux ISO images by combining several mirrors for downloading at once.

It's sad that not many people know about this downloader. It's probably because there is not good GUI for it yet. I'll write one when I have free time...

Simple SSH Port Forwarding

I learned to do SOCKS5 proxy and SSH local/remote port forwarding today!

SOCKS5 Proxy

ssh [-f] [-i ~/.ssh/my_private_key] -N -D 1080 sshd.computer
Then on the connecting computer, do SOCKS5 to localhost:1080.

Port Forwarding

ssh [-f] [-i ~/.ssh/my_private_key] -N -L 10000:thecomp:80 sshd.computer
Then connections to localhost:10000 from the connecting computer will be forwarded to thecomp:80 from the remote sshd.computer. Or you can do the reverse:
ssh [-f] [-i ~/.ssh/my_private_key] -N -R 10000:thecomp:80 sshd.computer
Then connections to localhost:10000 from the sshd.computer will be forwarded to thecomp:80 from the connecting computer.

This opens up a whole range of possibilities, like connecting back to your work machine behind a firewall without using VPN; getting simple proxy setup anywhere, anytime to any of the SSH servers you're allowed to connect to; allowing you to connect to and fix your friend's computer without having him mess with his router and firewall; or connecting to a service on your home computer that you forgot to do NAT port forwarding on your router, all without root access! It's just simply amazing.

Facebook.

Couple of years ago, I had problem connecting to FB from Vietnam. The problem turned out to be a simple wrong DNS return for login.facebook.com (here). The solution is quite simple: to use a different DNS server - OpenDNS's and Google's are 2 excellent ones. This showed that no one is blocking Facebook access.

Today, however, I tried again, only to figure out that I couldn't even get to the login page. It is more alarming this time.
$ dig facebook.com
...
;; ANSWER SECTION:
facebook.com.           1342    IN      A       69.63.181.12
facebook.com.           1342    IN      A       69.63.189.11
facebook.com.           1342    IN      A       69.63.189.16
...

So the returned addresses are correct. It has to be, as I'm using Google's DNS. As an instinct, I did
$ ping facebook.com
PING facebook.com (69.63.189.11) 56(84) bytes of data.
64 bytes from www-10-01-ash2.facebook.com (69.63.189.11): icmp_seq=1 ttl=242 time=260 ms
64 bytes from www-10-01-ash2.facebook.com (69.63.189.11): icmp_seq=2 ttl=242 time=261 ms
64 bytes from www-10-01-ash2.facebook.com (69.63.189.11): icmp_seq=3 ttl=242 time=258 ms
^C
--- facebook.com ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3004ms
rtt min/avg/max/mdev = 260.045/260.233/260.576/0.242 ms

There. I could ping it. But wget facebook.com just timeouts. It means that access to facebook.com on port 80 is filtered somewhere along the route. This is bad, as to young users, it would almost mean that Vietnamese firewall is blocking Facebook. If this is not true, someone is playing some nasty trick against us. If this is true, however, it means that we are stopping censoring free speech. I will update as soon as I find out some more detail.

EDIT 1: Obviously, a proxy if a natural choice. For those who don't want the hassle of finding, chasing and setting proxy by hand, there is Opera Turbo with Opera browser. Look here

Christmas 2010

Hôm nay rảnh rảnh, đi last minute shopping ở Fry's. Chẳng mua đc gì ngoài 1 mớ jumper wires. Quầy tính tiền...

Cashier guy: Hey, you look familiar... Duy, right? You were in my Physics class.
Me: Hmm... wow, you still remember. With Mona right? (who is this guy. It's been 3 years!)
Him: Yea! How are you doing?
Me: Great! I just finished with school actually. Just moved down to SD. How about you? (hmm, yea, his face kinda looks familiar, but the name on his name tag fires none of my neurons)
Him: I'm still in school. I'm a [...] now. Yea, I changed my major.
Me: Oh really? To what? (can't exactly hear what he said, and expecting an explaination)
Him: [continues on] ...You know, I didn't like it that much. Well, cya around, and merry Christmas. [khách hàng tiếp theo]

Chả nhẽ mình đãng trí dữ vậy sao kà.

Backtrack 4 from PXE on DD-WRT

, , , ...

So you get your new router up and running with DD-WRT with all its cool stuffs. You plugged in a USB and installed Optware. Now what?
Well, to me, one of the coolest thing is to have my router boot up the computers plugged into it!
Note: Although I did this on a router, nothing can stop you from setting this up on a real computer.

Make sure you have optware installed. If not, look here. In my case, I mounted my "Data" partition to /mnt.

Step 1: Setting up the PXE server.
If you already have one running, skip this step.
Install a tftp server. I use tftp-hpa, as it allows loading of files bigger than 32MB. We will need this for a lot of distros.
ipkg install tftp-hpa

Point the server root to /mnt/tftpboot (or anywhere else you desired).
vi /opt/etc/xinetd.d/tftp
--> server_args = -s /mnt/tftpboot

We need to tell the DHCP server to tell PXE requests to get stuffs from our tftp. Open up a browser and go to the router's config page (which in my case, is 192.168.1.1). Go to tab Services->Services->DNSMasq, enable DNSMasq and enter into the "Additional DNSMasq options" box:
dhcp-boot=pxelinux.0,DD-WRT,192.168.1.1

Download pxelinux. Extract core/pxelinux.0 to /mnt/tftpboot. Create directory /mnt/tftpboot/pxelinux.cfg/, and create a file named "default"
mkdir /mnt/tftpboot/pxelinux.cfg
vi /mnt/tftpboot/pxelinux.cfg/default

Assuming your router's IP is 192.186.1.1, enter the text below (or add the bt4 entry into your existing PXE config file)
label bt4
    kernel bt4/boot/vmlinuz
    append initrd=bt4/boot/initrd.gz BOOT=casper boot=casper nopersistent rw quiet vga=0x317 netboot=nfs nfsroot=192.168.1.1:/mnt/tftpboot/bt4
default bt4
prompt 1

Don't worry about the non-existance bt4 directory, we'll create it next.

Step 2: Adding BT4 to your PXE config
Download Backtrack 4 to your computer (or even to your router, if you have enough space and iso9660 filesystem driver installed cool). Mount the iso, copy all files inside the iso into /mnt/tftpboot/bt4 on the router (you should already figured out how to do this).
mount -t iso9660 -o loop bt4-rc2.iso /mnt/bt4iso
mkdir /mnt/tftpboot/bt4
cp -r /mnt/bt4iso/* /mnt/tftpboot/bt4/

Or if you don't want to go through the hassle on installing kernel modules and its inherent risk, you can try this:
ipkg install p7zip
mkdir /mnt/tftpboot/bt4 
7z e -o /mnt/tftpboot/bt4 bt4-rc2.iso

Reboot your router, wait for 3 minutes and try booting a computer up over network with this. If you can load the kernel and the initrd, and maybe seeing the framebuffer colored background coming up, then it is working. It will not go further, but don't worry. We will fix it in next step.

Step 3: setup NFS server
ipkg install unfs3 portmap

unfs3 is all we have on the router right now. Next up, edit /opt/etc/init.d/S56unfsd, Make sure it looks like this
#!/bin/sh
if [ -n "`pidof unfsd`" ] ; then
    killall unfsd 2>/dev/null
fi
sleep 2
unset LD_LIBRARY_PATH
/opt/sbin/unfsd -e /opt/etc/exports

Edit /opt/etc/exports (create the file if it d.n.e)
/mnt/tftpboot/bt4 192.168.1.0/255.255.255.0(sync,no_root_squash,ro,no_subtree_check)

Edit the subnet to share with accordingly.
Reboot your router, wait 3 minutes again and boot up your computer over network, and viola, BT4 over PXE from a router!
Next up is to do a persistent boot, but I think you can figure it out from here now smile

The STRONGEST post

When I heard of Fairy Wars, I thought "Hm, this time it's gonna be Star Sapphire, Lunar Child and Sunny Milk vs. whom?" - and was so surprised to see CIRNO!

Sansa Clip+


To all the reviewers who keep saying that frequency response is not very important to an mp3 player: You should really listen to this.

This lil cutie worths every penny I paid for it. Who would think an unassuming, $31 mp3 player from Sandisk would sound so good. I almost lost my trust in numbers when I saw the review at mp3.com and the Clip's price tag (http://www.mp3.com/news/stories/11424.html&print=1), but my engineering intuition didn't fail me this time (just look at the Clip's FR curve... even flatter than a guy's chest).

No video player, no picture viewer, no fancy EQ, no color LCD, just a flat frequency response curve and very high SNR - that's all an mp3 player need to have. The result? Deep bass, clear treb, warm voices, no hissing noise.

I would highly recommend the Clip and the Clip+ to anyone about to buy a mp3 player, especially ones with a tight budget. Even if you already have a Zen XFi, give this lil one a try. Unless you're using the stock headphones, you won't be disappointed.
May 2013
M T W T F S S
April 2013June 2013
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31