Friday, June 18, 2010

New job, new things to learn.. gotta get in line..

It's been 3 weeks since I've started my new job at a big corporation. Transition into this new job was not easy and even now there is still a lot of pain of adapting. The biggest source of the pain? WINDOWS!!! T.T

Being a big corp, it's almost a requirement that your reliance on all things microsoft has to be solid and deep rooted. Of course we have open source equivalent for most of the stuff but the pressure is on for me to perform and to present some tangible results as soon as possible thus I barely had time to put some basic best practices in place. But finally after 2 days of googling and tweaking, I've got a small pc running ubuntu server serving trac for ticketing and serving out our main mercurial repo. We don't even have the basic infra yet and still management says "these are things are nice to have, but you need to deliver those reports soon. Our deadline was last month".

Then when starting to do development, I start to see how deep the rabbit hole goes. Never mind about the ton of spaghetti code we have to tangle with, database management (this is just our internal development database mind you) consist of importing excel file into access and using odbc to push those tables to ms sql server. Ha. Seamless I tell you.. >.<

So of course there is nothing in the open source world that can match that kind of right click send seamlessness. So for now I concede I have to use windows. At least until most of our database stuff is fully in the ms sql server and I can connect to that directly. But the pain of working in windows.. oh my.. Even looking for text in all the source code is not as easy as 'grep -ir something'. I think I miss grep the most. But of course I miss all the rest of our little treasure trove of command line tools to make dev so much easier. How I wish I had a 'tail -f' in one window of terminator while I restart the server and redo the query in another.

But I'm already here now and I should square my shoulders and get in line.

Some interesting thing I've learned already is how to set the default gateway for windows for example. You just do a:

route change 0.0.0.0 mask 0.0.0.0

That is to change the default gateway if it already exists. Want to know whether it already exists? Print it out:

route print


And also for setting up tomcat6 cgi, edit the conf/web.xml file in the tomcat root directory. Inside there you would see already commented out parts for cgi config. Just remove tags from 2 parts:

<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<init-param>
<param-name>passShellEnvironment</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>5</load-on-startup>
</servlet>


*note - you should add the passShellEnvironment part to allow the cgi to use perl and stuff.
And from:

<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping&gt


And then you have to change the conf/context.xml file to enabled privileged like this:

<Context privileged="true">


Once that is done you've got it made baby.. you can now download strawberry perl and awstats and have awstats even for a tomcat6 server. Follow the instructions here for more details: http://www.wrenbeck.com/flowbuilder/$$download.xsp/blog/3eab0461f928f/awstats_tomcat.html

Just one more note on changes to tomcat to enable awstats. You need to enable the combined log for it to work. For that edit the file conf/server.xml and at the end of the file you might find something like this:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="combined" resolveHosts="false"/>


Release it from it's remarked prison and change the pattern from "common" to "combined".

Learned quite a lot these past few weeks so I guess that's very good. Still have to use windows so that's pretty bad. But plus minus it all, it's still pretty good.

Sunday, June 6, 2010

Unforgettable holiday

Just came back from having a holiday with the family at Lumut. It was quite an ad-hoc decision to follow my parents to Lumut on the family day of their respective companies. So they have already left for Lumut since last friday evening, we didn't even start to get ready till saturday morning. By around 11 am we were already on our way. Looking it up on google maps, estimated time of 3 hours 23 minutes means we should arrive there just about a little bit late for lunch. That was our initial hopes.

Once we were on the road, we didn't exactly know which way to go. And even though I've looked it up more the less on google maps before, I didn't bother much about it because I thought my brother knew the way. Well, we were supposed to get off the highway at Bidor. We didn't realize that till we called our father a little after we just passed the Tapah exit. So we had little choice but to exit at Gopeng. And we got lost more within the maze of village roads and mark less landscape. Finally we arrived at Lumut around 5 pm. That's a good 6 hours, twice the estimated time for us to arrive.

We reached Lumut, exhausted and hungry. We ate a road side stall and they charged us quite outrageously I think. Finally we went to Teluk Batik, and we were even more disappointed by the humongous crowd there. I guess it is the weekend crowd, compounded with the school holiday crowd, compounded with even there was going to be a karaoke contest later that night crowd which we heard of at the stall we ate before. Even to get into the washroom was a long queue of at least 20-30 people OUTSIDE of the washroom building, never mind about the people still doing the 'washing'. But at least my kids got a nice ride at the battery cars & bike. RM 2 per ride. Seeing their happy faces after such a long day was such a great relief.

That night went to eat dinner, I don't even remember the name of the restaurant now. The food wasn't all that great. It tasted ok, but nothing to write home about. And the lights... Oh the lights.. Just while we were eating the whole restaurant (we'll, actually it was just a bigger road side stall) just went out. The whole place turned completely dark. Not once, not twice, but three times... By the third time we were done eating and decided not to spend any more time there.

Then the next day (today), I started to have a very sore throat. Actually it was already quite sore on saturday morning and I feel I was going to be unwell. And I guess compounded with all the stress of travel and all, by this morning it hurts for me to even swallow my own saliva. The pain almost makes me squirm. Eating breakfast was not a very pleasant experience. It was the usual nasi lemak buffet and the rendang ayam was quite nice, but the pain of swallowing stopped me from even thinking about taking seconds.

Then we went to the beach. Finally there wasn't too much people there. There was still a lot, but not as if you were in a mall on sale. And I finally had my first experience riding the banana boat. That's basically a long float where around 7-8 of us sit on and pulled by a speed boat. The speed boat would make a quick turn in the deeper waters which would make us all tumble over into the water. It was quite exciting. But then faced the unsurmountable problem of getting back on the float with a body as heavy as mine. Trying hard to pull myself on it, I nearly gave up. Good thing my brothers were able to pull me up. By the time we got back on, I just wanted to go back already. Was so exhausted. After a bit more playing in the water and the sands, we went back, cleaned up, checked out. Went to Lumut to have lunch and again I think the price was pretty outrageous.

Then we started to head back. Again, I didn't really know the way. And forgetting that I didn't know the way, we stayed back to buy some stuff at the Lumut Bazaar and didn't follow my father back. And so out of my ignorance, rather than heading to Teluk Intan where we would finally go back on the highway at Bidor, I went towards Klang. Oh my God. What a trip that was. I realized we probably made a mistake an hour or so later when there was still no sign of highway at all. And we ended up going through Sabak Bernam. And B44, Jalan Sungai Panjang, was one heck of a unmaintained road. It was like riding a speed boat on land. I had to drive slowly so as not to be thrown right off the road. It was painfully long and tedious to get through. By the end of it my nerves was really frizzled out already. Finally we went out onto the highway again somewhere at Behrang if I'm not mistaken. Felt so good to finally be on a road that you're sure off. Now finally the vacation is over and tomorrow is another day of work. I think I'm more tired now than before. This is certainly a vacation I won't soon forget.

Is Blogging No Longer a Thing?

As I embark on my new journey to learn the Rust programming language, I find myself pondering—where have all the blogs gone? In search of pr...