Sunday, April 30, 2006

Squid Caching

I've finally set up squid caching on my server. After trying to set it up for my dialup connection five years ago and failing miserably I pretty much put squid to the wayside. I've never considered myself paranoid enough to want to tunnel all my traffic over a secure connection but living in a house with curious networking/security geeks makes me a bit nervous so I set up squid on Right now its not opimized to do anything special aside from do some basic adblocking and to get it that way was amazingly simple especially compared to when I last tried setting squid up so long ago.

  1. (on server) apt-get install squid
  2. (on client) ssh -L 8888:localhost 3128
  3. Works now. The end!
  4. Adblocking (optional! but recommended)
    1. add to crontab
      10 * * * * wget -O /etc/squid/adservers ''
    2. edit /etc/squid/squid.conf to do some adblocking:
      acl ads dstdom_regex -i "/etc/squid.adservers"
      http_access deny ads
  5. All done!

Saturday, April 29, 2006

How to speak Mandarin.

This title was a bit suspicious. I don't speak Mandrin so this is not going to help you any and it seems that my time here in Taiwan hasn't helped much either. You would think after 60 days here that I would be able to do more than simply count to ten, say Thank you and say hello.

I really need to stop slacking on this. I've been learning a bit more this past week, and I've even attempted to communicate once or twice with my ultra limited vocabulary.

Today I found online a free chinese dictionary I could download. Now I have a good reason to learn python + Hildon + gtk. This way I'll be able to have a dictionary right at my fingertips at all times. The use of a Nokia 770 is endless!!

Thursday, April 27, 2006

All I got was this stupid T-Shirt

I flew to Hong Kong today to fulfil my VISA requirements. Because we were having some difficulty getting semi-perminent work visas for us we instead recieved 30 day visitor VISAs. When you are staying longer than that this limitation poses a problem. I along with two others have been making monthly trips outside of Taiwan in order to reset the clocks on our 30 day visitor VISAs. (Fixed now, this is my last trip for VISA purposes.) Today was my send 30th day in Taiwan so it was time for me to leave.

I woke up this morning and packed for the trip. Made sure the eseentials were in my bag. (laptop, passport, power cables) and took off to work. When the work day had nearly ended I took a taxi from Taipei to the airport, borded a plane and promptly took off. The flight to Hong Kong was only an hour and fifteen minutes so no bother really.

When we landed I sprinted to the China Airlines service desk and quickly explained my situation: I have to get my passport stamped so that I can return to Taiwan. Normally, I think, people do this with a stayover in Hong Kong: A day or more. I on the other hand had a flight to catch in 45 minutes. After some confusion, and LOTS of running. (Up the terminal and back down) I hopped on the same plane and made my way back.

/I/ went to Hong Kong and I didn't even get a stupid T-Shirt.

On this topic, if things like this can be so easily circumvented, and so often are (there were at least 5 other people doing the same thing I was), why even make it a consideration? Is it to support some sort of airline economy? To harass people and be able to laugh at them from behind security monitors? Even in a government as new as Taiwan's the system it seems is plagued with those off-kilter practices and rules that we see so often in the States. I think we should all just give up this restricted travel thing and just open up all the borders.

Wednesday, April 26, 2006

How to attend a show in Taiwan.

  1. Notice a large crowd, at least 1000 people standing in a line waiting to enter a building. Hear the loud noise eminating from inside.
  2. Approach said commotion with curiousity and confusion.
  3. Find yourself in the VIP section of the show, drink free beer.
  4. Take good pictures.

As Saturday evening was ending early due to an exiting Friday night and Andy, Ray, Maarten and myself were heading to our car near Taipei 101. Despite our lack of energy when we heard the loud bassline eminating from a building nearby we approached. In front of us were at least 1000 people in line trying to get into what seemed to be a big concert.

Being confused Americans we approached the event trying to figure out more. It turns out that the famous MC Hotdog was playing a show. There was no way to get inside to check it out . . . or was there?

We stood around outside for a few minutes trying to figure out what we could do to get in and came up with a solid plan: Look confused and try and go in the front door.

That didn't work.

We stood there a few more minutes and as we were about to leave one of the prettiest girls I've ever seen in Taiwan asked us if we wanted to get into the show. Stunned we all stammered a resounding "yes." She grabbed Andy by the wrist, I followed and we were in the front doors. The bounces though rejected Ray and Maarten. That would simply not do.

We stood inside for a minute and tried to figure out a way to get them back in. We couldn't just leave them there so we decided to leave, and see if we could get wristbands to get back inside. When we went to the banding booth, Ray and Maaren came up from behind the attendant and we told the attendant that they were with us and had just exited the show too. As a result, they needed bands too. The four of us, now equipted with bands walked up the the first door we tried to enter. After waiting a few minutes we were admited into a swarm of people; Asians as far as the eye could see! We were now inside the show, it was nice, but well with the luck we'd already been having it was time to infiltrate the VIP area.

Again we huddled, again we made a daring plan. Andy would squeeze between the barrier's bars and would try to pull us into the vip area via the door trying the oh so typical "they're with me approach."

Andy didn't fit. New plan. Break in. Rip the barier apart and enter. I first scouted the area looking for a set of weak links in the barrier and upon finding one I queued the guys to follow me.

The gates being well stuck together budged but not enough in my first attempts. It was the person standing to my left that was causing the lack of movement. I tapped him on the shoulder and did my best to communicate using grunts, hand gestures and eye movement. Luckily the guy understood dumb american speak and knew what I meant.

Lift, pull, sneak. . . FREEDOM!

We were in and security was fast approaching. Luckily we had evaded detection and although there was a guard standing there until the end of the night, we were in the VIP area at a show that until 30 minutes prior didn't even know existed. Girls were dancing on bars, people were dancing and there was free beer.

Not bad for a band of Crazy HWOps-Ren walking around Taipei.

Pictures coming soon!

Thursday, April 20, 2006

Net Access!

I didn't know it but iPass supports hinet! It just takes a bit of guessing to know where to login.

At the airport

Using wireless

Free for me. HOT

Wednesday, April 19, 2006

Tuesday, April 18, 2006

Sunday, April 16, 2006

How to do text and XML parsing with Python

Parsing Wikipedia is going to take two steps. The first of which is parsing the XML for the wikipedia datadump.

In python, as is in most other langauges, there are two approaches. The first, DOM is typically characterized as an object model for access where you parse the document, and the result is an object that contains other objects representing onodes in the XML structure. You must be able to parse the entirety of the XML tree and store it in memory. When you have a 5GB xml document this becomes rather impossible. The second approach, consists of handlers that are called upon reaching a particular node, attribute or property of the xml document. The benefit to this method is that you don't have to store the entirety of the document in memory, making this process ideal for text parsing on the wikipedia scale.

In order to process the amount of data found inside wikipedia, I'm trying to follow the MapReduce approach to data processing. In a nutshell, you pass a Map function some data and it yields a set of key value pairs. Then you Reduce the key/value pairs into a smaller subset of data and return a composite value for each of the keys you generate. A good example is finding student grade averages. You take a series of scores from a series of students to compute the average like this:

John, 67,
Sally, 50,
Jim, 88,
Jim, 9,
John, 86,
Mike, 63,
Mike, 61,
Joe, 100,
Mike, 11,
John, 31,
Sally, 64,
Sally, 83,
Joe, 15,
Jim, 96,
Jim, 4,
Jim, 15,
Mike, 41,
John, 18,
Sally, 33,
Jim, 77,
Mike, 27,
Sally, 27,
Sally, 86,
Joe, 36,

In the map phase you create a series of key/values where the key is the student's name, and the value is the grade. So the map could produce a series of keys like this for each student.

('Joe', 57)
('Joe', 23)
('Joe', 58)
('Joe', 67)
('Joe', 0)
('Joe', 93)
('Joe', 33)
('Joe', 55)
('Joe', 39)
('Joe', 16)
('Joe', 57)

Then lastly, in the Reduce phase, you aggregate the data such that you get one value, in this example, the grades of each student.

In [23]: sum(fs)/len(fs)
Out[23]: 56


So in applying this idea to wikipedia, the source data is the entire Wikipedia XML doc. The key/value pairs emitted by the first map would be ID to article content mappings, the reduction would would the number of links inside the document. . . . something like that.

This is a new concept to me, so I dont' quite know exactly what I'm going to do.

Tuesday, April 11, 2006


I've added a number of things to my website. As you can see on the right hand column, there is a variety of little modules to let you know a bit more about my current state.

The first module is "Looky," which should be the newest image added to my blog from my cell phone camera. Everybody is doing it, I had to too.

The second thing you'll see is Music, if I've been listening to music at all recently, these are the songs I've heard. If you see a little speaker icon next to the song, you can probably listen to it if you click on it.

The third, reading, is a list of blog entries that I'm currently or just about to read, or that I'm keeping a list of for future reference. Click on an entry to read what I'm reading.

Fourth, Location is a not-live Google Map pinpointing my exact location on the globe. Clicking on it will take you to a page with at the moment, simply a bigger version of that map. It will contain cooler things in the near future.

Last, I have a Links module. These are blog entries I've tagged as something you might be interested in looking at that I have run across already.

Friday, April 7, 2006

Coming to a state near you.

After successfully traveling to three different countries and eating more great food than I could have imagined, I will be returning to Chicago for a limited engagement, May 20th through the 28th whereupon I will be traveling back to the other side of the globe for another three month stay in Taiwan. See everyone real soon! This film has been rated NP, Not appropriate for pirates, only ninjas.

Thursday, April 6, 2006

Sunday - Tsujuki

I awoke refreshed Sunday morning hungry for some Sushi. Following the suggestion of wikitravel, I made my way to Tsujuki. It probably wasn't the best day for me to go there; afterall the Fish market is closed on Sunday; thus the best sushi places were closed. Nevertheless my trip to this region of Tokyo was not disappointing.

