Rolling with RoR!

Posted by admin | Posted in Tools | Posted on 25-11-2007

1


I’m so busy that I don’t have time to write even this post, continuous university madness, courseworks, final year project, reports, girlfriend etc.. ;) , In other words my blog is almost forgotten and when sometimes I find a very nice thing programming something here and there I just cannot share it with the rest of the world, pity!
I have just found another excuse not to do what I supposed to, and I have started learning Rails!
As with JBoss Seam this is VERY VERY cool framework! I even like it a bit more than JBoss SEAM as development with Rails is pretty easy. No long running redeployments, pretty small and quick web server and another few 1000 pages to read, that’s exactly what I love!
Well, but this post is not exactly about Ruby on Rails, it is about Aptana Studio 1.0!
When I started coding a bit of ruby code I started looking for some nice IDE which would help me organise a few things and I after a minut googling I’ve got it.
There are 4+ very nice features in Aptana:

  • First it’s based on Eclipse which I really like (that was my first real IDE)
  • Second, it’s free (there are 2 editions, community(free) and pro (not really expensive)
  • It runs on LINUX!!! :) (enough said!)
  • It’s pretty easy to conifgure (installing Rails plug-in takes a minute)
  • It has PHP plugin.

Well, this is actually five :) . Especially the last feature was a surprise for me. For the last couple of weeks I’m forced to use Windows Vista for C#(VS 2005) and PHP(Dreamweaver) projects and this small thing allows me to go back more often to my linux partition.
If you are a developer not really using WYSWIG features of Dreamweaver and you like just code and have nice syntax highlighting with FTP synchronization this tool is just right!

Simple screenshot from the rails perspective:


Open Source rulez!

Back to Black – simple backup utility written in Ruby

Posted by admin | Posted in Tools | Posted on 09-07-2007

3

Wow, I didn’t waste that weekend, I have to say. I spend most of the time working and sleeping and coding while working. After a few weeks with Ruby I’m going to say I like it, maybe it’s not love (yet) as Java was my first and you will always remember the first one ;) but I really like it.
After couple of days coding, I have created few classes and files and hopefully my problems with loosing data all the time will disappear for good!
Every time I see a new Linux/Unix distro I’m so excited that first thing I do is to install it on my machine, just to realize later that I had something on this hard drive which could be quite useful. Anyway, I read here and there about network backups, tapes etc. but what I needed was a tool much simpler, something to gather all the files in one place, check the size and if it’s right enough to burn CD, burn it.
As I’m extending my horizons on new programming languages during the holiday period, I have decided to write something like that in Ruby.


Believe it or not , but black is good sometimes ;) , like for example “Back to Black” by Amy Winehouse which is really nice song and of course Linux console, which in my case is black too! ;) (well, almost black)

Features:

  • As you are probably aware at this point, this is a console based application
  • Gathers files from many locations
  • Keeps track of the data and copy only new files or the ones with different timestamps
  • Keeps track of the previous backups to prevent storing the same files on different CD’s
  • Is configurable with simple wizard
  • Has logging facility
  • Checks the size of the backup folder and notify the user when it exceeds preferred size
  • Checks the size of the file before adding it to the backup folder to see if it fits

More or less that’s all. Well, there are a few things someone who wants to try it should know. First, there is not much validation in place so please enter the data as specified in the examples when running the configuration utility. Second, the source is not commented in a very sophisticated way, but I think everyone who wants to tweak it a bit will find out what is where.
The utility has no name yet, so feel free to send me some if you find this tool useful at all.
The whole application consists of two main scripts, one for running configuration program and the other for running actual backup.

Installation:

This utility was written for Linux and for Linux only! Tested on Ubuntu 7.04. You would have to have ruby installed, check www.ruby-lang.org for download and installation instructions.
For the application itself just download the tar.gz folder from the link below, unpack it, and you’re ready to go!

Setup:

Simply run backupConfig.rb file (you can make it executable with chmod or run ruby filename.rb) and follow the rabbit.

Run:

Run bckp.rb similarly to backupConfig.rb, if you have ruby in place just make sure you have an -x flag set on this file or run ruby bckp.rb and you are ready to go. Before running bckp you have to run config utility to have all the settings in place.

If anyone will find it interesting, wants to learn some Ruby and would like to extend its functionality let me know and I put the files somewhere in cvs or subversion server.
Possible enhancements include:

  • GUI with GTK2 or some other Linux aware toolkit
  • some kind of notification facilities
  • launching external CD/DVD burner or similar functionality

