Wednesday, February 27, 2008

what kind of bs is this?

Source: (http://www.bankrate.com/brm/news/cc/20050624b1.asp)

i didn't know that amex tacked on an extra 2% when i used my card overseas! wtf.

five miles

i ran five miles on the treadmill on monday night and my knee felt fine. there's about two months until the bsr. i'm planning on starting my training plan on monday. four runs a week for nine weeks. ugh.

i'm also planning on the clean air 5k.

no, i'm not talking about the illmatic

i'm talking about network attached storage. DO WANT!

Saturday, February 16, 2008

azureus and x86 opensolaris and webui

ok, here are my notes about how i got x86 opensolaris running with azureus running in headless mode with a web interface as an smf service. i'm hoping that this might help somebody out there. i'm running nevada b81 by the way. also of note is that i have limited unix/solaris knowledge so i'm not really sure what i'm talking about.

the first thing you need to do is to get pkg-get from blastwave.org going if you haven't already done so. you'll need to install wget, nano if you're not a dork, and screen. once you have those packages installed, download the azureus 2.5.x binaries for solaris x86 via wget or whatever. unzip it and copy the azureus directory into /usr

in order to get the web ui working, we need to get the azureus command line ui working first. the azureus cli requires log4j and commons-cli in /usr/azureus (or whatever your home azureus directory is). both jar files can be downloaded from here.

before we get into the shell scripting part, create a new user called azureus with a home directory of /export/home/azureus (make sure the azureus user owns it!). add the azureus user to whatever group you want and you should grant ownership of the azureus home directory to azureus via chown -R azureus /usr/azureus. to get azureus running, we need to edit the /usr/azureus/azureus script that actually launches azureus. first, make a backup copy of the azureus file because you might want to use the gtk ui later. second, change PROGRAM_DIR="/usr/azureus" near the top. third, change this part at the end that actually launches azureus:

echo "${JAVA_PROGRAM_DIR}java -Xms16m -Xmx128m -cp \"${CLASSPATH}\" -Djava.library.path=\"${PROGRAM_DIR}\" -Dazureus.install.path=\"$PROGRAM_DIR\" org.gudy.azureus2.ui.common.Main --ui=console '$@'" ${JAVA_PROGRAM_DIR}java -Xms16m -Xmx128m -cp "${CLASSPATH}" -Djava.library.path="${PROGRAM_DIR}" -Dazureus.install.path="${PROGRAM_DIR}" org.gudy.azureus2.ui.common.Main --ui=console "$@"
i had problems getting java -jar working so i changed it to invoke the main class directly. and don't forget the --ui=console. i found this to work well for me but your mileage may vary.

ok, you should login or su over to your azureus user and try running the ./azureus script. with luck, azureus should start and spitting all sorts of text to the console. it should also tell you that a newer version of azureus is out but you don't have to pay attention to that. we need to set two configuration parameters via this command line to set azureus to download files in certain directory (/export/downloads in this case but you can do whatever you want. i have mine going into a zfs pool) and where to save its working directory (in this case, i think because of the default data dir setting, it will be in /export/home/azureus/.azureus and you need ls -a to see it)

set "Default save path" "/export/downloads" string set "Use default data dir" true boolean
once that is set, let's go back and download an azureus web interface plugin. i've had good luck with this swing-based webui plugin. get the 1.6.10 version as we are using a 2.5.x azureus. the installation instructions are pretty straightforward. just unzip the archive into /usr/azureus/plugins/webui and restart azureus. you'll know if it works if you run show options and you see Plugin.webui.* properties in the list. try connecting to the swing ui via a web browser on port 6883. hope your browser has the java plugin! ok, we now have azureus up and running in the command line and serving up a web interface, which is perfect for a headless nas box. we just need to get azureus running as a daemon that starts running on boot. the first step towards this is a bash script that uses that screen package that we installed earlier. i made a slight derivative of this awesome script on the azureus wiki. create it in your azureus home directory and call it azureus_script:
#! /bin/sh #The user that will run Azureus AZ_USER=azureus #Name of the screen-session NAME=azureus_screen #executable files in the following paths that are perhaps needed by the script PATH=/bin:/usr/bin:/sbin:/usr/sbin:/opt/csw/bin #your path to the azureus directory, where Azureus2.jar is located DIR=/usr/azureus SCREEN=/opt/csw/bin/screen #Description DESC="Azureus screen daemon" case "$1" in start) if [[ `$SCREEN -ls |grep $NAME` ]] then echo "Azureus is already running!" else echo "Starting $DESC: $NAME" cd $DIR; $SCREEN -dmS $NAME ./azureus fi ;; stop) if [[ `$SCREEN -ls |grep $NAME` ]] then echo -n "Stopping $DESC: $NAME" $SCREEN -X quit echo " ... done." else echo "Coulnd't find a running $DESC" fi ;; restart) if [[ `$SCREEN -ls |grep $NAME` ]] then echo -n "Stopping $DESC: $NAME" $SCREEN -X quit echo " ... done." else echo "Coulnd't find a running $DESC" fi echo "Starting $DESC: $NAME" cd $DIR; $SCREEN -dmS $NAME ./azureus echo " ... done." ;; status) if [[ `$SCREEN -ls |grep $NAME` ]] then echo "Azureus is RUNNING" else echo "Azureus is DOWN" fi ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 ;; esac exit 0
the original script called su azureus -c "stuff" and i found that it didn't work out for me at all so i got rid of the su's. don't worry though, the azureus user account that we created will still come into play later. test this script with ./azureus_script start, ./azureus_script status to see if its running or not (try loading the webui too!) and ./azureus_script stop to shut it down. ok, this last final part is to integrate this daemon script with smf. we'll need manifest file that describes this shell script as a smf service. i used this example here as a template. create this meta.xml file in your azureus home directory.
<?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <service_bundle type='manifest' name='azureus_headless'> <service name='application/azureus_headless' type='service' version='1'> <create_default_instance enabled='false' /> <single_instance /> <dependency name='multi-user-server' grouping='optional_all' type='service' restart_on='none'> <service_fmri value='svc:/milestone/multi-user-server' /> </dependency> <exec_method type='method' name='start' exec='/usr/azureus/azureus_script %m' timeout_seconds='60'> <method_context> <method_credential user='azureus' /> </method_context> </exec_method> <exec_method type='method' name='restart' exec='/usr/azureus/azureus_script %m' timeout_seconds='60'> <method_context> <method_credential user='azureus' /> </method_context> </exec_method> <exec_method type='method' name='stop' exec='/usr/azureus/azureus_script %m' timeout_seconds='60' > <method_context> <method_credential user='azureus' /> </method_context> </exec_method> <property_group name='startd' type='framework'> <propval name='duration' type='astring' value='contract' /> </property_group> <template> <common_name> <loctext xml:lang='C'> Azureus in headless mode </loctext> </common_name> </template> </service> </service_bundle>
i think the method_credential_user does the equivalent of that su. "svccfg validate /usr/azureus/meta.xml" in the command line to validate the smf manifest xml file. if it all checks out, run svccfg import /usr/azureus/meta.xml to load the smf manifest. try svcs azureus_headless and the service should show up unstarted. to start it, use svcadm enable azureus_headless. try svcs azureus_headless as it goes from unstarted to running (it might take a few seconds). if it doesn't start, try svcs -x and take a look at its log file to see what's going on. that should be it. happy torrenting.

Wednesday, February 13, 2008

the last union town

Source: (http://www.phillymag.com/articles/the_last_union_town/)

looks like some union goons, and i do mean goons because that's what it sounds like here, were messing with my local five guys. this is a pretty good article:

A few days earlier, a couple of blocks away, the same electricians union had been outbid for a job repairing a bit of wiring at the Five Guys burger joint. The electricians are headed by John Dougherty, one of the city’s most vocal and visible union leaders, who has a reputation for rough tactics when it comes to union business. The union — Local 98 — sent picketers who insinuated that the restaurant was unclean due to a vermin infestation. The restaurant manager posted a small bill on the storefront, titled, "What is Really Happening Outside?" It said there were no vermin anywhere inside and never had been; also: "We are being picketed by members of the electrical workers’ union (Local 98) because they are upset that a Local 98 subcontractor didn’t win a contract. ... The Local 98 bid was three times higher than the bid by the winning subcontractor."

check out the comments too for laughs. why can't the city just have unions compete with everybody else for work without resorting to goon tactics? isn't competition and capitalism the basis of america?

Wednesday, February 6, 2008