Linux remote screen lock

December 29th, 2009

You can activate your linux screen saver or screen lock by running this command:

gnome-screensaver-command --lock

or

xlock

But if you ssh into your linux machine to activate the screen lock or screen saver, you might run into this error:

** Message: Failed to connect to the D-BUS daemon: dbus-launch failed to
autolaunch D-Bus session: Autolaunch error: X11 initialization failed.

or

No protocol specified
xscreensaver: Can't open display: :0.0

You have to set the DBUS_SESSION_BUS_ADDRESS environment variable in order the command to work.  You can find the current running DBUS address by first getting the process id of the running screen saver.  Then grepping for the address in the environ file.  The following script will lock your linux terminal:

#!/bin/sh

PID=`pgrep -u $USER -f "gnome-screensaver"`
DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ`
DBUS_SESSION_BUS_ADDRESS=`echo $DBUS_SESSION_BUS_ADDRESS | sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
export DBUS_SESSION_BUS_ADDRESS

gnome-screensaver-command --lock

Holy remote locking Batman!

Modern Warfare 2: Released but not recommended

November 10th, 2009

I have been urging to get my hands on a new FPS (first person shooter) game for a while now since my main FPS is the super old Battlefield 2 game! I thought about getting Modern Warfare 1 but I noticed both Modern Warfare 2 and Bad Company 2 were coming out soon. I decided to wait and see.

mw2logoWell today Modern Warfare 2 has been released! So I decided to poke around the internet to see what the word is. And my verdict is… not recommended.  I have decided that I will not buy Modern Warfare 2 based on two main deal breakers.

Deal breaker #1: 18 player limit

Say what!  That’s right, it appears that Modern Warfare 2 is limited to 18 players.  Not 18 players on each side, but 18 players total, that’s 9v9 tops.  Personally, I love playing with a huge number of players because it just feels more like the scenes from the movie Saving Private Ryan.  And I think that’s awesome.  I love the concept of organized chaos which is what you get from 32 or 64 players duking it out while sub-dividing into miniature rambo teams.  With a maximum of 9 players on your side, half of them may be dead at any one time so that really leaves you 4 guys running around at a time.

If you’re a console guy, then you’re probably saying what’s the big deal?  And I would say it’s not a big deal to you.  For console games, this is pretty much the norm and this is what you expect.  More power to you.  But I am personally a PC guy and I am accustom to games that support up to 64 players.

Deal breaker #2: no dedicated servers

Initially I didn’t even know what this meant.  This basically means Infinity Ward, the creators of the game, will not have any game servers setup for people to play on.  The game is designed to be hosted directly on one of the client’s or player’s machines.  So yes, one lucky player in a given game will be hosting the game.  Based on my experience with FPS games and ping, this may give an unfair advantage to the player hosting the game as his ping will be virtually zero.  I have on many occassions, when my ping was super low, been able to defy death, almost in an omni-potent way, seen hoards of enemy shooting at me but always missing, as if they were targeting thin air.

Conclusion

A good summary is the title I have been seeing around the internet… Modern Warfare 2, DOA.  For those who are unfamiliar with that acronym, it stands for dead on arrival and is a common phrase seen when purchasing computer hardware.

Check out the funny ratings from GameSpot and IGN.

Ratings from GameSpot and IGN

Ratings from GameSpot and IGN

For now, I will be waiting for Bad Company 2.  While I have read that it can support a maximum of 40 players, the game is still to a bit too far from release to know for sure.  So hopefully it won’t let me down.  If it does, well there is always Modern Warfare 1.

Finally, here are some direct quotes that made me laugh (disclaimer: quotes do not necessarily represent the author’s opinions):

  • Take $60 out and burn it…least you get warm -zippythezip (GameSpot)
  • it’s like mw but then crippled -ATFNeOpHyTe (GameSpot)
  • Screw you consoles!!!!!!! -ZeppelinE6 (GameSpot)
  • outside of consoles this game is already DOA -doorules (IGN)
  • If I wanted to play 9 vrs 9 on small maps I would just reinstall my old Doom disks. -jdwksu (IGN)
  • Complete and utter failure, a 10 year step back in PC gaming -Liksecken (GameSpot)

Holy bad PR, Batman!

Wordpress thumbnail generation disabled

Updated July 22nd, 2009
June 23rd, 2009

No thumbnails in your wordpress? Read on…

I noticed last night that my wordpress is not generating thumbnails from uploaded images like it’s suppose to. You’ll noticed that the size options (thumbnail, medium, large) are all disabled except for the full size.

wordpress-size-options

After doing a lot of searching, I finally found out that in order for wordpress to generate thumbnails “by default”, you need to have GD library support for your php. It would have been nice if wordpress had documented that better.

The only reference I found was this:

http://wordpress.org/support/topic/235625

To be clear, wordpress does not generate thumbnails by default unless your php instance has GD support.

Install php gd library

For me, installing GD library was easy:

# yum install php-gd

Check for gd

To check if you have GD loaded in php:

# php -m
[PHP Modules]
bz2
calendar
ctype
curl
date
dbase
exif
ftp
gd
gettext
gmp
hash
iconv