kerneljack’s diary

some thoughts and comments on my day to day experiences

Archive for the 'computers' Category


Links for June 3, 2007

3rd June 2007

Fedora 7 is released!: I really liked the last Fedora release, but I believe it was slightly plagued by problems with some of it’s package management utilities. I have already installed this release and am quite impressed. Wireless now works with WPA out of the box and their new re-spinning feature is something I will try out someday.

XML Parser benchmarks: I have always had my own suspicions of which XML parser model would be faster (Sax or StaX), but I’m glad to see this benchmark done by the O’Reilly folks.

Fear and loathing at Cupertino: Jeremy Allison’s terrible experience while trying to prepare a talk for his Apple WWDC presentation. Jeremy works on Samba, along with Tridge, who they all call “the smartest man in Australia” :-) Jeremy works at Google now. Smart man.

Posted in apple, coding, computers, linux, mac, news, operating systems, osx, programming, software | No Comments »

LinuxWorld 2006

26th October 2006

LinuxWorld started yesterday here in rainy London and I had a great time! It was the first time ever that I wasn’t a visitor, but was helping out at the Jokosher stand. I did several demos of the app to tons of people and we managed to distribute more than 130 Jokosher flyers to interested people.

I was quite surprised at the level of interest in the app, and we managed to solicit a great many feature requests from people, some of which will hopefully end up in Jokosher someday, making it rock even harder! I will definitely try to help out at more of these events in the future :-)
You can find the photos I took with my camera phone at my flickr photo page.

Posted in coding, computers, linux, podcasting, programming, python | No Comments »

Wierd Java error on my Mac

16th October 2006

I turned my computer on today to get some work done, started Eclipse and started coding. When I tried to use the command-line though, I got this strange error:


Error: no known VMs. (check for corrupt jvm.cfg file)

I couldn’t run 'java' or 'javac' from the command-line at all! I immediately went to /System/Library/Frameworks/JavaVM.framework and looked for 'jvm.cfg'. I have 3 VMs installed on this machine, 1.3.1, 1.4.2, and 1.5.0. 1.3.1 and 1.4.2 had a proper jvm.cfg file installed but for some reason 1.5.0’s jvm.cfg was a zero-length file. Googling didn’t turn up anything useful except this tip, which wouldn’t work because in my case all my permissions were correct. Fixing permissions using Disk Utility didn’t show any permissions problems at all.

In the end, all I did was copy the 1.4.2 version over to the 1.5.0 directory and all was well. The tip above mentions that Eclipse might have had something to do with this, and there might be some truth to that, as I did update my Eclipse to 3.2 recently, but I have been using it for a week without any problems …

Posted in apple, coding, computers, mac, operating systems, osx, programming, software | No Comments »

Always buy RAM from Crucial

2nd May 2006

I needed some extra RAM in my 512MB laptop to do some Java heavy lifting (Eclipse, Netbeans, JBoss, Profilers, etc). Those things can take up a lot of RAM, not leaving much for Firefox and other apps. Seeing that my laptop does not cover upgrading RAM under the warranty (very strange) unless done by authorised personnel, I went down to the store I bought my laptop from (Micro Anvika) and asked for a quote. 130 pounds is how much they wanted for a 1GB stick; in contrast I could get the same type of RAM from Crucial for 89 pounds!! That’s a saving of just over 40 pounds! I was hoping it would all go smoothly and the RAM would work because if something messed up I would be without a laptop and a warranty :-)
It all went perfectly of course and a month later I’ve had no problems with the RAM. It’s so simple to buy it from crucial too. They have a comprehensive database of products (computers, laptops, motherboards, etc) and the type of RAM these products take. Simply make the right selections and they tell you what to buy, even how many slots you should have free by default. If even that’s too much for you and you happen to be on a Windows PC or laptop they have an ActiveX applet that will download and try to figure out the RAM type for you. This didn’t work for my system though.

Anyway, the moral of this story is: Always buy RAM from Crucial. It is crucial that you do so :-)

Posted in computers, hardware, website | No Comments »

Apple’s Boot Camp - easily install XP on a Mac!

5th April 2006

Wow this is unbelievable! Apple has officially released a public beta of Boot Camp which allows anyone to take a Windows XP CD and install it on a Intel Mac complete with dual-boot! I haven’t seen this discussed anywhere today as yet, but in just a short while this is going to be huge. Ars Emporium and Macintouch seem to be the first to have this story. So this is why Apple joined that Windows benchmarking group a while ago. The next version of OSX (Leopard) will also include technology to let you run XP on a Intel Mac. I think Leopard will also include some virtualization technology so you won’t have to reboot your Mac just to use Windows.
From the Boot Camp page:

