Posts Tagged ‘compiz’

Some few small insights

Wednesday, March 12th, 2008

Lately I have been overloaded above my capabilities. This did not prevent me from doing all kind of things, but most of them are too small to justify a real entry here, so I have decided to make a small collection of small stuff someone might need to know, in order to make it indexed in search engines. These small insights might save some time for someone. This is a noble cause.

1. Oreon is a nice overlay for Nagios, however, it is poorly documented, and some of the existing docs are in French. I have put hours on building it into a working setup, and I hope to be able to write down the process as is.

2. “Sun Java System Active Server Pages” does not support 64bit Linux installations – at least not if you’re interested in using it with your existing Apache server. Look here. Seems nothing has changed.

3. Under Ubuntu 7.10, Compiz suffers from a major memory leak when using NVidia display adapters. You can read about it in the bug page. I was able, thanks to this link, to workaround it using compiz –indirect-rendering . Does not see to cause any ill-effect on my display performance.

4. Suse 10 and wireless cards – This one is a great guide, which I would happily recommend.

5. Flushing the existing read buffer for your Linux machine (should never be done, unless you’re testing performance) can be done by running the following command:

echo 1 > /proc/sys/vm/drop_caches

Seems to be enough for today. Hope these tips help.

Rotate Beryl/Compiz cube from command line

Tuesday, February 19th, 2008

We are about to have a stand in a show in Israel. To pull some attention, I have searched for a method to automate a random rotation of the famous Beryl/Compiz cube.

An extension of the method provided in here (using macros) is demonstrated below, using a script.

This is a bit more complicated, as I have used the motions of the mouse to achieve a “show” out of it (just changing desktops isn’t enough nowadays…)

Check out below for the full script.

#!/bin/bash
# This script will rotate the cube one click on each direction each predefined
# timer.
# Written by ezaton at tournament.org.il
# Check out my technical blog “Running Systems” at http://www.tournmament.org.il/run

# Set timer (seconds)
TIMER=10
VERT_TIMER=1

# Possible directions? 4 (up, down, left, right. will be marked from 0 to 3)
# Addition – set it to give higher priority to side-stepping. So max is 10, and only 0&1 represent
# up/down
# Added 10 to represent 2xleft and 11 to represent 2xright
POSS=12

# Temp command file
TMP_FILE=/tmp/rotate.macro

function create_file {
# This function will create and secure the macro file
\rm $TMP_FILE
if [ -f $TMP_FILE ]; then
echo “$TMP_FILE still exists”
exit 1
fi
echo “” > $TMP_FILE
chmod 700 $TMP_FILE
}

function run_macro {
# Run the actual macro
cat $TMP_FILE | xmacroplay $DISPLAY &>/dev/null
}

