Room Interaction: Money Exchange (RIME)

C called me.  Evidently Queen Glitter and D had sent G a letter.  G felt the letter was rude and didn’t want to participate in any discussions concerning it.  C is just tired from working all the time at her teaching position and wanted the girls to stop talking, talking, yelling about it.  C read the first line or so of the letter and agreed it was rude because it had the word threat in it.  D is incredibly upset and they all decided they should call me and I should talk (aka listen) to D about it all the way home.

Here’s the Letter in full:


Dear G.M.[Last Name Omitted],

It has come to my attention that you
have just taken back your second threat
in the past two weeks to leave the difference
dollar program.  Not very many rooms trust
you right now, because they are confused
as to why you almost left the difference
dollar system those past few times.  They
are reluctant to rely on you out of fear you
might become a criminal room.  I would like
to extend this invitation to a meeting with
D and I that would be shown to every room owner,
to help them better understand what's going on.  D
and I will ask you questions about the incidents,
and you can ask us question too, if it would help.
Please tell D if you can meet us on 11/4/09
after school for the meeting.  If you have something
planned but still want to go, tell D, and we'll arrange
another date. Hope this helps!

Sincerely,
Queen Glitter

Turns out that G and her room were considering pulling out of the “Room Interaction: Money Exchange” otherwise know as RIME. D spent 30 minutes explaining to me how after G and D created unlimited credit cards the Rooms’ economy crashed and they came up after a week or so with the RIME based on the difference dollar. It has interesting characteristics. First because G and D’s rooms are so close together money exchanges hands because of fees and services as both rooms have the same hard goods. Second, if a room refuses to pay, the value of the difference dollars rise. These difference dollars are smart and know their own value. If the room continues to refuse to pay, there are ghosts go into the rooms and collect the dollars. Etc., Etc. Etc.

For the entire 30 minute drive home, I was stepped through arcane imaginary economic law. Not a single repetition of a rule or point and D didn’t finish explaining it to me.

In the end, G and her room decided to remain in the RIME.

Sage and PyQt4

I wanted to use Qt4 as a backend for Sage’s matplotlib.  This wasn’t as hard as I thought it was going to be.  This “all done for you” systems always leave me stymied when I want to do something.  Sage had some really nice surprises (dare I say gifts) in this regard.

