my life

day to day

Archive for the 'uncategorized' Category

Compiz + Cairo Dock on Debian

Tuesday, November 18th, 2008

Sorry to say it, but X.org eye candy is about to eclipse Mac OSX. Check out this video to see what I mean:

To get this for yourself on Debian, these are the steps I had to take.

  1. apt-get install libcairo2 librsvg2-2 libglitz1 libglitz-glx1 compiz compiz-fusion-plugins-extra compiz-fusion-plugins-main compiz-gnome compiz-plugins
  2. Modify your X.org conf in /etc/X11/xorg.conf
  3. Add the following to the “Device” section:
    Option “AllowGLXWithComposite” “true” Option “XAANoOffscreenPixmaps” “true”  #NVidia cards only

    Add the following to the “Screen” section:
    Option “AddARGBGLXVisuals” “true”  # NVidia cards only

    Add the new section:
    Section “Extensions” Option  “Composite”      “Enable” EndSection
  4. Enable all the cool features of compiz:
    gconftool --set /apps/compiz/general/allscreens/options/active_plugin --type list --list-type string ‘[gconf,png,svg,decoration,wobbly,fade,minimize,cube,rotate,zoom,scale,move,place,switcher,screenshot,resize]‘
  5. echo “export WINDOW_MANAGER=/usr/bin/compiz” >> ~/.gnomerc
  6. Restart Xorg

If you’re having problems, you can try to download:

wget http://blogage.de/files/3855/download?compiz-check_0.4-1_all.deb

And run compiz-check to see if there are any issues with your setup/hardware.

To get the features of OSX’s Docker, you’re going to want to install Cairo-Docker. Cairo-Docker is actually even MORE incredible than the traditional Docker, allowing for plugins and customization to the Nth degree.

  1. Download Cairo at:
    https://developer.berlios.de/project/showfiles.php?group_id=8724
  2. Download the dock package that looks like: cairo-dock_v1.6.3.1_i686.deb
  3. Download the plugins package that looks like: cairo-dock-plug-ins_v1.6.3.1_i686.deb
  4. dpkg -i package.deb
  5. Simply run: cairo-dock
add to del.icio.us    add to technorati favs   email this

VMWare Upgrades

Thursday, September 25th, 2008

VMWare can be a real bore to upgrade when there are major kernel updates. Very often, the supplied modules with VMWare will not compile.

For example, I got this today:

CC [M]  /tmp/vmware-config0/vmmon-only/linux/driver.o /tmp/vmware-config0/vmmon-only/linux/driver.c:197: error: unknown field ‘nopage’ specified in initializer /tmp/vmware-config0/vmmon-only/linux/driver.c:198: warning: initialization from incompatible pointer type make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1

The solution is always to use the non-standard installer available at:
http://groups.google.com/group/vmkernelnewbies/files?pli=1

Download the latest vmware-any-any-update tarball, decompress it, and run the included runme.pl script inside. It works just like the vmware-install.pl script distributed with VMWare, but this version includes patches to make everything run without a hitch.

add to del.icio.us    add to technorati favs   email this

Starling Protocol Bug in STATS Response

Friday, July 18th, 2008

The memcache protocol requires that all lines in the server response end with CRLN (\r\n). The Starling server doesn’t strictly obey this for the STATS command. The fix is trivial and the author has been notified of the fix.

Edit lib/starling/handler.rb and add the following gsub right before .freeze in the STATS_RESPONSE:

%sEND\r\n”.gsub(/\r?\n/, “\r\n”).freeze

And the same for QUEUE_STATS_RESPONSE:
STAT queue_%s_expired_items %d\n”.gsub(/\r?\n/, “\r\n”).freeze

add to del.icio.us    add to technorati favs   email this

What to do if spl_autoload_call() hasn’t defined the class

Saturday, July 5th, 2008

Recently, I was getting the error

Warning: session_start() [function.session-start]: Function spl_autoload_call() hasn’t defined the class it was called for in…

In my particular case, the problem stemmed from defining a deserialization function using

ini_set(’unserialize_callback_func’, ’spl_autoload_call’)
(well, symfony defines it)

In the process of deserializing an object, it tried to instantiate a class which hadn’t yet been loaded. The autoloader wasn’t able to find the class and the spl autoload functionality therefore croaked.

The problem was that I had defined a property inside of one my model objects that referenced the sfWebRequest. This property should never have been serialized. Infact, only the properties of the object as defined in model should get serialized. The fix was defined a __sleep method in the model.

public function __sleep() { return MySampleObjectPeer::getFieldNames(BasePeer::TYPE_FIELDNAME); }

Replace MySampleObjectPeer with the appropriate peer class.

add to del.icio.us    add to technorati favs   email this

Nginx Rewrite to 404

Wednesday, May 14th, 2008

The following Nginx configuration technique will allow you to do rewrites to status codes.

rewrite ^.*?\.(?:swf|xml|gif|jpg|png|css|js)$ @404 break; location = @404 { return 404; }

add to del.icio.us    add to technorati favs   email this

Must have Yum Plugin: fastestmirror

Wednesday, April 30th, 2008
Yum always gets stuck on dead mirrors or slow mirrors. Avoid this by installing yum-fastestmirror
yum install yum-fastestmirror yum clean all
add to del.icio.us    add to technorati favs   email this

RPM Package List Without Version Info

Wednesday, April 30th, 2008

rpm -qa --qf “%{NAME}\n”  > /tmp/installed-packages.log

To install those packages, run:

yum install -y $(cat /tmp/installed-packages.log)

add to del.icio.us    add to technorati favs   email this