function left {
# This function will build the macro file for the “left” command
echo > $TMP_FILE
echo “MotionNotify 100 380″ >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1″ >> $TMP_FILE
echo “MotionNotify 100 380″ >> $TMP_FILE
echo “MotionNotify 130 380″ >> $TMP_FILE
echo “MotionNotify 150 380″ >> $TMP_FILE
echo “MotionNotify 170 380″ >> $TMP_FILE
echo “MotionNotify 190 380″ >> $TMP_FILE
echo “MotionNotify 210 380″ >> $TMP_FILE
echo “MotionNotify 230 380″ >> $TMP_FILE
echo “MotionNotify 250 380″ >> $TMP_FILE
echo “MotionNotify 270 380″ >> $TMP_FILE
echo “MotionNotify 290 380″ >> $TMP_FILE
echo “MotionNotify 310 380″ >> $TMP_FILE
echo “MotionNotify 330 380″ >> $TMP_FILE
echo “ButtonRelease 1″ >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function up {
# This function will build the macro file for the “up” command
echo > $TMP_FILE
echo “MotionNotify 100 100″ >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1″ >> $TMP_FILE
echo “MotionNotify 100 100″ >> $TMP_FILE
echo “MotionNotify 100 120″ >> $TMP_FILE
echo “MotionNotify 100 140″ >> $TMP_FILE
echo “MotionNotify 100 160″ >> $TMP_FILE
echo “MotionNotify 100 180″ >> $TMP_FILE
echo “MotionNotify 100 200″ >> $TMP_FILE
echo “MotionNotify 100 220″ >> $TMP_FILE
echo “MotionNotify 100 240″ >> $TMP_FILE
echo “MotionNotify 100 260″ >> $TMP_FILE
echo “MotionNotify 100 280″ >> $TMP_FILE
echo “MotionNotify 100 300″ >> $TMP_FILE
echo “MotionNotify 100 320″ >> $TMP_FILE
echo “ButtonRelease 1″ >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function right {
# This function will build the macro file for the “right” command
echo > $TMP_FILE
echo “MotionNotify 340 380″ >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1″ >> $TMP_FILE
echo “MotionNotify 340 380″ >> $TMP_FILE
echo “MotionNotify 320 380″ >> $TMP_FILE
echo “MotionNotify 300 380″ >> $TMP_FILE
echo “MotionNotify 280 380″ >> $TMP_FILE
echo “MotionNotify 260 380″ >> $TMP_FILE
echo “MotionNotify 240 380″ >> $TMP_FILE
echo “MotionNotify 220 380″ >> $TMP_FILE
echo “MotionNotify 200 380″ >> $TMP_FILE
echo “MotionNotify 180 380″ >> $TMP_FILE
echo “MotionNotify 160 380″ >> $TMP_FILE
echo “MotionNotify 140 380″ >> $TMP_FILE
echo “MotionNotify 120 380″ >> $TMP_FILE
echo “ButtonRelease 1″ >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function down {
# This function will build the macro file for the “down” command
echo > $TMP_FILE
echo “MotionNotify 100 330″ >> $TMP_FILE
echo “KeyStrPress Alt_L” >> $TMP_FILE
echo “KeyStrPress Control_L” >> $TMP_FILE
echo “ButtonPress 1″ >> $TMP_FILE
echo “MotionNotify 100 330″ >> $TMP_FILE
echo “MotionNotify 100 310″ >> $TMP_FILE
echo “MotionNotify 100 290″ >> $TMP_FILE
echo “MotionNotify 100 270″ >> $TMP_FILE
echo “MotionNotify 100 250″ >> $TMP_FILE
echo “MotionNotify 100 230″ >> $TMP_FILE
echo “MotionNotify 100 210″ >> $TMP_FILE
echo “MotionNotify 100 190″ >> $TMP_FILE
echo “MotionNotify 100 170″ >> $TMP_FILE
echo “MotionNotify 100 150″ >> $TMP_FILE
echo “MotionNotify 100 130″ >> $TMP_FILE
echo “MotionNotify 100 110″ >> $TMP_FILE
echo “ButtonRelease 1″ >> $TMP_FILE
echo “KeyStrRelease Control_L” >> $TMP_FILE
echo “KeyStrRelease Alt_L” >> $TMP_FILE
run_macro
}

function fix_vert {
# Fixes a case of vertical extention (non-viewable screen)
sleep $VERT_TIMER
case “$1″ in
1) down
;;
0) up
;;
esac
}

# Verify we have xmacroplay
which xmacroplay
if [ "$?" -ne "0" ]; then
echo “Missing xmacroplay. Install it”
echo “Use apt get install xmacro”
exit 1
fi

# Do we use X and have a defined display? Won’t work otherwise…
if [ -z "$DISPLAY" ]; then
echo “DISPLAY is not defined. Exiting”
exit 1
fi

create_file

# We start where all is viewable

while true; do
# Select direction
DIRECTION=$RANDOM
let “DIRECTION %= $POSS”
# Debug:        echo “*** $DIRECTION ***”
case “$DIRECTION” in
0) up
fix_vert 1
;;
1) down
fix_vert 0
;;
[2-5]) left
;;
[6-9]) right
;;
10)     left
left
;;
11)     right
right
;;
esac
sleep $TIMER
done

exit 0

AIGLX or XGL?

Monday, April 9th, 2007

As you can see in my previous posts, I have an NVidia card. It worked quite well while using XGL, but due to XGL’s memory consumption (it takes a lot of memory), I have decided to try for AIGLX, which is part of the X.org system.

In my previous post you can see that (and how) it was done. However, my overall experiance is that AIGLX, at least where it comes to Xorg 7.2 and NVidia (Driver 1.0-9755) is that XGL is much much faster.

The slow responses of the system during the several hours I used AIGLX (while trying somehow to increase performance) just made me go back to XGL. AIGLX is not good enough.

I’ve read several posts about it, and still, the results are undetermined. That’s why I post my own software versions here. AIGLX may perform better when using older or newer versions of NVidia’s driver, or Xorg, or whatever, but for me now – XGL does it well.