The basic steps for installing your favorite Python package into Sage seems to be:

  1. Pull down the package
  2. Unextract it (e.g. tar -xzf <package.tgz>
  3. Create an spkg (sage pkg) by writing a spkg-install and tarring it up with a spkg extension.
  4. Installing the spkg by running `sage -i <package>.spkg`
  5. Dropping into sage sh to fix whatever goes wrong (following the instruction spit out by sage when the installation fails).

To get started, I installed the latest Sage.  I unpacked this into a local directory and made a soft link to the sage executable.

I then pulled down PyQt and sip from Riverbank.  I unpacked these in a local directory.  For both packages, I did the following:


mv packagedir src
mkdir packagedir
mv src packagedir/
cd packagedir
cat > spkg-install
#!/bin/sh
cd src
# Now build and install.
python configure.py
make
make install
if [ $? -ne 0 ]; then
echo "Error building PyQt4."
exit 1
fi
^D
cd ..
tar -cvf package.spkg packagedir

Then I ran sage -i for the sip package and this went perfectly.  The PyQt had issues because I have both Qt3 and Qt4 installed on my system.  Following the cool sage install output I dropped into the sage -sh shell and manually ran the steps in the PyQt’s spkg-install script.  Specifically, I had to run the pythong configure.py with the -q <path to Qt4 qmake> and the -g option (something to do about libraries).

sage -pylab works for normal plotting.  However, it barfs for function plotting e.g plot([sin,cos]).  Sigh.  Guess that is why they don’t use it.

Evil at 2.67 GHz

I am threatening the computer. “Do what I want or I will hurt you.” The computer is grinding its hard disk back. Its got 2 cores, each running evil at 2.67 GHz.

My computer runs a SIP client. One day when I was cursing the computer, the computer decided (on purpose?) to auto answer the phone. D’s little friend’s voice trembled as she said “uh, Mr. Erg?”

We are in the Terminator times.

Dancing?

During Thanksgiving break, G, 9, asked C, >9, “doesn’t dancing make you feel young?”

G is taking ball room dancing this year. She is smart enough not to ask me to dance with her because I might break her feet.

Vacation

We rented a small house in Austin. It comes with WiFi internet access. The internet is everywhere – I can access work, my house system, make VoIP calls like I am home, see what’s going on at our home library, compile software, whatever.

G and D’s stuffed animals have been playing a card game. Sealy doesn’t play very well cause she spends most of the time thinking about how she is a cutie-poo.

We are staying right off of South Congress. One of the coolest-hipest places in Austin (just minutes South of the capital and UT). C has a friend who lives in this neighborhood — her friend was cool in high school too. They live in a house on the West side of Congres with a small yard. They have chickens who lay eggs. A hippy plumber neighbour who fixes their toilets.

Yesterday, we went to see the capitol. It was done up really nice for visitors but no one was there. It felt as if Disney had come in and spent a bunch of money but no one showed up.

Movies that Age Well

To have something to talk about over beer, I started naming movies that I thought that I aged well.  When I listed off Sneakers the table agreed with me that it was as still bad as ever.  I was stunned.  It was good then and it’s good now.

Star Wars IV and up haven’t done too well.  Not because of the Lucas freshening but because somehow Luke whines more and more each time I see them.

2001 A Space Odyssey should be put away in a target at a military missile test range.  These days anyone who can watch that whole movie must have a sad life.  Were the late 60’s so boring that this movie was worth going to?

Using Consolehelper to enable PPTP login

I use fedora core 10 on a linux server that I assign a static IP to.  I also log into my work using PPTP on this same computer.  While Network Manager seems to handle the static IP, I could not get it to bring up the PPTP session.  I finally gave up and decided to configure the PPTP session manual.

I wrote 2 scripts: goWork and stopWork (note that Work is capitalized).  I wanted to run this when I pressed an icon on the gnome tool bar but these scripts need to run as root.  After some research, I found that I wanted to use /usr/bin/consolehelper.

To enable this I did the following (note there is a punch line at the end):

  1. Put goWork and stopWork in /usr/sbin.
  2. chmod 755 /usr/sbin/goWork and chmod 755 /usr/sbin/stopWork
  3. Added files named goWork and stopWork in /etc/security/console.apps
  4. Added files named goWork and stopWork in /etc/pam.d/
  5. Added links in /usr/bin pointing to consolehelper
  6. Added application-launchers on the gnome panel to goWork and stopWork

The problem is it didn’t work at all.  There are a bunch of options in the /etc/security/console.apps and /etc/pam.d files so I got to spend hours trying different things out.  Finally, I found something on the web stating that pam.d or consolehelper didn’t work with files with capital letters!  I changed everything to gowork and stopwork and it all worked fine.  Evidentally this is a long term problem (link) from 2005.  Guess this explains why all the Fedora management utilities are named in lower case.

Fedora Core 8 using ‘alternatives’ to install Sun’s jdk

I have some old-ish java software that I needed to get going on Fedora Core 8. The icedtea java stuff never seems to work for me. I usually pull down the java sdk from Sun and then manually change all the things in the path, mozilla directories and my environment variables until I can get java to work. I decide this time to invest some time trying to figure out the right way to do it.
First I installed java (1.6 sdk), Sun now puts their stuff in /usr/java. There is a /usr/java/default link to a latest directory which links to the version I installed.


[root@h ~]# ls -l /usr/java
total 16
lrwxrwxrwx 1 root root   16 2008-08-07 13:18 default -> /usr/java/latest
drwxr-xr-x 9 root root 4096 2008-08-07 13:18 jdk1.6.0_07
lrwxrwxrwx 1 root root   21 2008-08-07 13:18 latest -> /usr/java/jdk1.6.0_07

FC8 has a utility called alternatives. This utility controls the links to standard utilities so that your machine can have different packages of these utilities and you can select which package you use. For example, java (the run time VM):

lrwxrwxrwx 1 root root 22 2008-08-01 09:44 /usr/bin/java -> /etc/alternatives/java
lrwxrwxrwx 1 root root 26 2008-08-18 16:30 /etc/alternatives/java -> /usr/java/default/bin/java

The alternatives utility set this link up. Alternatives has a concept of a master links and slave links. Master links have a name (e.g. java). The master’s slave links follow the master link. When you select a different link with alternatives, it changes the master link and the slave links.

To see the different options for a master link, you can run ‘alternatives –display <name>’. For example:


]# alternatives --display java
java - status is manual.
 link currently points to /usr/java/default/bin/java
