Technology related blog

Today I came up with an idea to create a new blog which will deal with technology issues. Until now I\’ve been posting all the stuff this blog, but now I want to separate it mostly due to two reasons:

– This is my personal blog I think that I may post about myself here, than about technology issues (though they mostly come up from my personal experience as well)

– I have a friend of mine who is also interested in having a blog about technology since he also deals with it and he wants to share his experience.

I think that the new blog will appear around very soon and I hope it will go well.

MySQL Backup Script

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)

Benefits of Blogging

The JRB Technology Blog has a nice post which described some benefits of blogging as well as touches the issue of what and how one should post (in some way). As it clear for me why I do have a blog and I post there: in most of the cases I just want to share of my technical experience and rarely I just want to post something about an event in my life. So people do still miss a point on what is blogging and here I totally agree with the post on JRB Technology Blog that says: \”Now, don’t go out there, start a blog, and post a bunch of crap. Post information people can actually use\”. This is the main point – either post some useful info (about your profession or your life), or don\’t just post at all.

I don\’t know if I am getting too critical on this, but this is how I see things around.

Cyprus Blog Network

Ok, I think it is time to checkup what is going on on the Cyprus Blog Network. As I have mentioned some time before, I will be checking around there and will see if it worse of checking it up.

I can see daily posts there and what is more important I read most of them till the end. This is what I like. I also like the forum functionality on the CBN (though it is yet simple) and finally, I can see that the list of friends and members is growing, which is also good. The only thing which CBN is currently missing is active users. I would like to see more people posting around and I believe that this is how it should be.

For the time being I will continue checking the Cyprus Blog Network since there is content I like over there :)