Saturday, September 26, 2009

Hong Kong

I'm in Hong Kong now. It's 3:22 AM Sunday morning. Days become nights and days become blurry in the haze of travelling half-way around the world. I'm travelling with mom and Elaine (sister). They are sleeping right now.

We left for Pearson around 9:15 PM on Sep. 24th. My uncle drove us to the airport. We checked our bags and waited for the boarding call. My feelings about the trip is mixed. The intent was to travel to Asia alone, or at least with a friend who was interested in going and finding out later why we went. But that changed because I was afraid to go alone and because all evidence suggests that I couldn't handle it on my own (language being the principle defficiency). I have to admit that I'm defficient in many ways but there's nothing like a trip with yourself to expose them to the light of day.

We travelled Economy class with Korean Air. Mom asked around and we eventually settled on these flights. A very nice flight. Cheap seats and beautiful flight attendants. That's all I need to say. Red-eye flight so we left Pearson at 11:50 PM Thursday and arrived in Seoul 1:10 AM Saturday. Mostly uneventful. You try and sleep, you eat and then you try and sleep some more. If it weren't for our hostesses I would prefer to wake up in Seoul and have no recollection of the trip. The girls wore a beige jacket over a beige skirt, teal blouse with a scarf tied at the neck. Very elegant. Some wore short sleeves some wore long sleeves, some wore pants, most had their hair tied back but one had her hair short and cropped. Quite a variety. However, they all had their hair accented with a hair clip that looks like the traditional chopsticks. I enjoyed it.

We got to Incheon International Airport at 1:10 AM (local time). We exited the plane and walked to Gate 21 which would take us to our next flight (only our next flight was 6 hours away). This was the perfect chance to catch up on some sleep. I slept maybe 2-3 hours on the flight. But in Incheon it was 1:10 PM (Toronto time) and I was wide awake. With so much time on our hands your instinct is to explore. There were phones, washrooms and closed shops at the airport, a free public internet hotspot and an information desk. Mom and I walked up and down this part of the airport once or twice saying hello to some of the people we met on the flight. With nothing else to do (and not sleepy at all) I got online to see how I could entertain myself. Logged into MSN Messenger and began conversations with Americo and then Martin. Americo was still at work (sucker!) but Martin Kim (is a guy whom I met at D-Link Networks a few years ago) was free. We kept in touch, he left for Seoul in 2007 looking for better work. Well, since I was in Seoul (technically Incheon) I decided to contact him. He was surprised to hear that I was in Seoul. It was like 3 AM at this point but 3AM wasn't so significant compared to the 2.5 years and thousands and thousands of miles between us.

I'm having an aside moment :) Litmus test. Friendship. It seemed like a perfect opportunity to get reacquainted, Martin and I. We jumped right in. He took off from his place in Seoul (I believe he said Non Hyeon) grabbed a taxi and travelled like 40 km to see me. Very cool. All I had to do was exit through immigration, fill out entering Korea form as well as a customs declaration form and then I was in the arrivals section of the airport waiting for Martin at McDonald's.

Anyway, Martin got to the aiport around 5 AM and we talked for a few hours. I was happy to see him. Martin, like myself is single with no attachments. So for him, as well as I, going out at 3 in the morning because a friend calls you up one day is an excellent way of getting to know someone and becoming reaquainted. I know, for me, I didn't feel quite so alone in Asia. We talked about work, women and life since D-Link. He's working for Alcatel-Lucent as a sales-engineer. It was great catching up. It was like old times. In fact, it didn't feel like time passed all that much (not that 2 years is a big deal). He was the same, I was the same, only the location has changed.

We talked til 7 AM and then I had to leave. I'm gonna try and fly back to Seoul during this trip. I know that Elaine and mom haven't expected this little turn of events but I feel that it would be personally an excellent option. A friday/saturday weekend would be ideal (for Martin as well as myself). We can hit some of the nightspots and see what Seoul has to offer. Martin says that I'm more interested in women than he remembers of me (we talked mostly geekspeak in Toronto). It's a part of our reality now. They change everything.

