yweather help

In case you want more out of your yweather script when you use it for Geektool, here are some other switches you can use:

I’ve figured out some of it, so I guess my only tip is to not try to use more than one argument at a time (except as shown below with the units example) and therefore to use a bunch of geeklets if you want to show a lot of information.

Also, I believe that ‘weather.png’ in the images folder is the current weather, so you should be able to show it using an image geeklet.

Yahoo Weather Information

Usage:
./yweather.pl -ct Displays current temperature

In case you want more out of your yweather script when you use it for Geektool, here are some other switches you can use:

I’ve figured out some of it, so I guess my only tip is to not try to use more than one argument at a time (except as shown below with the units example) and therefore to use a bunch of geeklets if you want to show a lot of information.

Also, I believe that ‘weather.png’ in the images folder is the current weather, so you should be able to show it using an image geeklet.

Yahoo Weather Information

Usage:
	./yweather.pl -ct	Displays current temperature

Arguments:
	-lc 			City
	-lr			Region
	-lt			Country
	-cc			Weather Code (used for images)
	-ct			Current Temperature
	-cw			Current Weather Description
	-cd			Current Date
	-ah			Current Humidity
	-av			Current Visibilty
	-ap			Current Barometric Pressure
	-ar			Change in Barometric Pressure
	-sr			Time of Sunrise
	-ss			Time of Sunset
	-wc			Current Wind Chill
	-wd			Current Wind Direction
	-ws			Current Wind Speed
	-ut			Temperature Unit
	-ud			Distance Unit
	-up			Pressure Unit
	-us			Speed Unit
	-fd1			Today's Day
	-fg1			Today's Date
	-fl1			Today's Low Temp
	-fh1			Today's High Temp
	-ft1			Today's Description
	-fc1			Today's Weather Code
	-fd2			Tomorrow's Day
	-fg2			Tomorrow's Date
	-fl2			Tomorrow's Low Temp
	-fh2			Tomorrow's High Temp
	-ft2			Tomorrow's Description
	-fc2			Tomorrow's Weather Code
	--copyimage		Copy Appropriate Image to Current Image (deprecated)
	--update		Update xml source file

All data is returned without units. To get data with units,
use a combination of commands.

Example: (Displays Current temperature with unit)
	./yweather.pl -ct && ./yweather.pl -ut

http://macenstein.com/default/2009/11/how-to-add-a-bunch-of-useless-stuff-to-your-desktop-with-geektool-yahoo-widgets-and-more/
http://code.google.com/p/yweather/wiki/howtousage

Trying something new . . . again (part 1)

Since I just had to reinstall Leopard and lost all my custom PHP and MySQL installations (and the MySQL databases, unfortunately), I tried to remedy that yesterday and today.

I’m still pissed off that OS X doesn’t come with working PHP and MySQL out of the box, including the PHP libraries. With a simple way to know where the data are being stored, and a way to back it up (in one’s Home folder, perhaps). But I digress–I’m sick of spending hours getting things to work when they ought to work.

So I decided to try out XAMPP for Mac (I tried it a few years back for Windows and enjoyed it), and it worked. Here are a few notes.

1. Everything is installed in the Applications folder. I’m not sure I like this, since I hate having stupid little folders (and DATA) in the Applications folder. I’m not sure if this can be easily changed, perhaps with a symbolic link to somewhere else (such as my Home folder, so it will get backed up).

2. Leopard MySQL was running when I installed, so I had to kill it with ‘sudo killall mysql’ and it will hopefully not start up again when I restart. The main reason I was having issues was that Leopard AGAIN lost mysql.sock.

3. I turned off Web Sharing in System Preferences. This is probably a good thing, and it will at least keep my computer from trying to run two Apache servers at once.

4. I wanted to keep the Sites folder as my web root for localhost, so I opened /Applications/xampp/etc/httpd.conf and changed DocumentRoot to point toward my Sites directory (e.g., “/Users/Matt/Sites”). I then copied everything in /Applications/xampp/xamppfiles/htdocs into /Users/Matt/Sites, and things seem to still work fine.

5. The MySQL databases, in case you want them backed up with the rest of the file structure rather than using phpMyAdmin, are stored in /Applications/xampp/xamppfiles/var/mysql. I may try to move them (with a symbolik link) to be stored in my Home folder since I won’t be keeping a lot of data in them but it’s annoying when I lose settings for various PHP applications (Simple Machines Forum, OpenX, Drupal, Serendipity, etc.).

6. I cannot get MySQL to work if I set a password for it, which means no logging into phpMyAdmin and no access to the MySQL databases. I get “Access denied for user ‘root’@’localhost’ (using password: NO)” instead, until I reset the password to blank. (Note to self, to do this, the command is [sudo ./bin/mysqladmin -u root -p password ”] (no brackets). The -p is important, because it will them ask you for your current password rather than assuming that you just didn’t want to supply it. Idiotic.)

7. Overall, aside from having to install all my databases again (not the fault of XAMPP), it seems to be working well so far. It just miffs me that I have a non-functioning version of MySQL on my laptop as well as an unused (although missing certain useful libraries) version of PHP 5 floating around. At this point I’ll take what I can get.

Fun extras with the OS X terminal

I’m writing some more R scripts today to make up for the discrepancy between different people’s interpretation of the concept of disparity and variance, and I felt the need to add a signal that the script was done running. I’ve used play() in the past, but it seems silly to use an extra library when I have other methods…

system("say All done!");

I was also playing with the system volume, but decided not to do too much, since I’m usually listening to music, and blowing my ears out is not my preferred method of learning that my function has completed running.

Change the system volume from the command line – OS X Daily Check out Kevin’s comment for some more tricky things.

Of course, you can always just play a sound without the play() function–just use Terminal! http://forums.macosxhints.com/showthread.php?t=33962