Me and U(buntu)

My Ubuntu Experience!

Posts Tagged ‘Ruby’

Ubuntu at work

Posted by ushimitsudoki on January 3, 2008

Sometimes I actually do something

Today I really put Ubuntu to the test for work. I needed to get some things done on a web site, and I felt comfortable enough to try to handle everything from Ubuntu. I didn’t (physically) touch my WinXP laptop, and I got everything done!

I probably wont ever go into this much detail about my daily work (it’s not that interesting). However, I wanted to show that (with a very minor exception), I got everything done I needed to do strictly in Ubuntu. This is the exact same thing I would have been doing on WinXP less than a month ago!

My super-exciting day at work

First, I needed to work on some image files (roughly 20,000). Now, these were already on my WinXP laptop, and I have two ways now to get at my laptop from Ubuntu, rarely do I have to physically touch Windows. For one thing, I have a shared drive set up, which is mounted in Ubuntu. I also have Terminal Server Client, so I can “Remote Desktop” into the laptop and then do whatever I need to do (including placing things on the shared drive). Very nice.

After copying over the files, I needed to rename them according to an “old part number/new part number” cross-reference. The cross-reference came as a Microsoft Excel spreadsheet over email, which I simply opened with Open Office Calc, cleaned up and saved as a CSV text file.

I wrote a little Ruby script to handle the renaming – as I mentioned I am learning Ruby and this was a good opportunity to try doing something useful. This took a long time, because obviously I don’t know the language yet, so I made lots of small errors like trying:

filename = gets
File.open(filename, 'r')

instead of:

filename = gets.chomp
File.open(filename, 'r')

That actually took me quite a while to figure out, because I couldn’t find anything about it searching.

Files renamed, I uploaded them to the server with Filezilla.

Since this took a while (20,000+ images, remember?), I set up LAMP, which was easy to do by following this blog post. See, I needed to update the MySQL database to match up the parts with the images. To work out the queries and test, I downloaded the appropriate tables and did the necessary bits in phpMyAdmin.

Finally, I wanted to twiddle with the tables a little more, so I created my first Open Office Base database and double-checked the work I did in phpMyAdmin.

My impressions

Obviously, everything got done, and the only thing that took me a long time was writing the Ruby script. Still, I’m not sure how quickly I could have gotten that done in Windows, as renaming things according to a cross-reference list would require either some scripting or finding a little application that could do it for me.

I did run into a bug in Nautilus, where trying to open the directory with all those images took a loooong time, and I think even crashed Nautilus – at one point it was using like 2.8GB of memory. I eventually gave up on trying to browse the directory, and just used the command line.

Posted in linux, ubuntu | Tagged: , , , , , | Leave a Comment »

Ubuntu Newbie Style Programming I: Getting Started

Posted by ushimitsudoki on December 26, 2007

What exactly do you think you are doing?

I am trying to get my system all set up so I can work on a programming project I have long laid to rest, but am considering reviving. Not only do I hope to have some fun with programming again, but I thought it would be a good project to learn more about Ubuntu and other new software.

The Goal

For no big reason, I want to use Ruby for the project – and I have picked the Netbeans IDE to try. If these don’t work out, I might switch, but for now that’s the plan.

The Stumbling Blocks

First, to install NetBeans. The version in the repositories is 5.5, but I see on the webpage 6.0 is out so I want to install the newer version.  There is an installer which ran, but only opened up to a blank screen. A search revealed there are some problems with Java and CompizFusion. I installed the Java 6 SDK and used that, and things seem to be appearing fine. Another option would be to turn of Compiz I suppose.

NetBeans Installation Quirk: The “–help” refers to the “–javahome” command line switch, but the error message refers to the “–jdkhome” switch. It is “–jdkhome” that is correct.

(I actually tried a couple of different times with differing Java things, but I was trying to install jedit, but I gave up on that. I kept getting a bad Java error with it.)

The next thing I wanted to do was to set up a launcher for NetBeans in AWM – this is where I ran into a couple of minor things that I don’t like:

1. If you look at a desktop launcher, you can click on the icon to browse for a different icon. However, I couldn’t find a way to determine the current icon location, which I needed to create the launcher for AWM. Google Desktop saved the day for me here.

2. AWM need to be easier to click on to add a launcher, it seems like there is only the smallest areas on the edges  that work. And, when you add a launcher, it doesn’t appear – you have to close AWM and re-start it.

The future

I don’t know Ruby, so it will take me some time to get going I am sure. I won’t fill this blog up with programming or Ruby talk, but I suspect some general Ubuntu-related material might come up from the effort.

A footnote

On the off chance that someone is interested in helping with this project, they are welcome to contact me about it! I plan to get something going in Launchpad once I get further along.

Posted in linux, ubuntu | Tagged: , , | 2 Comments »