So mom, Elaine and I boarded KE603 bound for Hong Kong. 3 hours flight. We landed at 10:40 AM local time. I watched a movie on the flight that I didn't get a chance to finish. I'll have to download it when I get back to Toronto. It's called "The scam". A Korean film. We passed through immigration and then located our bags and met up with my uncle. My uncle drives an S500 Mercedes Benz. Boy was it smooth. We rode to Shatin (where my uncle, aunt and cousins live) and we got settled in my cousins flat. Had dimsum and then I had to crash. I was so tired. I really didn't sleep much on the flights and without sleeping at the stop-over I was a walking zombie. I slept for an hour or 2 and then got up for dinner with my uncle/aunt/cousin/mom/Elaine. Came back to the flat and crashed again. For most of Saturday it's been a blur.

Tuesday, August 25, 2009

My Benz 2



Here are more pictures (these came from the delearship).



I picked up the Benz on Tuesday August 11th. Finished work at 5 PM. And got myself to Union Station, bought me a ticket for Clarkson Station. and took the Go train to Mississauga. It was raining at the time and it appeared to be a bad day to pick up the car. I was surprised however that the rain quickly cleared and the sky turned blue by the time my buddy picked me up at Clarkson.

It was pretty simple buy (as I mentioned before). When I got there we had to settle the financials. I gave them the bank draft. They gave me another bill for the fines/plates/plate permit. I paid them using my Mastercard. Blah blah blah.

After finalizing the transaction I jumped in the car and I gingerly drove it out of the lot. I was trying to get comfortable but I had to get used to the idea that this was my car.

Sunday, August 9, 2009

My Benz

It hasn't hit me yet but I'm a new proud owner of a Mercedes Benz!

Ripped off images from the Internet. My rims look the same as these!

Funny, but it's my first true car. I've driven other cars in the past, see my previous post, but I've never chosen one with my own money.

The deal was struck yesterday afternoon. Americo and I went car shopping early in the morning of Saturday August 8th, 2009. This was really our 3rd time looking at cars. The first day we went to the closest dealer (in Etobicoke) and the following visit (July 25) I made an offer on a Volvo S40 2001. It was a clean car and attractive. The price was really right so it seemed like a no-brainer. Unfortunately it turned into a can-I-trust-you. Eventually I had to walk away.

Our second day out, Americo and I went to a dealer out in Mississauga. I compiled a list of C240 Mercedes Benz that I was considering and we decided to visit a few. We only got to one place. It was half way between Americo's work and my work. There wasn't really anytime after work to look at cars, but we tried. This time we met a friendly guy who showed us the showroom. All the cars were indoors. What a difference it was. There's such a wide variety of people in the automobile resale industry. You can meet some really classy gentlemen and some really slippery dealers. And the cars, unfortunately, really do reflect the salesperson.

Our third day (Aug 8) I bought a car. We visited like 5-6 dealers. 2 of them were ok, the others were pretty slick. It was a gut feeling (Americo felt the same way as I did) but I knew I wasn't going to buy anything from them. Basically, we went back to the dealer that I met on my second day and bought the car that they showed me. Weird but I almost walked away from it at the beginning. You see, I was under the impression that I was looking at a C240. But when we went back the second time we learned that the car was in fact a C230 Kompressor. Believing that I wasn't interested in the C230 I was ready to walk away. But this other sales guy (owner) suggested a test drive. I gave the C240 a test drive already (next door to this guy) so I knew how it handled. So I didn't think there was anything to gain from driving a smaller car (C240 has a 6 cyl. engine, C230 is a 4 cyl. with turbo).

What a difference! The C230 was just peppy. It wanted to run. And with Americo egging me on I put the pedal to the medal and it was fantastic. Hehehe, I was having so much fun. I never felt a car feel so strong, responsive and in control. The turbo engine made the car sound like a futuristic spacecraft with wonderful (easy) acceleration in the 2000 RPM to 6000 RPM range. Americo and I got the car to 150 KM/h on the entrance ramp to the 403. I loved driving the car. It was so much superior to the C240 that I quickly realized that I couldn't consider it (C240) any longer. My intention was to buy a cruiser ... but I didn't realize a cruiser could be so sluggish. Perhaps it was just the C240 that I drove. But it was like night and day. And since the C230 had the amenities that I wanted, i.e. sunroof, heated seats, cool rims, I thought that I would make an offer for the car. 5 minutes later we closed the deal.

Tuesday, July 28, 2009

Car shopping

Started shopping for a used car. We experienced some funky behaviour on our Toyota Camry 2 weeks back which prompted us to look around.



