Navigation
 
Search
 
Random Image
IMG_0264.JPG
 
Me. Elsewhere.
 
Archives
 
Darcy
 
Things I Like
boingboing
 
License
 
Clean Prism Install on Sidux

Mozilla PrismPrism is a sandboxed web-app tool, essentially it is Firefox for one application at a time. It’s been a while since I played with it, so I’m taking another look.

This should work on any Debian based system really, but I did it on Sidux. Here’s how I installed the latest version on my machine.

# wget http://prism.mozilla.com/downloads/1.0b1/prism-1.0b1.en-US.linux-i686.tar.bz2
--2010-01-26 16:01:08--  http://prism.mozilla.com/downloads/1.0b1/prism-1.0b1.en-US.linux-i686.tar.bz2
Resolving prism.mozilla.com... 63.245.208.216
Connecting to prism.mozilla.com|63.245.208.216|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9101612 (8.7M) [application/x-bzip2]
Saving to: “prism-1.0b1.en-US.linux-i686.tar.bz2”
 
100%[==========================================================================================================================================================================================================>] 9,101,612    212K/s   in 42s
 
2010-01-26 16:01:55 (213 KB/s) - “prism-1.0b1.en-US.linux-i686.tar.bz2” saved [9101612/9101612]
 
# mv prism /opt/prism-1.0b1
# ln -s /opt/prism-1.0b1/prism /usr/bin

At that point it should be in your path and ready to invoke!

Posted January 26th, 2010 - Permalink
Categories: Geek
Tags: , , , , ,
No Comments »
 
F@h Init Script Additions: throttle & unthrottle

As I’ve posted before, I’ve started running Folding@home on my machines. One issue I’ve found is that on a dual core machine I will sometimes bog down as F@h consumes a whole core. That plus a lot of busy Firefox tabs and my box starts to crawl.

To fix that, I added a few pieces to my F@h init script, which was originally scavenged from this site, though on Googling there is a much nicer one on the F@h wiki. You might just want to apply my changes to that one.

In any case, I just added two commands to throttle and unthrottle the F@h application using cpulimit. This way I can add a cron job to manage it, or just throttle it when it starts to bug me.

Here it is if you want it!

#!/bin/sh
 
export DIRECTORY=/var/cache/fah
USER=fah
export OUTPUT=/dev/null
 
test -f $DIRECTORY/fah6 || exit 0
 
 
title() {
  echo $1
  error=0
}
 
status() {
  error=0
}
 
case "$1" in
 
  start)
    title "Starting Folding@Home."
    cd $DIRECTORY
    su $USER -c 'nohup $DIRECTORY/fah6 >$OUTPUT 2>&1 &'
    error=$?
    status
;;
 
  stop)
    title "Stopping Folding@Home."
    killall -15 $DIRECTORY/fah6 || error=$?
    status
;;
 
  restart)
    $0 stop; $0 start
;;
 
  unthrottle)
    FHPID=$(ps aux | grep FahCore | grep [TR]N | grep -v grep | awk '{print $2}')
    CLPID=$(ps aux | grep "cpulimit -p $FHPID -l" | grep -v grep | awk '{print $2}')
    if [ "$CLPID" != "" ]; then
      echo "Killing existing cpulimit, $CLPID"
      kill -9 $CLPID
    fi
    kill -18 $FHPID # It may be in SIGSTOP, so send it a SIGCONT
;;
 
  throttle)
    $0 unthrottle;
    FHPID=$(ps aux | grep FahCore | grep [TR]N | grep -v grep | awk '{print $2}')
    if [ "$FHPID" != "" ]; then
      echo "Found process $FHPID, throttle to 50%"
      nohup cpulimit -p $FHPID -l 50 >$OUTPUT 2>&1 &
    else
      echo "Could not find fah process!"
    fi
;;
 
 
  *)
    echo "Usage: $0 { start | stop | restart | throttle | unthrottle }"
    exit 1
;;
 
esac
 
exit 0