I think that this palette was trying to say something about NZ.

After emerging from the subway I turned left; there was a sign which told me the Hama-rikyu Gardens. A long time ago, this was the personal gardens of 17th Century shoguns, sitting right near Tokyo Bay. This garden, like the shrine in Harijuku was quite an interesting contrast of modern versus historic. As you cross a bridge to enter the gardens skyscrapers stand tall over the tree line.

Even inside the garden, you see the buildings peaking from every angle.

But even with the surrounding modern buildings, the first part of the garden was serene and the 400 year old pine tree I saw was quite a competetor for the area's-coolest-big-thing award.

I would suggest going to this garden when its a little closer to summer, I could only imagine the beauty that this big field would have with the right amount of sun.

If you didn't already know, I like buildings. I can appreciate a cool bridge when I see one, in this part there were a few. One of which was the Tokyo Bay bridge:

But, if you turned around, there was another pedestrian bridge crossing the little salt water pond that flowed through parts of the garden.

The destination of one bridge was a little teahouse, where you could pay a small fee and get a cup of tea and a small piece of a cake or something. Still excited over the prospect of sushi and fearing making a fool of myself by not knowing proper ettiquite, I skipped this event.


Sometimes, when you looked at the right place, the modern world just disappeared.

I found this site interesting, it is a "Duck Mound," a shrine to show respect for all the souls of dead ducks, lost in the creation and subsequent use of the gardens. If you turn around though, you'll see the duck hunting field. Quite Ironic.

It was time to leave at this point, having seen most of what was avaiable in the gardens.

I left the garden and began walking. 45 minutes, I found Sushi:

It was heaven. I was pleased. Afterwards I did more walking around, stopping in a store for some shopping. (Some of you are getting gifts from there) I also walked past this building it looked old, and pretty cool so I took a picture. There was another guy trying to take a photo too. He also almost got hit by a car.

Shortly after this picture was taken I was assaulted by a 12 foot talk blue and white inflateable beer can. I did not get a picture of the perpetrator, I was simply too stunned to think about it. Needless to say, it was quite windy.

Some people will celebrate St. Pat's day even in Tokyo.

And some people will dress in wierd costumes and stand on the street corner.

And other people will dance to some happenin rockabilly:

I watched the rockers for a little bit, it was quite a trip and probably the highlight of my day. I continued to walk around the park that was near by and saw a number of street performers. Some were good, some were bad. One I even bought a cd from: the band had horns, I'm a sucker for the brass. I also saw a band of teenagers covering the Rolling Stones. The lead singer was doing a good Mic Jagger imitation and they didn't sound half bad. There was also a young girls dancing troupe. It kind of reminded me of the scene from Donnie Darko where his younger sister peforms a dance to a Pet Shop Boys hit.

There was also a crazy man spinning CDs on a portable turntable and doing paitings while dancing a little bit. Fun to watch.

It was pretty windy and kind of cold at this point, I bet if I went there with nicer weather the place would have been packed! On the way back out of the park, there was a fight! It looked like one of the rockabilly folk got into a tusle with a man wearing a cape and a tiger mask. No, i'm not kidding. A man with giant hair attacked a man wearing a tiger mask in the middle of a downtown park in city of 12 million people. A FONZ LOOKALIKE ATTACKED A MAN IN A CAPE. weird.

After this fiasco, it was time to do some shopping. I wanted to buy a hat. I started wandering and found myself in a sea of people, including spiderman.

I walked and walked and found a hat. I bought the hat, and I am glad I have th ehat. But this didn't stop me from going back to the hotel for a spell before heading out to Odaiba.

Disappointing to say, but my Sunday evening ended on a not so exciting note. Odaiaba was neat looking, but was void of people. It was pretty chilly, and VERY windy so I can understand why. I did get a picture of the statue of liberty though.

Wednesday, April 5, 2006

Leaving AIM

Most of you have gmail accounts. Not a ton of you use GTalk. By the end of the summer, one month after I return I will log on to AIM/MSN/ICQ for the last time. After this, if you care to talk to me, please log into gmail/gtalk/jabber and talk to me there. As it stands now, I'm usually online via my work jabber account (aka the same as my usual gmail account name.) more than any other account anyways, this just makes it official.

Tuesday, April 4, 2006

Taiwan Lug

Andy and I went to a linux user group meeting near Taiwan National University, partly to recruit, but mostly to meet fellow open source enthusiasts. When we arrived we were warmly welcomed and there were indeed a good number (15?) of people already there; including one Yahoo!. It was awkward at times being a bit of the center of attention but nevertheless quite fun.

I plan on going back next week, this time with more people from work. Good times!

Mobile Post

Saturday, April 1, 2006


So after a brief stop in my hotel room, I headed a few blocks to Shibuya here it was kind of a non-event. I walked around a bunch, crossed the worlds busiest intersecition a few times,

Got a bite to eat

Then made my way back to the hotel