1. the windshield wiper fluid stopped spraying around the time that I came back from my mechanics around end of May.
2. light bulb on the driver side (front) stopped working (July 13) and started working again when I had it checked out (July 16).
3. I started the car to get it checked out (July 16) and the car started pumping out white smoke out of the muffler.

Because of these, my sister and I decided to begin looking for another car.

I started with the Automart. Located a sweet Volvo S40 2001 for a really good price. After further investigation and a visit to my mechanic I decided against buying the automobile.



It's really too bad because the car was beautiful. But there was enough reason NOT to purchase the car. And I learned alot from dealing with them. My only advise is trust your people. If your going to trust the advice from anyone, trust your people.

Car shopping (checklist)

1. Any liens on the car?
2. Any accidents (causing structural damage)?
3. Take the car to your mechanic.

If your paying in cash a good start for a price discount is to subtract the tax. It's a wise move (which I learned from my buying co-pilot). Standard costs that go into buying a used car are:

1. D.O.T. - $350
2. Admin fees - $150
3. Safety test (and repairs) - $300
4. Emission test - $50

These were the standard costs on top of the listed price for the car.

So I'm still in the market for a used car. My first choice was to buy a Mercedes. I've got over 10 years of driving experience and in that time I've driven a Chrysler Reliant (1985), Honda Civic (2003) and a Toyota Camry (1988). I want to try a luxury vehicle. My co-workers at work are telling me that I should go for the car of my dreams. It's the time. "In a few years you may be married with kids and that opportunity won't be coming back soon". It makes so much sense. When I found the Volvo (practically the first car I saw) I considered it a purchase in which my sister and I would share (since we'll be parking it at her place). It's a good thing it didn't work out because I'm not sure my sister would want it after I move out. So in that case I really should shop for myself. And the car that I've been wanting to buy is the Mercedes Benz.

Saturday, July 11, 2009

New York New York

I'm writing this 3 days after returning from New York. Getting back to my day-to-day means that I can't remember much of the experience any more. It's just not as vivid.

Let me start from the end and work my way back.

We left Long Island (near the Baldwin railroad station) around 10:25 AM. It was sunday and Americo just finished playing his Bronze medal game (the Ottawa Barbarians didn't make the Gold medal game because of the goals-for tie-breaker). After the game we were basically ready to go. We drove out of New York taking the I-385 north of Manhattan. There was a delay as a bridge was closed down due to a fire on Friday. Once we got onto the bridge that was available we were off to the races. It was a nice drive. We took I-81 through New Jersey and then back to New York state. We drove to Syracuse then near Rochester. We hit Buffalo on our way to the Lex bridge and discovered that the way at the bridge was 2 hours long. We decided to head back and go to Peace bridge instead.

The way back was pretty irritating. GPS is pretty cool when the girl knows where you want to go. But after we started backtracking she was just getting on my nerves telling me where to go. What's a guy to do when your GPS is giving you bad directions!? Jeesh.

We got to Peace bridge but before we got on we stopped to get some cheaper American gas and to switch drivers. Funny thing is when we got to Buffalo the clouds were hanging over the city like a plague. But driving through New York, and driving to Toronto (after Buffalo) was a pleasure. Strange I know.

Actually, driving to Toronto wasn't a pleasure. The sky was clear but the road was blocked. Stupid accidents along the QEW meant that our projected time of arrival for 8:53 PM turned into 10:26 PM.

Friday, July 10, 2009

Washington DC

I'm on my way to New York. My friend Americo asked if I'd like to join him. He's playing hockey at a tournament there. So we're driving.

We left around 10:10 AM on Thursday morning (had to rent the car and load it). It's been an easy drive so far. Blue skies, open road. Driving can get tedious. When I 16 years old, Americo and I couldn't wait to drive out to the States and see what we can find and do. The first time we went to down to the States we got turned back at the border because I didn't have official papers. Next time, I made sure I got my passport and a few months later we tried again. This time we were through and we crossed the border sometime in the morning. It was an interesting experience at the time (as you could imagine). We crossed Peace Bridge and then you were in downtown Buffalo. Downtown Buffalo isn't too pretty. So I remember we were eager not to spend too much time there, we didn't want to find any trouble. But that trip ended with us spending 2 hours at the border (coming back) as they took some time stripping down our car looking for drugs. It's funny in hindsight but at the time it was a little nervewracking. They interrogated us separately. We were guilty of trying to cross the border without declaring our purchases. Kids.

Old memories. We crossed the border easily yesterday. Followed Americo's GPS and we were driving along I-79 South route towards Pittsburgh. Somewhere before Pittsburgh I took over the driving and I drove the rest of the way. Poor Americo, I took a washroom pitstop, but Americo didn't need to go. I took over the driving at around 3:30 PM and I drove the next 4.5 hours. Americo was hurting by the time we got to Washington DC. :)

If you check out google maps you can see our route. We had a few missteps along the way. We had to get off the I-76 (exit 57) to get some gas but when we tried to get back onto the highway (trying to avoid the toll of the I-76) we found ourselves going westbound on the I-376 heading towards Pittsburgh! We lost maybe 30 minutes on this venture. It pushed back our projected time of arrival to 8:23 PM. Steadily we made the time back. We arrived in Washington DC at 7:53 PM. All-in-all it was a 9 hour drive plus the 1 hour for washroom, food and gas break.

From 8 PM onward it was a rush to take in the National Mall before it got dark. Americo preferred to stay with the car, so I jumped out and took in the sights. I walked toward the centre of the park, orienting myself to the pier of the Washington monument. The first thing I found was the White house christmas tree. It was undecorated (of course) with a plague containing a picture of President F.D. Roosevelt and his christmas tree. It situated the tree to the White house. So I turned around and there it was.



At this distance the impression is the same impression you would get from a postcard (or from television). The view wasn't so impressive as it was secure. We were separated from the building by a road way which cordons off the building from uninvited visitors. Surrounded by the national mall (with no vehicular access) means that security is high with visibility from all directions (from the vantage point of those protecting the site).

I took my few pictures and then I started off in the direction of the Lincoln memorial. Given that the White house and the Washington memorial makes up 2 of the triad I knew that the Lincoln memorial had to be to left of the White house. I walked to the west street and spoke to a southern gentleman who directed me to Constitution Ave. and a walk toward 22nd St. I jogged there.

Tuesday, June 30, 2009

Friendship

Want a friend, have a friend,
make a friend, buy a friend.
What's a friend worth these days?

Have you ever felt that you weren't doing friendship correctly?
I do. There's something about friendship I just don't get.

Why is it that I find no pleasure in friendship?

Saturday, June 27, 2009

Linux From Scratch

Last year I successfully built a Linux from scratch system by following the book. The date was April 24th and it took roughly 3 days to complete. I remember the process being relatively laborious. The system is only for those whom want to see how it all fits together.

I haven't touched it since then. Only off and on doing some research into boot disks, root disks, loopback devices, etc. What is interesting to me is the differences between ISOLINUX and my LFS system. I'm intrigued at how a LiveCD can give you roughly the same thing without the "installation" process as a normal distribution. Why install (30 minutes or so) when you can copy? Maybe it takes the same amount of time ... but anyway, it's for the learning experience.

From the grub command:

grub> root (hd0,3)
grub> kernel /boot/isolinux/linux root=iso:/dev/hda4:/root/lfslivecd-x86-6.3-r2160.iso rootfstype=ext2
grub> initrd /boot/isolinux/initramfs_data.cpio.gz
grub> boot

From this command the kernel is loaded into memory, the kernel mounts the initial RAM disk and finally the initial RAM disk performs a pivot root and mounts the ISO image as root and eventually provides you with a terminal. Fascinating. Generally my description is correct but there are gaps in my understanding.

Here is some of the information I've gathered from the process.

1. The second part of the kernel command (grub command), i.e. root=iso: ...
is passed to the kernel to load as a boot parameter. In other words after the kernel is loaded it will look to this boot parameter in which to mount the root filesystem.
2. But the initrd is loaded first as a preliminary root filesystem.
3. Somehow the kernel and the initrd work in tandem to know what to do with the boot parameter that I listed at #1.

How #3 happens I don't know. Reason being is that I've replaced the root=iso: ... part with a simple root filesystem on disk (instead of the ISO). It doesn't work.
Why? What is compiled in the linux kernel from the LFS disk that won't allow it to accept a regular uncompressed root filesystem on disk? What make an ISOLINUX unique from a regular compiled Linux kernel? What does the ISOLINUX kernel have to do with with the ISO9660 El Torito file system?

Maybe I just answered my own question. ISOLINUX kernel understands the El Torito (CD ROM) filesystem. So it knows how to mount the ISO image. Whereas a normal root filesystem is an EXT2 filesystem. In order for our generic ISOLINUX kernel to mount an EXT2 filesystem we would have to tell the init RAM disk how to install the kernel module in order to finally mount the root filesystem.

Once I figure out how to install modules from the init RAM disk environment I will be able to run a generic kernel from anywhere, everywhere I go.

The goal for me is to build a Linux Live USB. And not merely following the instructions provided by a website.

Monday, June 8, 2009

Home repair

I don't know anything about home repair. It's one of those things, that if your lucky, your dad will teach you. My father wasn't so lucky as he grew up in trying times, left home at an early age, and got lucky by making his way to Canada to start a new life.

Well my dad isn't really a handy guy. And neither am I. My father like my grandfather were both readers. Like father like son, I'm a reader too preferring theory over practice, concepts over tools.

On Victoria Day (May 18, 2009), my mom called me down to help outside on the walkway leading to my backyard. My mom and my neighbour have been talking about getting rid of a fence that separated our 2 yards. The fence was put up like 10 years ago. Since then the fence has been warped due to the build up of dirt/sand/gravel on my neighbours side placing alot of pressure on the fence. On Monday I helped remove the planks of the destroyed wooden fence into a van to be disposed of. Byron, a neighbourhood handyman, was hired to do the work. I helped lighten the load.

It was pretty cool. It wasn't just cleaning up the bits. They also wanted to repair the walkway leading to our backyard. I've laid paving stones at the tennis club before (a part-time job that I had throughout my high-school and University days), but I never witnessed destroying something so close to a building. The walkway was made of concrete not slabs of paving stones. It was 4 inches thick and it was almost a single piece. Byron bashed away at it for a good hour (on different sections of the walkway). It was fascinating watching him break it apart because as he was striking the concrete with his sledgehammer (5 lbs.) you could see the house shake!!
It gave me a feeling that my life wasn't really that secure and that one good blow could blow my house down (both literally and figuratively). I realized I need to learn some of these things.



The walkway was dug up from the foreground all the way to the recycle bin (background). It was really falling apart (the walkway) at the foot of this picture.

The backyard is full of piles of rubble.

It was a good time to clean up this mess. When I was a kid the side of our neighbours house (pink siding) was not there. Our neighbour was a Portuguese couple that kept a pigeon coop above a shed. We could hear the cooing of the pigeons every morning as they were being fed. We had a metal fence where pink siding sits now. On both sides of the walkway my mom used to grow vegetables like 冬瓜 and 葱. Our neighbourhood is a nice place to live (if you can afford it).
Posted by Den - 張恩華 at 6:48 PM

Friday, May 15, 2009

Setting up a Ubuntu mirror manually


Ok. So I've confirmed that my mirror works. So I'll describe the manual process of building your own mirror.

The simplest way to build your mirror is to follow the instructions provided by others (google: ubuntu mirror). The drawback is that you will need to download roughly 5.5 GB for the main repository alone (the multiverse universe is even bigger).

As I wrote earlier, I purchased the entire repository from a place called LinuxStore.ca.

1. Follow the instructions from http://www.howtoforge.com/local_debian_ubuntu_mirror to install apt-mirror and apache2.

2. Comment out all the entries in the /etc/apt/mirror.list file. Add a single entry like so (for easy testing):

deb http://closestmirror.ubuntu.com/ubuntu main jaunty

3. Run apt-mirror and break out when apt-mirror starts downloading packages.
Do a line count of the following files:

/var/spool/apt-mirror/var/NEW
/var/spool/apt-mirror/var/ALL
/var/spool/apt-mirror/var/MD5

The file NEW and the file ALL should have the same number of lines. (Which means apt-mirror would download all the files specified in NEW).

4. Copy the directory and all it's subdirectories and files (e.g. from the install CD):

cp -R /media/cdrom/pool/main /var/spool/apt-mirror/mirror \
/closestmirror.ubuntu.com/ubuntu/pool/

5. Run apt-mirror again and break again when it begins downloading. Check out the NEW and ALL files again. Notice that NEW should have fewer lines than ALL. This means that the mirror has accepted the files that you copied to your mirror. Which means that you will be able to update your mirror regularly (as designed by the creator of apt-mirror) as if it downloaded all the files from the internet.

6. Lastly, don't use the clean.sh script. I believe it builds a script which cleans up *everything* from your mirror. I thought it would clean up all the packages that is outdated. This is mistaken. The apt-mirror script makes a file size comparison between the file that exists in your mirror directory with an index file which it downloads from the external mirror. If they don't match then NEW gets updated with the name of the package to download.



And that's it. Pretty simple, huh?

Virtualization

I've been exploring virtualization technology for a year or so. At first I was interested in checking out Xen (since it was open source). But it appeared complicated and I didn't want to get involved in a compilation/setup cycle just yet. Recently, I've had the chance to actually try out a few products and here are some of my experiences with it.


I've tried VMware workstation in the past. It works well and it allows you to explore working with VMs on your own desktop. My problem with it is that when given a choice of working through a VM versus through the host you would choose the host naturally. I wanted a hypervisor (or a light-weight OS) which would not distract me from working with the VMs.


So I downloaded and tested different hypervisors available. XenServer and KVM. There is also VMvisor from VMware but I figured it was similar to XenServer. They are all basically the same.


XenServer and VMvisor are hypervisors which means they are light-weight OS managing and running on top of physical hardware. They provide the resources for running VMs on top of the hypervisor. I installed XenServer first. It was an easy installation on my workstation. After installation you have a curses interface to the OS.


But I didn't know how to create VMs. I searched for the documentation online (looks like good documentation) and I discovered that I have to use a client to access the VM manager to create VMs. So what I was losing in deciding to go with a hypervisor was the use of a desktop. The hypervisors are for servers or any headless system that will run the software. Losing the use of my new monitor wasn't part of the plan. So I decided to ditch XenServer.



I moved on to KVM. KVM stands for Kernel-based virtual machine. KVM was the chosen virtualization technology for Ubuntu. Xen technology was purchased by Citrix systems a while ago. Xen is still provided as open source but the enterprise product is requires a license. So I wondered why KVM for Ubuntu? The reason as provided by the KVM site is that the development effort was minimized because it utilized the Linux kernel. Why build a light-weight OS with scheduling of processes and workloads when there is an excellent open source OS available already? So what KVM does is it adds a module to the kernel to trap whenever the kernel encounters certain instructions. Oh yeah, KVM assumes you have virtualization capabilities provided by the CPU. So I tried it.



It took some time but I enjoyed playing with KVM. It's an interesting set-up. And the documentation is Ok. KVM by itself only allows you the capability of running VMs. But to run a VM you require some sort of emulator. So how this solution works is that you require either VMware player, Xen, or QEMU. In other words, KVM turns your Linux host into a hypervisor. The good thing is that you still have the desktop (GUI) where you can run VMs. The difficulty is that there are extra software layers involved that makes the solution less than simple. I.e. libvirt. Libvirt is a library which permits access to VMs. Libvirt isn't necessary of course. All it does is gives you a standard front-end to your VM solution. So KVM => Libvirt => emulator.

What's cool about Libvirt is that you manage the VMs via a shell console (virsh) or a gui console (virt-manager). Anyway, I enjoyed working through the solution.



I didn't settle on KVM (although I'd like to). It has alot going for it. Principally, it's open source and second it doesn't shield you from it's capabilities. The only drawback is it's complexity. It took a little time to get started. But the reason I went back to VMware workstation is the performance of QEMU. With non-Linux OSs QEMU just didn't perform very well. I installed Windows XP and Solaris 10 using QEMU and it was slow. Very slow. Plus the fact that converting a QEMU created VM (i.e. qcow2 format to vmdx format) didn't necesarily mean that I could take it to a VMware player and play it back. I could have tried KQEMU but it was another level of complexity that was eating up more of my time. So I'm back to using VMware.



