Got new monitor

I was planning to get myself a new TFT monitor quite for a while, but I never got chance to go and actually get one. Today, my old CRT monitor got burned out and I had to put something else on it\’s place. The only options were either to get some old monitor from somewhere else or to buy a new one. I didn\’t want to get an old one so I called a friend of mine Chris, who is also a main hardware supplier for me and most of the people I know and asked if he has something available. Luckily I had a very nice offer from him for Samsung SyncMaster 710N 17\” TFT monitor. Without even thinking for a second and went down to his workshop and got one – looks pretty nice.

Here is how it looks like:

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.

Printing Address Labels from MS Outlook

Today I had to find a way to print address labels (the ones that a sticked on to the mail envelopes) from MS Outlook contacts. After looking around for a while I found a way to do it through MS Word and I think that this is too complicated, but no other ways were found, so here is how I had to do such a simple (from the first glance) thing:

1. Go to MS Outlook and find all contacts for which I needed to create labels

2. Copy all those contacts found in step 1 to some temporary contact folder

3. Open MS Word

4. Go to Tools -> Letters and Mailings -> Mail Merge from the top menu

5. In the right panel (Mail Merge) select Label as a document type and press Next: Starting document at the bottom of the pane

6. Press Label Options… link in the right pane and select a format of the labels I want in the popped up dialog.

7. Press OK to close the dialog and Next: Select recipients link in the right pane

8. Choose Select from Outlook contacts option in the right pane

9. Press Choose Contacts Folder link (still in the right pane)

10. Select a temporary contact folder created in step 2 from the list in the popped up dialog and press OK to close the dialog

11. Review the list of contacts fetched by MS Word from the selected folder and press OK to confirm (in the new popped up dialog)

12. Press Next: Arrange your labels link at the bottom of the right pane

13. Select Address block… option link in the right pane

14. Customize the contact fields to be included in the popped up dialog and press OK

15. Press Update all labels button in the right pane to update all cells in the document template

16. Press Next: Preview your labels link in the right pane

17. Press Next: Complete the merge link in the right pane

18. Press Print… link in the right pane

19. Press OK in the popped up dialog leaving All option selected

And only after all the steps above I had labels printed.

I think this is way too long and complicated. If anybody knows the better way – please let me know.

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)