/usr/lib/jvm/jre-1.5.0-gcj/bin/java - priority 1500
 slave keytool: /usr/lib/jvm/jre-1.5.0-gcj/bin/keytool
 slave rmiregistry: /usr/lib/jvm/jre-1.5.0-gcj/bin/rmiregistry
 slave jre_exports: /usr/lib/jvm-exports/jre-1.5.0-gcj
 slave jre: /usr/lib/jvm/jre-1.5.0-gcj
/usr/java/default/bin/java - priority 2000
 slave keytool: /usr/java/jdk1.6.0_07/bin/keytool
 slave rmiregistry: /usr/java/jdk1.6.0_07/bin/rmiregistry
 slave jre_exports: /usr/lib/jvm-exports/jre-1.5.0-gcj
 slave jre: /usr/java/default/jre
Current `best' version is /usr/java/default/bin/java.

The output here says that the java link is set manually. (Automatic would set it best on the priority). The link currently points to /usr/java/default/bin/java. You can also see the slave links that go along with it.

To change the link, you can run ‘alternatives –config java’.


]# alternatives --display java
java - status is manual.
 link currently points to /usr/java/default/bin/java
/usr/lib/jvm/jre-1.5.0-gcj/bin/java - priority 1500
 slave keytool: /usr/lib/jvm/jre-1.5.0-gcj/bin/keytool
 slave rmiregistry: /usr/lib/jvm/jre-1.5.0-gcj/bin/rmiregistry
 slave jre_exports: /usr/lib/jvm-exports/jre-1.5.0-gcj
 slave jre: /usr/lib/jvm/jre-1.5.0-gcj
/usr/java/default/bin/java - priority 2000
 slave keytool: /usr/java/jdk1.6.0_07/bin/keytool
 slave rmiregistry: /usr/java/jdk1.6.0_07/bin/rmiregistry
 slave jre_exports: /usr/lib/jvm-exports/jre-1.5.0-gcj
 slave jre: /usr/java/default/jre
Current `best' version is /usr/java/default/bin/java.
[root@fstats ~]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 2           /usr/java/default/bin/java

Enter to keep the current selection[+], or type selection number:

Then you just pick the number you want. The problem now is how do you have Sun’s java as an alternative? After playing around for a bit, here’s the script that worked for me:


#!/bin/bash

alternatives --verbose --install /usr/bin/java java /usr/java/default/bin/java 2000 \
  --slave /usr/lib/jvm/jre jre /usr/java/default/jre \
  --slave /usr/lib/jvm-exports/jre jre_exports /usr/lib/jvm-exports/jre-1.5.0-gcj \
  --slave /usr/bin/keytool keytool /usr/java/jdk1.6.0_07/bin/keytool \
  --slave /usr/bin/rmiregistry rmiregistry /usr/java/jdk1.6.0_07/bin/rmiregistry