Long story short, I would prefer to use KVM/libvirt/QEMU if QEMU performed better out-of-the-box. I would also prefer to have a document which described the architecture of the solution to ease new users into using these technologies. Finally, based on some of the documentation I researched, it opens up clustering and cloud computing which I'm also interested in exploring. So it has alot of interesting technologies going for it. But for my current purposes it's complicated to setup and maintain. I hoped to use both KVM and VMware at the same time but it's not possible as both KVM/VMware add a module to the kernel to run virtualization. So they are mutually exclusive.

Wednesday, May 13, 2009

Ubuntu Mirror

Working with Ubuntu exclusively on my workstation now since April 24th (Jaunty release). I've also been exploring virtualization technology as well. I gave XenServer, KVM a try. Settled on VMware only because the files were portable (so I can take it to work). I'll write about the different products another time.

My intent was to create a VM so that I can run some genealogy software. The VM for the obvious reason of backing it up easily. Funny thing is that after installing Ubuntu (a few times) it appeared to me that Ubuntu *required* a connection to the Internet to install. I found out after some experimentation that this isn't the case. Anyway, I wanted to set up a mirror so that I didn't need to do this. However, I didn't want to set up a mirror by downloading the entire Ubuntu repository (22+ GB).

So I experimented with apt-mirror and here are some of my results.

