New technology, new workflow and trying out a self-sustain system that fully automated without me need to do anything -- well except fix bug. Bug #1: Manual intervention.
March 17, 2010
New technology, new workflow and trying out a self-sustain system that fully automated without me need to do anything -- well except fix bug. Bug #1: Manual intervention.
March 16, 2010
$ unset DISPLAY
$ soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard
The system was meant to capture the answers of a questionnaire and calculate the score they got. Then display back the past scores. It's pretty small involving just CRUD and a small amount of business logic to calculate the scores. Could probably be done in a bit over an hour if using tools I'm already familiar with like CakePHP or Django. But with Java, it was a completely different story.
My experience with CakePHP when developing MyMeeting made me quite reluctant to ever not use a framework ever again. Unless it's just a small trial program to understand a new language, it's better to use a framework. In the framework usually there is already quite a lot of thought put into how things should be organised and what's the best way to achieve our goals. So you get the benefit of quite a lot of wisdom without having to go through acquiring it. So that was the first thing I did. I googled for a 'java framework' and BOOM. Despair. There was tons of them. So many I had no idea what to choose. So I started to search for reviews and comparisons. You basically can't read about Java framework without struts being mentioned. Tapestry was pretty popular too. But they all seemed to have quite a high learning curve and you read a lot about the DREAD of configuring xml files and all. Finally I tumbled on wicket. Reading reviews and presentations about it got me pretty excited. And when I started developing I realised this framework is just for the UI. It made it pretty easy to do quite ajaxy stuff, but there's nothing about database connection and stuff. And there was no tutorial on how to get CRUD even. So after more googling I finally found Databinder. It is basically using Wicket as UI framework and either Hibernate, ActiveObjects or Cayenne for the database abstraction and interaction. Alhamdullillah. With plenty of examples to copy and paste from (hey, I didn't have a lot of time okeh.. :P) , I was finally able to get simple CRUD working.
Of course by then I met with a lot of the things which made programming in Java a pain. The dependencies, all the declaration, putting in setters and getters for almost every variable. UGH!!!! But in the examples they showed how to set up your project to easily work in Eclipse. And I followed it. And now I understand why Java developers swear by their Eclipse IDE. It's way freaking cool. I mean want to put in all the setters and getters for every variable even though you've got around 50 of them? Forget about typing it, how about just right clicking on the file and choose 'source->generate getters and setters' and it will all be done for you. How cool is that? What's it? You just copied from one file to another a bunch of lines which declared types you've got to import? No problem. Eclipse will automatically copy the imports too if it's already resolved. It's way seriously cool. If only it had vim keybinding.. :P
Anyhow. That took most of my weekends recently but it was very well worth it. I'm not 100% comfortable with it yet, but at least now I can do dev in Java. And if someone was to read my resume and ask me do I know Java I won't have to answer 'Well.. I did a few assignments with it when I was a student'... :P So now the only languages I'd really really like to have a serious go at it is ruby (probably with Rails) and Lisp. Maybe the opportunity would present itself in the future. In the mean time, I still got to polish my Java-fu.
Most of us now work with relatively large amounts of data, whether it be media or data. I've been on a Gigabit Ethernet switch now for a few years, because transferring data or virtual machine images of several gigabytes over the network is painfully slow at 100Mb/s (12.5MB/s max). If you see this limit when transferring files with GigE equipment and Cat5e/6 cables, chances are auto-negotiation is setting a conservative limit.
One usually thinks of wired connections as relatively plug and play, and that's true for the most part. Unfortunately, I found out recently, that at least on my Ubuntu Linux workstation, with cheap networking equipment such the RealTeks, the Lantecs and what not that you have at home, the defaults may set your media speed to 100Mb/s (Fast Ethernet) and not 1000Mb/s (Gigabit Ethernet).
These days you do not need to look at blinking lights to see if stuff is connected (usually).
Checking and Ethernet setting media status on Linux
sudo ethtool eth0 (or your ethernet device):
Settings for eth0:
Supported ports: [ TP MII ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 1000Mb/s
Duplex: Full
Port: MII
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00000033 (51)
Link detected: yes
You'll notice that Speed here is at 1000Mb/s. Initially it was at 100Mb/s by default on mine.
Setting it is rather straight forward, with speed defined in Mb/s:
sudo ethtool -s eth0 speed 1000
The man page for ethtool is actually friendly with examples, something that often isn't the case in Linux.
You probably want to set this as default on startup, in something like rc.local.
Checking and Ethernet setting media status on FreeBSD
ifconfig command on FreeBSD generally provides all this info for you:
re1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 7200
options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
ether 00:13:f7:3a:80:f3
inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
inet 10.1.1.1 netmask 0xffffff00 broadcast 10.1.1.255
inet 10.1.1.2 netmask 0xffffffff broadcast 10.1.1.2
inet 10.1.1.3 netmask 0xffffffff broadcast 10.1.1.3
inet 10.1.1.4 netmask 0xffffffff broadcast 10.1.1.4
inet 10.1.1.5 netmask 0xffffffff broadcast 10.1.1.5
inet 10.1.1.6 netmask 0xffffffff broadcast 10.1.1.6
inet 10.1.1.7 netmask 0xffffffff broadcast 10.1.1.7
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
No problems here, 1000baseT as default.
A bit of tuning and jumbo frames
More on jumbo frames (Wikipedia) and their benefits.
By default in this case I get an increase in speed from Fast Ethernet (~25MB/s), but you can tune things further. One of these is to enable jumbo frames. The default MTU is only 1500. Most of us at home are likely to be using some sort of RealTek card. Usually MTU of jumbo frames is 9000, but RealTek cards only support a max MTU of 7422. On Linux the max is 7200 and on FreeBSD 7422 for RealTek. So I set both at 7200.
Setting the MTU can be done graphically or via ifconfig on both operating systems.
Now I'm getting around 40MB/s which is about 330% increase in speed from initial default setting of 100Mb/s on Linux.
March 15, 2010
The launch of Utp's intranet student forum and Introduction to Linux by Mohammad Farhan.
For more information please contact mail2zeff@gmail.com
1. script
To use script, simply run script before you start using your terminal
# script -f logfile.log
where -f is to flush output after each write, and logfile.log is the file to write whatever script has recorded.
After finish using script, simply type exit or logout to quit script
2. rootsh
Please install rootsh first if it is not installed. To use rootsh, run rootsh before start using your terminal similar to script
# rootsh -f logfile.log --no-syslog
where -f is to show which file will be used to record the session, in this case logfile.log and --no-syslog is to tell rootsh not to log to /var/log/messages. To quit from rootsh, type exit or logout. All the commands and output will be written to logfile.log.closed to show that rootsh has closed the session.
Last week, a new site which help the fellow aussie to able themselves check and compare the best deals on Australian mobile handset market.
MobileBuddy listed almost 1000 different handsets and plan. This will bring back the power of user to determine what is the right choices for them. User can browse directly to the Mobile Plan page, which is easy and clean interface and make the experinence much better when choosing the right plan.
Head down to MobileBuddy and start search for the best plans and deal for your phone.
This post is brought to you by your friends at MobileBuddy
March 13, 2010
Chrome Extensions Mini Hackathon
----------------------------------------
10:30am
- Building chrome extensions (a step by step presentation with
examples)
11:30pm - Mini hackathon.
13:30pm - Lunch is served.
And
after that, MyOSS meetup :)
March 11, 2010
Lately been busy with works and so on. Also here is my new venture with Syed Syahrul, the owner of Idea Buzz . A vidcast talk show style, review gadget, website, and promoting stuff in bahasa style. Yeah, I know, why bahasa Malaysia? Just because there are plenty tech site reviewing it in English, and we want to gather the Bahasa Malaysia crowd.
We recorded it in a photography studio - Pohon Minda. Now currently we have 8 episodes and hosted the video on Vimeo. Please subscribe to our channel here at http://vimeo.com/channels/ideabuzz and start promoting it. We do it because of our passion and love about gadget.
For the record we need some sponsor and if you have any info or contacts that they like to put the product to review on, please contact me.
If you also have any comments and feedback, go to Idea Buzz.