If someone has some more ideas please feel free and let me know.

This script was written on Netbeans 6.0 M9 development version with Ruby support.

Download:

# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://bckp.googlecode.com/svn/trunk/ bckp

For NetBeans check out you can follow
my tutorial posted earlier on this blog!


This is my first program in Ruby which is more complicated than famous ‘hello world’ so don’t expect anything astonishing.

Small and hassle-free subversion repository with Goolge Code and Netbeans 5.5

Posted by admin | Posted in Tools | Posted on 30-04-2007

0

Always wanted to use subversion but didn’t want to set up own server, didn’t know how, or maybe didn’t want to go through registration on java.net? Maybe for many it won’t be surprise BUT maybe there are some people out there, who just like me haven’t realized about free 100MB (can be more) version control account on Google. Here you go, a simple guide to set up subversion on google’s server with Netbeans 5.5!
A few simple steps, few minutes and you can access your project from anywhere!
Step 1. Go to google code project hosting web site at:
http://code.google.com/hosting/
Step 2. Click “Create new project” link, and enter required information:
Step 3. Go to code tab and check the repository details, on this page you have to generate the password to access the repository with netbeans:
Step 4. Your project is now created! Make note of the details and the password.

Step 5. Open up Netbeans and make sure that you have subversion support, if not install subversion from netbeans update center. When subversion is installed click Subversion -> Check out.. and enter the details found on the project website.
Step 6. When you are connected to your repository choose the location on you computer and leave the rest as it is, click “Finish”. Netbeans will now check your project out from the google server.

Step 7. Create new netbeans project from the repository.


Step 8. When you’ve finished, right click on the project node, Subversion -> import into subversion, on the panel click “Next”.

Step 9. You have to provide the label for the import to take effect. You can find the list of possible labels on the project website.

Step 10. Enjoy! Your first subversion project was updated on google’s subversion server. Click “Finish” and commit the changes!
Si ya! ;)

How to’s: Installing Sun Studio 11 on Ubuntu 7.04 FF

Posted by admin | Posted in System Administration, Tools | Posted on 29-04-2007

6

I have always wanted to dive into C++ world (as a rather lazy kind never did). This is my another attempt. Since FF version of Ubuntu was released few days ago, almost every day I find something new and interesting. As I’m forced to write sometimes a very small C++ application (university commitments) and a couple of months ago I have realized that Sun Studio 11 is freely available, I wanted to give it a try. Unfortunately never did, that’s because somehow I couldn’t run it under Ubuntu (sometimes you have to choose, comparing the amount of work you have to do to actually make it work or the amount of work to write the program in VIM and forget about all the gui fancy staff). Anyway FF is available and suprise, suprise, Studio 11 works almost out of the box. Here you go simple step by step guide to install this “little” precious.

1. Install Java SDK and JRE 5, for some reason SS11 doesn’t work with version 6, you can however still keep the version 6 as the default one on the system.
2. Install GNU C/C++ compiler under Ubuntu:

sudo apt-get install build-essential

3. Download Sun Studio 11 software for Linux
4. Run the installer:
change to root (su -)
move the downloaded .bz2 file to the directory where you want to install the software (in my case /opt directory)
run:
tar -xjvvf studio11-lin-x86.tar.bz2v
./installer –nodisplay
5. Answer a few simple questions about installation
6. Don’t worry if sdk 1.4 was not installed.
7. Change one of the awk scripts:
go to /installdirectory/sun/sunstudio11/prod/scripts/ver.awk
and change the line:

FS=“”| |(|)|,|t”;
to:
FS=“”| |(|)|,|t”;

8. Add the studio’s bin directory to your PATH:
Edit .bashrc and add the following line:

PATH=/opt/sun/sunstudio11/bin:$PATH; export PATH

9. Run the newly installed Studio 11 with:
sunstudio
Note:
If you have more than one JDK available and e.g version 6 is your default one, run sunstudio command with the following flag:
sunstudio=’sunstudio –jdkhome ‘path-to-your-jdk5or4′ in my case alias sunstudio=’sunstudio –jdkhome /usr/lib/jvm/java-1.5.0-sun-1.5.0.11′
If that is the case add the alias to your .bashrc file:
alias sunstudio=’sunstudio –jdkhome /usr/lib/jvm/java-1.5.0-sun-1.5.0.11′
and run the command sunstudio as normal.

Sun Studio 11 Splash Screen on Kubuntu 7.04 FF:


…and working IDE:

Good Luck :)