- I purchased the entire Ubuntu repository from a store called LinuxStore.ca (LinuxStore.org.uk).
- So instead of downloading the mirror I wanted to copy it from my set of DVDs
- I followed the instructions in setting up apt-mirror
- Instead of pointing mirror.list to a mirror like http://ca.archive.ubuntu.com/ubuntu I followed an instruction to add the line: deb file:/media/cdrom/ubuntu jaunty main
- This didn't work so I read the /usr/bin/apt-mirror perl script
- Problem with the script is that it strips "http://" from the mirror name and creates a folder under /var/spool/apt-mirror/skel/. Since my URL = file:/media/cdrom/ubuntu this just didn't work.
- So what I ended up doing was keeping a single entry in the mirror.list file and mirroring that (i.e. jaunty-security main - 66 MB).
- I then confirmed the file structure and copied the pattern for the rest of the files
- I then confirmed file structure of the locally (DVD) retrieved files by confirming that apt-mirror when executed would update the packages
- Therefore I know that copying universe and multiverse components (from the DVD) of the repository will work correctly

Quick summary

- If I could do this again I would not buy the entire repository. Downloading "main" and "restricted" is good enough.
- Creating a mirror isn't necessary. You can point any VM sources.list file to a local directory or a NFS mounted file system or a DVD mounted iso and apt-get will retrieve the files.