alternatives --verbose --install /usr/bin/javac javac /usr/java/default/bin/javac \
2000  --slave /usr/lib/jvm/java java_sdk /usr/java/default \
  --slave /usr/lib/jvm-exports/java java_sdk_exports /usr/lib/jvm-exports/java-1.5.0-gcj \
  --slave /usr/bin/javadoc javadoc /usr/java/default/bin/javadoc \
  --slave /usr/bin/javah javah /usr/java/default/bin/javah \
  --slave /usr/bin/jar jar /usr/java/default/bin/jar \
  --slave /usr/bin/jarsigner jarsigner /usr/java/default/bin/jarsigner \
  --slave /usr/bin/appletviewer appletviewer /usr/java/default/bin/appletviewer \
  --slave /usr/bin/rmic rmic /usr/java/default/bin/rmic

There is stuff out on the web that kind of explains this but I had trouble with a few things. Here is the man entry for the config command:


alternatives [options] --install link name path priority [--slave link name path]... [--initscript service]

The link is the link on your path (e.g. /usr/bin/java) not the link in the /etc/alternatives directory. The name is the master link name (e.g. java). The path is where you new stuff is (e.g. /usr/java/default/bin/java). The slave links have names too.

Terrific, how do you find out what all nasty slave links and names should be in your ‘alternatives –config’ command line? You can look at ‘alternatives –display’ output but it doesn’t tell you install link (e.g. /usr/bin/java). I don’t know why this is — you should be able to use the tool to display everything you need to install an alternative.

Anyway, here’s the punch line. You can goto the /var/lib/alternatives directory and there is a file in there for every master link. For example, here is my /var/lib/alternatives/java:


auto
/usr/bin/java
keytool
/usr/bin/keytool
orbd
/usr/bin/orbd
pack200
/usr/bin/pack200
policytool
/usr/bin/policytool
rmid
/usr/bin/rmid
rmiregistry
/usr/bin/rmiregistry
servertool
/usr/bin/servertool
tnameserv
/usr/bin/tnameserv
unpack200
/usr/bin/unpack200
jre_exports
/usr/lib/jvm-exports/jre
jre
/usr/lib/jvm/jre
java.1.gz
/usr/share/man/man1/java.1.gz
keytool.1.gz
/usr/share/man/man1/keytool.1.gz
...

Note that there are a bunch of entries that aren’t listed by ‘alternatives –config’ or ‘alternatives –display’.  I ignored those when I wrote my ‘alternatives –install’ script.

I am sure that there are things that I did wrong here but it seems to work and allows me to switch back and forth between Icedtea and Sun’s java.

Creative Webcam on Fedora Core 8

Spent a lot of time this morning trying to get a Creative Webcam on Fedora Core 8 (FC8). My goal was to get streaming working from the webcam. Man, this was a pain and its still not really working. Here is what I did.

I plugged the webcam in. It didn’t just work — nothing popped up on my desktop. Dang.


[root@bigbird ~]# lsusb
...
Bus 005 Device 002: ID 041e:4034 Creative Technology, Ltd
...

Then I dorked around on the net and starting yum-ming everything that I could find related to webcam.

The one that seemed to work is here. I kinda half followed the directions. The atrpms was already in my /etc/yum.repos.d/atrpms.repo file. I just enabled the stable by setting enabled=1 (it was 0). I then did the following.


yum install gspcav1
yum install uvc
yum install camE
yum install camstream

I rebooted and camE worked.

I then tried to figure out streaming. Man, what a confusing mess. I pulled up vlc. When you open the device in vlc (video0), at the bottom of the page is a box for streaming. Select that box and then click on settings. Select “play locally” and “HTTP”. For the encapsulation method select “Ogg”. For the transcoding options, select “Video Codec” and then mp4v in the drop down. Under Miscellaneous check “Select all elementary streams” and set the time to live to 8. Then press OK.

To view this stream with mplayer, try the following:


mplayer http://localhost:1234

The ogg encapsulation is the only encap that seemed to let mplayer find the fps. I could not figure out how to find the fps on the other methods.

Note that I believe that you will need to fix the firewall (iptables) and probably something in SE Linux to get this stream off your linux box. Here’s a link that might help.