Boot Camp lets you install Windows XP without moving your Mac data, though you will need to bring your own copy to the table, as Apple Computer does not sell or support Microsoft Windows. Boot Camp will burn a CD of all the required drivers for Windows so you don’t have to scrounge around the Internet looking for them.

Well … I never thought I would see this day. Everyone has known that Apple wouldn’t officially support Windows on Macs and they still won’t offer support for this but it was always assumed that people would have to use hacks to get Windows to run on a Mac. With Boot Camp people will no longer have to rely on hacks and it will also burn you a CD of the required drivers for your XP system. Very very cool indeed.

Posted in apple, computers, mac, operating systems, osx | No Comments »

Scoble’s Dashboard Spy

2nd April 2006

With all the April Fools jokes flying around, The Scobleizer Dashboard has got to be funniest thing I’ve seen in a while. It would be great if someone actually came up with something like this so a blogger can instantly monitor what’s being said about him all over the web. Kind of like web stats but for an individual blogger or blog; maybe I’ll call it BlogBuzz or BlogStats. BlogBoard, BlogDashboard, dont’ sound that nice. Maybe MemeBoard? That sounds better.

Posted in computers | No Comments »

Doing quick tasks in Python

31st March 2006

A lot of the time at work I have to come up with quick solutions to various programming problems, and I mean *real* quick. There is usually very little time for finding the right library or open source toolkit that has already solved the problem or some part of it and then to figure out how to integrate that into our own workflow. It is usually much quicker to simply write a few scripts that get the job done.

In such situations I increasingly find myself solving these problems using the Python programming language. I’ve usually whipped up scripts using bash scripts and even Perl but I often find that I have to “re-learn” Perl again and again, or at least the part that I’m temporarily using to solve some problem. Python just seems (and looks) so much natural and cleaner. I’ve been fascinated by Ruby recently after my brush with Ruby on Rails and I am seriously trying to find a project to use it in all the time!

Anyway I wanted to give some examples of Pythons’ ability to solve quick problems. I’ve used it to make remote backups, check if certain services are running remotely and to fetch and delete mail off a remote server. For example, the following snippet of code can be used to send mail:

import smtplib

mailServer = smtplib.SMTP(serverURL)
mailServer.sendmail(sender, to, message)
mailServer.quit()

Really sweet and simple. I’m sure you can do this in only 1 line or even half a line in Perl (or even Python!) but this is really clear and concise. When I needed to write a script to send mail, I simply googled for it and dug this up in literally 20 secs! That’s one other reason I like writing scripts in Python: you can always google for snippets of code to do stuff.

Similarly, the following can be used to check if SSH is running and accepting connections on a remote server:

IDENT_STRING = "SSH"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, int(PORT)))
data = s.recv(1024)
s.close()

if data.find(IDENT_STRING) == -1:
sys.exit (1)
# if everything OK, exit normally
sys.exit(0)