Ubuntu Install

/dists/jaunty/binary-i386/main/Release.gz contains the list of packages for the component (i.e. main)
/pool/main/a
/pool/main/b ... etc.
contains all the packages.
Running apt-mirror for a different component, eg. main, will check the most recently available packages from the repository and update your mirror. So this is the benefit of using apt-mirror.

Question: Is the archive of apt-mirror the same as an archive stored at /var/cache/apt/archive ?
When running Update Manager it saves the updated packages to /var/cache/apt/archive .

Sunday, May 10, 2009

Chinese computing

I've been learning Mandarin Chinese for 2 years now. I've been attending a Mandarin language school with Tzu Chi http://en.tzuchi.ca/canada/home.nsf/home/index . My teacher is 傅老師 (Teacher Fu) and we've been learning from a book named 五百字說華語 (Speak Mandarin in Five Hundred Words).

Problem: I recently installed Ubuntu Linux on my computer at home. I figured out how to install and use the Chinese input method offered in the Windows OS. I used the Windows New Phonetic 2002a code table for input because it allowed me to use pinyin for input and obtain traditional chinese characters for output. Ubuntu has a input method (IM) framework so that you can add multiple language input methods and create your own easily. It's called SCIM (Smart Common Input Method). Unfortunately it has multiple input methods but not one suited for me. It does have Pinyin but it produces simplified characters. Not being able to find the one I wanted I went online to read about all of them. I found that 五筆字型 (wu bi zi xing) was the coolest. It's difficult that's for sure but it's also efficient when you've acquired the skill and the memory for the character strokes. Since the system is built around how the characters are written with a brush it means that I kill 2 birds with one stroke (if you will). I can learn characters, character strokes and an input method all at once. And when I finally build up the repertoire of characters I won't be (necessarily) defficient in any particular area (that is the hope anyway).

