osama i. al-dosary

nothing serious, just for fun

Comment Posting Now Working! March 18, 2009

Filed under: blogging — dosary @ 2:34 pm

I stopped allowing commenting on my blog about a year ago when I found that I had over 7 thousand spam comments. I didn’t know how to stop the spam until recently I’ve added the spam utility through WordPress, called Akismet.

Now I have the task of deleting 7′000 comments, which cannot be done all at once through WordPress. Through WordPress you can only mass delete 20 posts at a time.

I’m not very familiar with WordPress, but I found how to delete all the spam comments. Basically its done by running the following SQL command through phpMyAdmin:

DELETE FROM wp_comments WHERE comment_approved='0'

(Which I got from this helpful link forum posting:
WordPress › Support » deleting over 10,000 spam comments without using moderation page)

Interestingly command didn’t delete the comments that I had approved, so it seems the “0″ in the command means: unapproved”.

 

Updating Ubuntu with Missing MS Arabic Fonts March 13, 2009

Filed under: GNU/Linux — dosary @ 8:21 am

Often documents are written in Arabic using specific Windows fonts, so when the document needs to be viewed on Ubuntu it might not display correctly. One method to solve this problem, is to use the fonts from your Windows partition within Ubuntu.

First create a new directory within Ubuntu under the system’s truetype fonts path, for your Win fonts:

sudo mkdir /usr/share/fonts/truetype/mywinfonts

Then copy the fonts from your windows partition into your newly created folder “mywinfonts”:

sudo cp /media/system/WINDOWS/Fonts/* /usr/share/fonts/truetype/mywinfonts/

Now you need to reload the font cache for the new fonts to be available immediately:

fc-cache -f -v

 

Mogrify your images … Quick and Easy Batch Photo Resize March 12, 2009

Filed under: photography, web — dosary @ 7:30 am

When you upload your images to be viewed on the web, its best to reduce the size of the image to fit into a normal browser window and more importantly so that web site is quick and responsive to viewers. If you are working with a lot of images at once, such as for photo album, doing a manual resize for every image can be a hassle. Therefore you need look for a tool that can do batch resizing of your images at once.

I used to use IrfaanView to do batch resize. Now that I’ve completely moved my personal stuff off of Windows, I need a tool that can do the same but on Ubuntu. … In comes Mogrify. Mogrify can do many things on multiple files concurrently. All I care about doing here is resizing my photos, though.

To install mogrify, you need to install imagemagick suite, which mogrify is part of:

sudo apt-get install imagemagick

To resize an image, do:

mogrify -resize 640×640 MyPhoto.jpg

Keep in mind that this command will whipe out the old file a replace it with the new modify image. So make sure you are working on duplicate copies of the images.

You can also the resize in terms of percentage:

mogrify -resize 50% MyPhoto.jpg

To do a batch resize on on all the images in the directory, do:

mogrify -resize 640×640 *.jpg

Once again, use with caution or on duplicates, as the original image is lost.

 

My Photo Gallery Back Online March 11, 2009

Filed under: photography, travel, web — dosary @ 6:46 am

My old hosting environment stopped working and with it so did my on-line web-album.

I’ve been meaning to rebuild web-album since I moved my blog to new hosting. But I keep putting  it off. I tried using the a web album, simply called Gallery, offered by my new hosting. But seemed complicated at the time and I never got it up and running.

During my recent vacation I had some time to play around and I tried the other two web-albums/photo gallery software that was provided by my hosting provider, which were Coppermine and 4images-something… Both seemed a bit unfriendly and not feature rich. So I decided to try Gallery again. It turned out easier that I originally thought.

I’ve uploaded two albums so far to try out. So far so good. So I will be uploading the others soon.

Please take a look here and send me your comments:

http://fakebucket.com/photos/ or

http://dosary.net/photos/

 

The Perpetual PTO Cycle March 9, 2009

Filed under: productivity, travel, work-life — dosary @ 2:17 pm

I’m currently on PTO. Which is short for Paid Time-Off, as the US corporate world calls it. I find the stages of  vacation very interesting and an emotional roller coaster.

First we have the wishing Stage, where I wish I could start PTO immediately. That happens a lot. :-)

The frequency of that feeling varies, of course, and is proportional to my current work load. It can reach peak states where I’m pondering emailing my resignation, but quickly back-off mainly because it would be indecent not to give two weeks notice, and therefore couldn’t get instant gratification!

The Second Stage is when I decide to take some PTO days, but not sure when. This is a tough stage. I need to take some time and plan exactly what I want to do if I want my vacation to be memorable. But when you are very busy you can easily put off the planning part. Also if I want to plan an activity trip with friends (e.g. scuba diving), then the coordination with friends increases the complexity of getting a timely answer. For some people it is difficult committing to dates more than a month in advance, and for me, its the opposite. Where its difficult having a free calendar less than a month in advance. So I end up choosing  arbitrary dates and hoping for the best. Often it ends up with me spending a lot of time at home, just chillin. Don’t get me wrong, I’m not complaining. Chillin ain’t bad. But you can’t help regret the lost opportunity to go diving with sharks off of Seychelles — if you catch my drift. I’m relieved a bit by the thought that I’ve saved money, and more importantly that I didn’t loose my PTO days. Keep in mind that often nothing happens after this Second Stage. As I can get stuck without a vacation target date or plan. Then the whole idea is lost and forgotten again. … Back to the First Stage.

The Third Stage, is when I finally come out with vacation dates and go about formally requesting those PTO days. We work in a very cross-functional organization so its important that immediate team members know about the vacation and don’t raise any flags. That is fine. The problem can arise with managers when they have thoughts on when, how long, or if I should ever take a vacation. (I’m not talking about any specific manager here. So if any of you guys are reading this, its not you! I love you! Keep up the great job and the raises coming!!) Its best that I try to be a very cold and calculating bastard about this subject. I’m a big softy for my “buddy” managers. Often I’m tricked into feeling guilty about “abandoning the team”, “dropping my responsibilities “, and “not having ownership”. I use the quotes because these terms have been used with me. What’s worse than the standard PHB mid-manager mind games,  is when I finally get my manager’s approval, then some nit-wit Account Manager requests my support during the dates I’ve planned my PTO. Guess what can happen then! Not always. But it has happened to me several times that I’ve canceled my PTO request. And two of those times I’ve had to cancel my travel plans, which included the complex friend travel coordination.

The Fourth Stage is the excitement and anticipation of being free of slavory. Part of this stage is trying to wrap up things so that little or no hand-over to colleagues is needed, and so that nothing needs to interrupt my PTO.

The Fifth Stage is when I start the vacation and try to orient myself to being a normal human being again. … Don’t look at your mobile email client. Damn it! I did it again. Every time I look at that thing I start stress out. … Oh my sweet Colon! I promise not to do it again. Please detract. … After several deep breadths it starts to ease and I can stand up again.

The Sixth Stage is when I have gotten the hang of it and convinced myself that its a basic human right to have a work-free vacation. Afterwards, I can ignore work phone calls with greater confidence and less guilt. Sometimes I find myself imagining an angry argument with the person whose call I’ve ignored. That’s not healthy either, but I haven’t learnt to overcome that yet. Baseless guilt is still very powerful. I find that a touch of anger can help combat guilt.

To make sure that nothing important is dropped, I use the out-of-office email feature and include a colleague’s contact in the auto-reply email asking for him to be contacted instead for business related matter. I typically buffer calls, or ignore them if I’m feeling fragile. I also include in the auto-reply message a comment about contacting me via SMS if its urgent. Of course, in our Middle Eastern version of this US-based company, everything is urgent! Yet nothing is, really. So I would often get these messages which I really can’t find it in my heart to respond to, even though I struggle about it. Some examples of these messages include:

  • “Please call”, translated means: I’m too lazy and inconsiderate to write my question, so I’d rather bother you verbally.
  • “Please call”, translated means: I forgot what you told me ten times, please tell me again for the eleventh time.
  • “Please call”, translated means: I’d rather you verbally tell me what to do instead of looking at the documentation that you sent.
  • “Please call”, translated means: I wasn’t paying attention to what you said last time we had a phone conversation. Lets talk again.
  • “Please call”, translated means: You’ve answered my question by email, but your answer was too long and detailed. Please give me the Cliff Note’s/short and dumb version.
  • “Urgent, Please call”, translated means: I’m too lazy and important to write my question, so it makes sense to bother you in a dramatic way when I feel like it.

Looking at what I just wrote, I can see that I’m more cynical than I expected.

Don’t get me wrong, although I  try not to respond to those types messages, I do respond to messages that explain what is needed.

The Seventh Stage is when realize I don’t have much time left and start to panic and feel regret of what I should’ve done but don’t have time to now.

The Eighth Stage is going back to work. Simply overwhelming. Especially, when I have a couple thousand emails to sort through. This time around I’m probably going to throw away all email I received during my PTO, and just deal with what’s new. This plan has its drawbacks, of course, but the alternative is very time consuming and will leave you behind, stressed and trying to catch up for another two weeks.

The second big challenge is remembering what I should be doing. I.e. keeping priorities in perspective, while colleagues and partners try to pull me into different rabbit holes.

Sometimes coming back to work can feel exciting if there is something new to look forward to. Such as a new job role or a new colleague who will off-load some of my work — hopefully giving my some time for independent human thought.

Another challenge of going back to work has to do with our Middle Eastern warm nature, which means a lot of people greeting me with hugs and kisses. Honestly, I enjoy it. Seeing a colleague I haven’t seen in a while can make my day. The only drawback is that it means a lot of interruptions for the first few days. Unfortunately, technology has not come up with a way to buffer kisses yet. :-)

The Ninth stage is when things get back to normal work-liife. Which basically means that I’m really back at the First Stage again!

And the cycle continues.