Posted January 13th, 2010 - Permalink
Categories: Geek
Tags: , , ,
No Comments »
 
Wine Missing MFC420.DLL? Try winetricks.

I’ve been firing up my old copies of Sim Tower and Yoot Tower to, um, research for pyTower. It’s been a while since I used wine, so when Yoot Tower borked because of a missing dll ( MFC420.DLL, natch ) I hit the Google and found this great little ditty: winetricks. It’s a little script that will install all kinds of DLL’s on demand from all over the net.

It even has a GUI!
It even has a GUI!

It did the trick really fast, so I’d recommend it net time you get stuck.

Posted January 6th, 2010 - Permalink
Categories: Geek
Tags: , , ,
No Comments »
 
CentOS 5.4 Net Install

Update 2010-01-05
I tried using the VNC mode and it choked and died, making me re-download a bunch of stuff when I ran it in text mode. Just an FYI, not saying it will happen to you, but warning that it might. Honestly, I didn’t see much difference running in VNC vs. Text, you get the same options.

It appears that over the internet installation is no longer a recommended way to get CentOS. However, I can not for the life of me convince my DVD burner to write the CentOS 5.4 ISO. I did however have a live CD. So I found a nice guide for 5.3 NetInstall and adapted it, very very little has changed.

The mirror list is here and it just so happens that UNL is a full mirror. So, thanks UNL!

Posted January 5th, 2010 - Permalink
Categories: Consume - Geek
Tags: , ,
No Comments »
 
F@H Team Statistics Scraper

I created a team for Little Filament on Folding@home. Our team number is 172406 (in case you want to join), but I wanted to add our latest stats on the Little Filament site. As far as I can tell there is no API for the stats, so I worked up a scraper in bash.

Basically all it does is fetch the page, then grep and sed it’s way to the variables, finally dumping them into a json file (for easy JavaScript consumption).

The kicker is that the stats server is overloaded or down a lot, so we can’t rely on it and we don’t want to stress it out further. My decision was to poll it at a large interval, 12-24 hours. I don’t have enough clients on the team to exact significant change over 6-12 hours, but I don’t want to fall too far out of date either. So if the server is overloaded and drops it once or twice, not a big deal.

Without further ado, here is the script.

#!/bin/bash
 
NOW=$(date +%s)
THEN=$(cat fah_check.lock | tr -d '\n')
 
if [ $NOW -gt $(($THEN + 86400)) ]; then
	wget "http://fah-web.stanford.edu/cgi-bin/main.py?qtype=teampage&teamnum=172406" -O fah_check.html
	if [ "$?" == "0" ]; then
		grep "Grand Score" fah_check.html > /dev/null 2&>1
		if [ "$?" == "0" ]; then
			SCORE=$(grep -C 2 "Grand Score" fah_check.html | sed 's/[^0-9]//gm' | tr -d '\n')
			WU=$(grep -C 2 "Work Unit Count" fah_check.html | sed 's/[^0-9]//gm' | tr -d '\n')
			RANK=$(grep -C 1 "Team Ranking" fah_check.html | sed 's/[^0-9of]//gm' | tr -d '\n' | sed 's/f\([0-9]*\)of\([0-9]*\)/\1 of \2/')
			echo "{\"score\": \"$SCORE\", \"work_units\": \"$WU\", \"rank\": \"$RANK\" }" > fah_check.json
			echo "[$NOW] - Success!" >> fah_check.log
			echo $NOW > fah_check.lock
		else
			echo "[$NOW] - Filter Failed" >> fah_check.log
		fi
	else
		echo "[$NOW] - Download Failed" >> fah_check.log
	fi
else
	echo "[$NOW] - Skip Update" >> fah_check.log
fi

That cranks out fah_check.json, which looks like this:

{"score": "4355", "work_units": "20", "rank": "39881 of 169721" }

To see it in action, check out the Little Filament Folding page.

Posted December 11th, 2009 - Permalink
Categories: Geek
Tags: , , , ,
1 Comment »
 
More Posts
 
Copyright © 2006 - 2010 John Hobbs