It was a problem at first. Because 五筆字型 produces simplified characters. Further research indicated that there are more than one wubi method. wubi86 supported the GB86 character set. There was an update called GBK which included traditional characters as well. However, GBK wasn't very popular and it was because GBK wasn't backward compatible with wubi86. And so wubi 2000 provided support for GB 18030-2000 which was backward compatible with GB86 but also contained traditional characters. I was looking for a wubi code table which supported GB 18030-2000. I couldn't find it.

Lucky for me, after starting this entry for my blog I discovered a method for looking up input codes for various chinese characters (until I actually know some of these codes) and I discovered that the wubi input in Linux does have traditional characters contained in the table. So that the character 謝 (traditional) and 谢 (simplified) both have the same wubi code "ytmf". So I'm not limited to a particular character set after choosing a specific input method.

My next step is to begin cataloguing the characters I've learned from my chinese textbook and inputting them into a table for quicker lookup. I'm also contemplating how to produce a database to store the various methods of locating characters.
There are various systems available for looking up characters. Radicals, pinyin, ... I will probably begin cataloguing these methods to get a better picture of how to go about searching.

More later.

Sunday, March 22, 2009

Computer graphics, Intro

I started a business after coming back from Hong Kong last year. It's called FriendlyComputers and we have a website at FriendlyComputers.ca. I started it with a friend of mine (Ted) in July 2008 and we hoped to have an online presence at least by October/November. The business is to sell computer products and services online. The goal is to create enough clientele that by the time we had sufficient funds (and a feasible business supply/demand) then we would move the business to a physical location (preferably in the Mississauga/Etobicoke area).