If you put this in a script and run it, you can use the exit code (echo #?) to determine if SSH was running or not. Very useful if you’re writing a script to make backups to a remote server; you need to make sure that the service is up and running on the server and that it is accepting connections from the local machine.

I will try to see if Ruby makes any of these tasks even easier to do or perhaps easier to write and comprehend. I might even give Groovy a try since Java is my day job and Groovy is described as a scripting language for Java programmers.

Posted in coding, computers, programming, python, scripting | No Comments »

Windows XP on a Mac!

27th March 2006

The motherboard on my server died 2 weeks ago and it’s taken me this long to find a replacement and get the server up and running again. A benefit of changing the motherboard is that now the server is even more quieter than before! It’s all because I took more time to isolate the noisier case fans and to re-install them.

So I haven’t been able to blog for 2 weeks and *so* many things have happened. narf and blanca finally managed to get Windows XP running on a Mac! This is awesome news, especially after disappointing news a while back that Vista will not support EFI either. It seems they have managed to emulate a regular BIOS for the XP on Mac competition. Soon after the announcement, Leo Laporte did a great segment for MacBreak where they install XP on a Mac Mini and that’s the first place where I saw it actually running. A lot of people can now dual-boot their new Intel Macs and have a choice of XP or OSX (and even Linux!). I’ve never seen such a versatile machine! These are interesting times indeed.

Posted in computers, news, operating systems | No Comments »

Ruby on Rails

7th March 2006

“Rails is the most well thought-out web development framework I’ve ever used. And that’s in a decade of doing web applications for a living. I’ve built my own frameworks, helped develop the Servlet API, and have created more than a few web servers from scratch. Nobody has done it like this before.” -James Duncan Davidson, Creator of Tomcat and Ant

I tried out the Ruby on Rails (RoR) framework this weekend and I’m quite impressed. I used Apple’s new tutorial for developers which explains how to install and quickly get up and running with a simple Accounts/Expenses webapp. I did encounter one minor glitch while following the install instructions because I was installing on my Debian Linux webserver, instead of an Apple machine. It seems the default ruby install no longer comes with the ruby-zlib library, but that was quickly fixed by following these instructions.

Rails applications all have a consistent directory structure, so you always start by running a command to generate the directory structure for you. This creates directories like app, config, doc, test, etc. The names are very familiar and easy to remember and they reinforce the purpose of the directory, i.e. the test directory is used to hold unit tests and functional tests for our application.

Automatic test creation makes testing an obvious and integral part of the development process, not an afterthought. It encourages you to think of a testing strategy upfront. This is perhaps the single most appreciated aspect of Rails development for me. You are supposed to test your code in other environments, but programmers often write code and if time permits, write tests. Rails tries to make it easy and painless (as much as possible) to test your code.

The next thing I learned about was the fact that Rails, like the Struts framework, tries to explicitly embed the notion of Models, Controllers, and Views within the development workflow. The concept of Actions, which are sent to Controllers in Rails is familiar to Struts. It is very easy to take a Rails URL (as shown in the example) and figure out how the server is going to parse and execute it.

Validation came next and I was suitably impressed. You simply need to add a few lines to the model, describing what each field should validate as, sort of like describing a type for a variable. Simply restart your server and voila, type rubbish in a field and Rails will highlight the field in red and ask you to re-enter it.

After all that, the tutorial shows you how to create a relationship between two models, much like in a relational database. The relation is that ‘one account can have many expenses’. This is accomplished in Rails by adding a ‘belongs to’ field in the Expense model (an expense belongs to an Account) and a ‘has many’ field to the Account model (an Account has many expenses). Simple as that.

Other things covered in the tutorial were:

  • adding business logic to total up the expenses for the account
  • using helpers to change the view slightly and show the total in red if we are over budget
  • writing simple unit tests and running them

Overall an excellent introductory tutorial which has left me wanting more. I will definitely go through the Rails website and find out more about RoR and what it can do.

I know this is a small toy example and I want to know how RoR handles in a real mission critical business app as those are the only kinds of apps developers write these days :-) RoR is easy to code for, but is it easy to maintain? After we get past the simplicity of the example app, how hard is it to write huge apps in it, and how long does it take a new developer to become familiar with and productive with a new codebase? These are all questions that I need answers to and I have the feeling that RoR won’t disappoint.

Posted in coding, computers, software | No Comments »

Yahoo’s new RSS + SMS service

2nd December 2005

Yahoo has started a new RSS + SMS service, but reading about it, I’m really not sure what I use I would put it to:
RSS + SMS

As Russ has already mentioned, it’s typical use case is not the elite digerati who subscribes to 500 feeds, it is instead useful if you have a more focused feed (let’s say within a company) and want employees to be alerted to certain critical events. The use cases i’ve thought of so far that might work for me are:

- Sysadmins being texted when there are new updates on a server? This is assuming that whoever provides the updates publishes an RSS feed to go along with it.
- Employees being texted reminders from their Outlook or iCal calendars. A lot of online calendaring apps like Backpack allow you to publish your reminders as RSS feeds so you should be able to get alerts for those.
- Any other scenario where someone needs to stay updated on a certain topic every hour or so. I assume you can configure the Yahoo service to send alerts out only every hour or so, so it sends them in a “batch” format instead of 10 updates per hour. This should help alleviate the 50 updates an hour problem.

The only problem I see is that I’m sure people *already* have ways of doing this stuff. I can easily write a script that checks my server for updates every day and sends me an alert or email about it. Granted, Yahoo’s service is supposed to be free, and SMS will cost me, but still, it’s already been done.

When this comes to the UK (if), I’ll probably configure it to send me an alert about system updates for my servers, etc. If there isn’t an RSS for it, I’ll create it.

Posted in blogging, computers, news | No Comments »