Jan 28th, 2007 | Blogging, Education, General, Java, Perl, Personal, Programming, Technology | 2 Comments
It’s been a while since I last posted here and I don’t feel like posting something huge here this time, so here is just a short life update:
- Wrote all college exams (4 of them):
- Artificial Intelligence - this is the only exam I feel like I failed. The subject is really boring, the teaches does not seems to be confident in the topic, exams were prepared by other professor who is very good in subject and probably did not consider that (as I believe) we were taught not in the best way. In addition the class is kinda boring. As I have concluded - it is like maths for me, but while in maths I know that I am totally stupid, here you think for the whole semester that the class goes fine and at the end you find yourself unbelievable stupid.
- Software Engineering - this one went fine. A class is very boring and implies a lot of bureaucracy related to IEEE standards, but I think I managed it quite good mostly because IEEE has a lot in common with ISO stuff which I know not that bad.
- Computer Architecture and Organization - went very easy because the amount of information given was very limited and a lot of it came out of previously passed Digital Systems.
- Object Oriented Programming (based on Java) - went pretty good as well due to some programming experience I have as well as familiarization with many programming languages. One more time proved to myself that Java is not what I like - Perl is the best.
- Preparing for the next semester - need to pay quite an amount of money for the college but already have some options. Thanks to all people who help me in this matter.
- Learning AJAX technology and have a post about it on configfun.com here.
- Preparing for the visit to immigration :( Hate this part of being in Cyprus, but have no other ways yet.
- Planning to go for skiing one day into Troodos where there is some snow already. Hopefully my skiing equipment will be delivered to Cyprus by a friend of mine who is now in Moscow.
Dec 27th, 2006 | Nagios, Perl, Programming, Software, Technology | 8 Comments
I am currently working on creating a perl module do deal with Nagios configuration. The existing Nagios-Object package is quite limited, outdated and not that fully implemented. I checked it up and decided to rewrite it using my way.
Currently I am using Class-Generate package to help me with creating classes for Nagios object definitions and I already managed to write a parser which takes a path of nagios main configuration file, finds all links to object definition files and parses all definitions. One’s parsed, the definitions are stored as objects with all accessorts/mutators available.
I am also implementing object linkage so that the relations of objects can be used easily. Currently most of the stuff is already working fine.
In addition I am planning to implement the write function so that it is possible to create problem text config files with object definitions. Also thinking on getting on status log parsing.
The idea behind is to create a web admin panel for Nagios and extend the functionality, plus maybe I will do a new web frontend for Nagios, since the one given is not that good (anymore). I already have some web stuff working (based on perl, Catalyst, CGI-FromBuilder and Template-Toolkit)
Dec 11th, 2006 | Blogging, Perl, Programming, Technology | 2 Comments
JRB Technology blog offers a script on how to backup a MySQL database. The described solution uses perl to call three commands:
@b1 = `mysqldump -h localhost -u mysql_username –password=mysql_password mysql_database > /path/to/put/mysql_database.sql`;@z1 = `zip -r -9 ~/path/to/mysql_database.zip ~/path/to/mysql_database.sql`;@d = `rm -f ~/path/to/mysql_database.sql`;
I have posted a comment directly to the origin blog with some (as I see it) improvements, but unfortunately the comment was deleted, so I will reproduce it here.
First of all I think that there is no need to create a temporarily SQL file with dump from the database and then zipping it. The zip command supports getting data from STDIN, so this way, instead of running 3 commands, only one is needed:
mysqldump -h hostname -u username –password=somepassword databasename | zip -9 mysql_database.zip
Then I offered to hide a password, since otherwise it is possible to see it by running the ps command under any user during script execution, and password will be seen in the arguments list. To hide a password, we can create a text file which is accessible only to us (chmod 600) and store a password string there, then modify the backup command accordingly:
mysqldump -h hostname -u username –password=`cat /path/to/securefile.txt` databasename | zip -9 mysql_database.zip
This way, even if someone will see that the password for accessing database is in the specified text file, it will be harder to get it, since file is readable only by owner user.
Finally, I would like comment a bit on Perl script itself, which author of the original script provides: first of all, I don’t see any point of using Perl here, since nothing, except for calling standard commands is done during execution. A plain bash script would do a job fine. Anyway, even if you prefer using Perl, I would strongly recommend using -w switch and use strict; statement (even in such simple script, it is just good to use this every time)
Nov 9th, 2006 | Education, Java, Linux, OS, Perl, Personal, Programming, Technology | No Comments
I am not a Java fan and I do prefer doing all my stuff in Perl (due to the perl being more flexible and comfortable to code in [my personal view] and probably due to the nature of the tasks I have), but due to the college class Object Oriented Programming which is totally taught in Java, I have to install Sun JDK on my laptop for some time.
It turned out that the task is not that easy (actually easy, but tricky), but I found a nice article which describes all steps needed to get Sun JDK configured on the system - works for me
Aug 25th, 2006 | Perl, Programming, Technology | No Comments
Yet another useful model for developing web applications with perl. Though I am using Template Toolkit to make job easier, I am fed up with building similar forms in my web applications. Now I found a very nice combination of things: Catalyst + Class::DBI + TemplateToolkit + FormBuilder.
Catalyst, being an MVC framework (which I really like) does all the routing job of determining what to do apon the request and how to do it. Catalyst::Session alsp provides me with all I need in regards to sessions.
Class::DBI (along with Class::DBI::Sweet and Class::DBI::mysql) makes the process of storing, retrieving and doing other stuff with data very easy and comfortable.
Template Toolkit reduces the amount of HTML written a lot.
CGI::FormBuilder makes it very easy to work with forms. I have only one general template to define how the form will look and a bunch of config files to define different forms. It also does a lot of validation work (both with javascript on client side and perl on server side).
Another good point is that all of the above modules can be very easily integrated into one application and used smoothly together.
Any other useful things?