Unfortunately our plans didn't come to fruition. We've experienced delays and my personal apathy for creating more work for myself. However in the back of my mind the work was there (the seed was there, it just needed to be watered). Well, Ted did his part. The proof is in the current site. We intended to build a flyer and begin manual advertising (pamplets, etc.). That was my job. But I struggled with it. Reason being is that I wasn't comfortable with the tools for creating/designing pamplets, etc. Or I'm just lazy. But I honestly feel that drawing with a mouse is just wrong. So long story short, I bought a Tablet PC recently (Mar 19, 2009).





I picked up a IBM/Lenovo X41 Tablet. It's got a Pentium M Centrino 1.5 GHz processor, 1.56 GB of RAM, 60 GB Hard drive, Intel GMA 905 graphics. I love it already. Keyboard is excellent. Writing, via the stylus, is fun but more importantly it's natural. The stylus is a natural aparatus to use to create images. Even better would be my finger but a stylus is the next best thing. Someday, with the new multi-touch technology coming out on new tablets, one day I'll be able to use my finger.





Which leads me to the topic of the day. Computer graphics. I find this field funny because the reading material for it is so disparate that it's hard for me to find my way around. Eg. Computer graphics in universities start from math. We learn algebra and geometry and talk about vostroms and translation, etc. That's all fine. Another eg. Image processing. An image in essence can be nothing more than an array of pixels or a description of a vector path. However, the primary tools to manipulate images is Adobe Photoshop and vectors with Adobe Illustrator. The problem I find is that there is a gap between the theory and the practice. So theoretically I can learn Computer graphics in school and then take it to a Game design shop or a 3D graphics design shop. No problem there. But if I want to learn about theory about image processing what we get is alot of math or click here and click there as in Photoshop/Illustrator classes/online tutorials, etc. In other words, there isn't a decent theoretical treatment to the workflow and tools available for the image processing applications, i.e. Photoshop/Illustrator.





So I'd like to write my own. Some of my goals are as follows. I'd like to create images/scenes from photographs captured from a digital camera. Since capturing an image is easier than creating images from scratch I think it would be good to have an efficient workflow to design images. I want to convert these raster images (from the camera) into vector images. I've learned that Illustrator (CS2) contains a trace function which will build vectors images from raster images. And then through editing, storing, retrieving objects I learn the fine art of designing images. So whereas a course in Photoshop/Illustrator for instance would start the same way that the tutorial books would, i.e. here is the workspace, canvas, tools, colour, etc., I want to start documenting from a theoretical standpoint. Eg. Graphics programming with Perl describes it from a logical point of view (from a programmer's point of view). And image is a canvas. A canvas can be made up of one or more canvas. A primitive is a point. Elements are polygons, circles, squares, curves. By building it up this way it's easier to grasp that a layer (in Photoshop speak) is nothing more than a canvas. A point/handle is an anchor. A filter should be a function over a 2d object. All primitives are objects. A layer is an object. So as you can see by my description, when we use a filter or a channel I will know what it means (from a logical point of view).

More later.