VMware remote console Firefox plug-in and arrow keys

June 30th, 2009 Mohammad Al-Shami 2 comments

VMware remote console was working properly for me when I was using Ubuntu Hardy. After upgrading to Jaunty the arrow keys stopped working inside the remote console. Seems some people face this problem even under windows.

A search got me to this:

echo xkeymap.nokeycodeMap="TRUE" > ~/.vmware/config

Just close any open remote consoles and open up again and you’re in business.

Lighttpd, Joomla, and clean URLs

June 22nd, 2009 Mohammad Al-Shami No comments

So I’m working on a new web server but I don’t want to use Apache since it’s a virtual machine. Had some trouble with the rewirte rules but I think I got them

From this forum post


$HTTP["url"] !~ "\.(gif|png|css|jpg|jpeg|js)$" {
   server.error-handler-404 = "/index.php"
}

But I thought of a different approach and it seems to work so far, and maybe causes less error messages in the logs:


url.rewrite-once = ("^/(.*\.html)$" => "/index.php?page=$1", "^/(.*\.html\?.*)" => "/index.php?page=$1", "^/(.*/\?.*)" => "/index.php?page=$1")

Have a good one

Microsoft Community Night

May 30th, 2009 Mohammad Al-Shami 2 comments

So I went to a community night hosted at the Microsoft Innovation Center here in Amman with my friend Bander which he told me was interesting. Even though I knew I was going to be the only non-Microsoft guy there I thought I should check it out.

The session was about using Silverlight with Sharepoint. I have to say I was pleasantly surprised with Silverlight’s capabilities. I only thought it was a Flash competitor, but it turned out to be more than that.

At the end of the session the host had a Sharepoint 2007 best practices book to give away. The organizers decided to ask a question and give the book to the person who answers it.

The funny thing was that I was the only person who knew the answer, and I was given the book. That’s when Bander jumped saying “Don’t give him the book! Don’t give him the book! He’s a Linux guy, 2 weeks ago he didn’t even know what Sharepoint is” :D

Anyways, fun night, and I’d like to play with Sharepoint and Silverlight and see what they’re capable of.

Categories: Misc Tags:

Throttling outgoing emails to certain domains with Postfix

March 29th, 2009 Mohammad Al-Shami No comments

I’ve been busy setting up a PHPlist server for my employer. All tests went ok, but as soon as we sent our first newsletter Yahoo! blocked the server. After looking around for a solution people suggested we sign all outgoing emails with DomainKeys and not hammer Yahoo’s servers with consecutive connection.

Using DomainKeys was a simple setup with DKIMproxy, as for throttling, you all know Postfix is one high performance MTA, so that would be hard to do. PHPlist has a throttling feature but I didn’t want to use that because it would slow emails going to all domains and it took about half a day to send messages to about 6,000 users. That is unacceptable.

After some more digging around I found that Postfix 2.5 introduced the perfect solution, here you go:

First, add the following lines to your master.cf


domain1      unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=
domain2      unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=
domain3      unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=

Now, to use those transports add these lines to your transport_maps file


domain1.tld    domain1:
domain2.tld    domain2:
domain3.tld    domain3:

Finally, set the destination_rate_delay for those transports in main.cf


domain1_destination_rate_delay = 10s
domain2_destination_rate_delay = 20s
domain3_destination_rate_delay = 30s

This will effectively send all outgoing messages at full speed, except for messages going to domain1.tld, domain2.tld, and domain3.tld; Postfix will wait 10/20/30 seconds after sending each message to domain1.tld/domain2.tld/domain3.tld.

Categories: Mail Tags:

Fixing MySQL Error 1064 with PHPList when selecting new criteria

March 14th, 2009 Mohammad Al-Shami 8 comments

I’m currently experimenting with PHPlist to use for our corporate newsletters. During the tests I got the following error

Database error 1064 while doing query You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘1)’ at line 3

Tracking this problem down I found the following code segment in “admin/send_core.php”


if (is_array($_POST["criteria_values"])) {
$values = join(", ",$_POST["criteria_values"]);
} else {
$values = $_POST["criteria_values"];
}

$values in this segment will always start with a comma. We just need to add a substr statement to fix that. Just change it to


if (is_array($_POST["criteria_values"])) {
$values = join(", ",$_POST["criteria_values"]);
} else {
$values = $_POST["criteria_values"];
}
if (substr($values, 0, 1) == ",") {
$values = substr($values, 1);
}

That’s it. This will remove the starting comma (If it exists)

Categories: Mail, Technical Tags:

Solving the frowning issue

February 28th, 2009 Mohammad Al-Shami No comments

Jordanians are known for frowning. I hereby propose a cheap, yet efficient solution:

First, get a couple of paper clips and a couple of rubber bands


Attach as follows
Now install

Just make sure the rubber bands are stronger than your frown :)

Categories: Funny Tags:

Happy Valentine’s Day

February 14th, 2009 Mohammad Al-Shami No comments

For all of you out there, happy Valentine’s Day. Yeah right! I don’t celebrate it, there are more important things in this world, just look at the comic below, inspired by real Jordanian lives.

Translation: Abu-Mahjoob celebrating Valentine’s Day.

Categories: Funny Tags:

Empathy, the new kid on the block

February 5th, 2009 Mohammad Al-Shami No comments

If you’ve used Linux as a desktop, you’ll know it’s only playing catch-up when it comes to instant messaging. I’ve been using Pidgin since was called Gaim, I think I started using it back in 2003. I love how minimalistic it is. Sadly the developers are going nowhere with it, at least that’s my (as well as a few others) humble opinion.

I stumbled upon this post which mentions a new (or maybe just new to me) client called Empathy. After playing with it for a few days now I think it has great potential. It’s still pretty basic but also under heavy development. It’s very minimalistic and uses the Telepathy library, which IMHO is a better approach than Pidgin’s libpurple.

It still doesn’t have proxy support, but you can work around that, at least for MSN and Gtalk, the protocols that I use. Here is how I did it it:

Gtalk: Just create a tunnel with SSH


ssh -C -q -f -M 0 -N -L 5223:209.85.137.125:5223

Where 209.85.137.125 is the IP address of talk.google.com, then set the account to use localhost as a server

MSN is a little different, this trick didn’t work because the client connects to a login server, which redirects the client to a different server. MSN is implemented using the telepathy-butterfly executable. Just use a socks server like this:


mv /usr/lib/telepathy/telepathy-butterfly /usr/lib/telepathy/telepathy-butterfly-old
vi /usr/lib/telepathy/telepathy-butterfly

#!/bin/bash
exec /usr/bin/tsocks /usr/lib/telepathy/telepathy-butterfly-old

chmod +x /usr/lib/telepathy/telepathy-butterfly

Enjoy :)

Categories: Linux Tags:

Alf mabrook Tamer

February 5th, 2009 Mohammad Al-Shami No comments

This is a shout out to my old friend Tamer, yet another fallen soldier from the ranks of bachelorism. We attended his wedding last night it was awesome!

Congrats man and good luck on your new life

Categories: Misc Tags:

Xbox 360

February 2nd, 2009 Mohammad Al-Shami 4 comments

So I finally coughed up the money to get an Xbox 360, the thing is, every store that sells the Xbox in Jordan is highly overpriced (423$ as opposed to 199$ for the Arcade version) and the consoles are VERY old, dating back to 2007. This means they are using the old chips which are highly not recommended. A friend of mine, Tamer, came from Bahrain Friday and was kind enough to pick up the console for me. Thanks man ^_^.

I just had to take some pictures of the event. Enjoy :)


Categories: Misc Tags: