Archive for May, 2005

doh – I’ve got a lot to learn

It’s quite humbling when you receive an e-mail with….

< quote mail-from: Jeremy Huddleston>
… my guess is you’re a bit new to this sort of thing …
< /quote>

I’ve been aggressively using Linux for about a year now, & have been fairly familiar with it for nearly 3, now I wouldn’t say I’m a guru, but I thought I could hold my own - man I was wrong ! Oh well at least I wasn’t shot down in flames :D

Anyway the quote can from a Bugzilla Post I’ve got 3 personal projects on the go at the mo’ , one of them being trying to enable SSL support for XMMS in FC3 and eventually build an RPM, but sadly I’m not having much luck. I think I’m just gonna have to knuckle down & get learning :D

Syndicate with Me !

RSS is cool, no aruments, it just is :-P The thing is it’s just dawned upon me that for “joe windows” user it’s not entirely obvious.

A little research shows that a lot of companies have realised this & tried to make some money. So to make things easier you can syndicate with me using your favorite web aggregator, the following lonks are on my blog side bar :cool:

Subscribe in NewsGator Online

Personally tho’ I’ll stick to Liferea :D

Claiming my Link @ Feedster :-)

No Need to Click Here – I’m just claiming my feed at Feedster feedster:d4d37486ab44cbdd988f0756d24401af

Free RSS News Reader for Symbian Phones !

I’ve been looking for one of these for ages, an RSS feed reader for my Mobile Phone. When I was running my Nokia 6600 the only one I could find was FeedBurner’s MFB the only problem with that was… it was gonna cost me money !!!! … yeah right… as a linux fan, am I ever gonna pay for software… no opensource is always the right choice ;)

Anyway, by luck I got the right google search syntax , behold the 3rd enty was RSS Orbit / Free Download , a quick browse round lead me to blogplanet.net – nice :cool:

Here’s my RSS feed on my mobile !

my RSS feed via orbit mobile rss

Screenshot taken using screen shot for symbian

A Funny New Comic Strip – Bug Bash

I found this blog post yesterday on Robert Scoble’s Blog….

Bug Bash

..is a new comic strip & I actually laughed out lound at my desk !

Google Personal Homepage

If found some cool :cool: stuff on google today; firstly labs.google.com , this seems to be a repositry of all the new stuff google are working on, including Google History Search and my faviourite Google Personal Homepage.

Now GPH is a lot like yahoo’s my.yahoo.com (which I happen to like) , initially you can tell it’s not quite as developed, which ends up as a bonus because it doesn’t feel as cluttered. Another thing I found quite quickly was the “drag & drop” re-arrangement of the display, very neat :) .

Now I Think you need a gmail account to get the most of it (as your mail can get displayed as a summary), but my mates in the office have all had a go & we’re all changing our homepages ! (Go On… ave a go !)

XFCE 4.2.2 Released

XFCE 4.2.2 has been released, and to be honest I’ve struggled to get the rpm rebuilds done… just no time :’( !

Anyway the official announcement was here

http://foo-projects.org/pipermail/xfce-announce/2005-May/000021.html

You can update your whitebox installation using [LINICKX].com ! Check that you have something like this in your /etc/yum.conf

[LINICKX]
name=LINICKX Yum Repo
baseurl=http://www.linickx.com/files/rpm/whitebox/xfce-repo/

Then… from a shell do:

root@localhost # yum update xffm\* xfwm4\* xfce\* xfdesktop

…and your done :cool:

This is cool – Kplaylist

I’ve found this cool MP3 steaming software, easier to setup than icecast/ices & more appropiate for home users. :D Kplaylist uses mysql & php to give you a multi user website for your music directory, you can build playlists & stream music, and the album art is a nice touch. It even supports mp3 streaming over ssl, if only I can get the SSL patch for xmmsto work !

Check it out @www.kplaylist.net/ :cool:

Getting started with ACPI

Hardware stuff, especially laptops is usually window$/manufacturer specifc so getting some of it work work can be a bit of a pain. In FC1 low batteries & standby is handled by APM, in FC2 upwards APM is replaced with ACPI & this is a quick text on getting going.

There are two folders & a service :

  • /etc/acpi/actions
  • /etc/acpi/events
  • /etc/init.d/acpid

The service , I think runs in the background monitoring the hardware, you can then put events into /etc/acpi/events and get things to happen when the deamon spots them .

I originally tested this on an HP Omnbook 6000, but now I’m using a compaq nc6000 . To replace apm I need to

  1. Monitor Battery / Power Status
  2. React when power button / standby pressed
  3. Do Something when the lid is closed

Documentation :

http://acpi.sourceforge.net/documentation/index.html


To get started I had a look at the documentation ;) also there is an example in FC3 ( /etc/acpi/events/sample.conf )

Sample.conf

 # This is a sample ACPID configuration
event=button/power.*
action=/sbin/shutdown -h now
 

the Documentation explains that all acpi “real time” info is stored in /proc/acpi .

If you look /proc/acpi there is a directory “button” and in there “power” , so sample.conf seems to suggest if anything under “power” changes do action (in this case shutdown the machine).

Armed with this I could “test” with something a little quicker than switching on/off the machine; like opening / closing the lid….

So, in /proc/acpi/button/lid/C139 (the C139 is laptop specific) there is a file called state, and when it will tell you if the lid is open or closed (just in case you didn’t know ;) ), now it is this “lid” directory that acpi will be looking for, so what you do is create a file called /etc/acpi/events/lid and put in it

/etc/acpi/events/lid

# This is a sample ACPID configuration – what to do when a laptop lid is closed.
event=button/lid.*
action=/etc/acpi/actions/lid “%e”

You’ll notice that the action is set to /etc/acpi/actions/lid “%e” this will be a script, but you could point it to any script/executable you like. In /etc/acpi/actions/lid I have put

/etc/acpi/actions/lid

#!/bin/bash

# Make sure we recieve something !
if [ "$1" = "" ]
then
echo “Script Failed, NO Input !!!”
exit
fi

# what we got from the acpi deamon
acpi_in=”$1″
# what the lid code was…
lidstatus=`echo “$acpi_in” | awk ‘{print $4}’`

# the lid code in dec
dec_lidstatus=`printf “%d\n ” 0x$lidstatus`

#prepare for the maths
x=$dec_lidstatus
y=2

# was the lid code odd or even ?
mod=$(($x % $y)) # get the remainder of x / y and assign it to variable mod

# If %mod is 0 then the number is even, if it is 1 then the number is odd !
if [ $mod = 0 ]
then
# even numbers mean the lid is open !!!
# wall lid open
exit
else
# odd means closed !!!
# wall lid closed

# so lets lock the desktop !
su – nick -c “xscreensaver-command -lock”
fi

Now, this needs a little explaining…..

There a couple of things you need to know about acpi

  1. acpi runs as root, so any event get’s executed with root priveleges :D
  2. %e is an incremental number, odd numbers for lid closed & even for lid open
  3. To get these changes to work you need to restart the acpi service

So as you can see my lid open/close script gets a little complicated. To play if you remove the comments in from of the “wall” commands, save an open an empty shell, when you open & close the lid you get broadcast messages from root ! :cool: or if you just leave it as it is it’ll try and run “nick”’s screen saver :D

Now my old laptop had both a standby or sleep button and a power button, but getting events to happen is exactly the same, simply create a script doing what you want it to do, create a file ine /etc/acpi/events and set the event to event=button/power.* (or event=button/sleep.*) and voila !

Now finally, monitoring battery status, thankfully gnome already has a nice applet

or if you want to check it your self /proc/acpi/battery/C138/state (again C138 is laptop specific) this file will tell you !

I hope you’ve found this of some use !

PHP – want a random quote ?

I thought my site was missing something, perhaps a little bit of dynamic text , so now we have it ! Below my logo random one liner quotes will appear :cool:

I found the basics at totallyphp but it only read the quotes from an array, not a file, so: I added the file function & turned the script into a function :D

If you too want simple random quotes to include the source is here. The usage is simple, create a file called quotes.txt with quotes, a new one on each line (make it world readable) ; by default if you then call quotes.php it’ll choose a line & print the text… if you comment out echo randomquote(); you could include quote.php in other code :idea:

Here’s the code… enjoy !

# Where do I get my quotes from ?
$QUOTEFILE=”./quotes.txt”;

function randomquote() {
global $QUOTEFILE;
$quotes = file(“$QUOTEFILE”);

srand ((double) microtime() * 1000000);
$randomquote = rand(0,count($quotes)-1);

return $quotes[$randomquote];

}

echo randomquote();

New Pic’s on gnome-look !

gnomegrid 3

gnomegrid 1

These are now on gnome-look.org :D you and download and slate them on their comminy site.

Direct Links:

PHP-Cat – Free download ;-)

It’s the usual story, bored in a travel lodge finishing some blog drafts / projects I’ve got saved.

PHP-Cat is an example of how one can use the browser php script that I published; PHP-Cat is a web based tool that allows you to browse the file system of the webserever / host , you can then select a text file and view it through your broswer. What’s clever is that you are not just limited to files in a webservers root directory, you can view any* directory ! (Needless to say, this script cannot by-pass filesystem security, see comment below.)

PHP-Cat comes with two configurable options:

  1. $STARTDIRECTORY: This basically sets the applications $HOME directory, i.e. the first directory loaded by index.php, from there users can drill down the file structure and view text files. The default $STARTDIRECTORY: is the install dir.
  2. $USERBROWSING: If you want to give your users the freedom to view anything* then this gives the page a form wich allows you to type in a path to “jump to”, and again you could drill down from there. By Default this is disbaled.

The code is aplha code because it’s not exactly a slick project, there are two main issues (1) there is no file checking, so theres nothing to stop you trying to view binary files & (2) the interface isn’t exactly skinned, so you wouldn’t want to publish it in formatted system/page without getting you web coder to make it pretty

You can download a copy here http://www.linickx.com/files/php/php-cat-ALPHA.tar.gz

Install is straight forward, unpack into you webroot and point your broswer at it, the configurable options are clearly labled in index.php. I’ve only tested this on a linux machine, but I’ve used pure php syntax so there’s no reason why you couldn’t use it on a window$ machine.

If you have any questions you can Contact Me

Enjoy :D

*Anything ? Well kinda, this is a very simple php script, what can be displayed depends on the file system perssions for the webserever user. With a fedora core example, the webserver user is apache so the directorys that can be listed, and the files that can view viewed by apache & the application, need to be either owned by apache or world readable.

Wallpaper Version 2


gnomegrid3

I second attempt at some wallpaper art, derived from GnomeGrid this version is much closer to what I imagined. Unfortunatley it’s still tooo big to upload to gnome-look so I can’t get any feedback easily :( the question will be… do art.gnome.org like it ?

Nokia IPSO Ping Script

I’m working away from home a lot at the moment :-( so site updates are slow.

Anway one of the things I’ve needed was a script that could ping stuff from a Nokia Box … I’m quite proud of my work so here it is… simply write a file called “ips.txt” with ip addresses in it eg:

192.168.1.1
10.1.1.1
10.10.9.8

ftp or sftp the files onto the nokia ( /var/admin is a good place) and run ./nokia.sh… you’ll get something like…

FIREWALL[admin]# ./nokia.sh
PINGING 192.168.1.1
~
PINGING 10.10.9.8
DONE !
FIREWALL[admin]#

*If you have problems running nokia.sh, like ./nokia.sh: Permission denied. then do a chmod 700 nokia.sh

..and in /var/admin (or where ever you put it) you’ll get a results.txt file (actually hostname-results.txt, so in my example FIREWALL-results.txt)

This is an extract of what you get…

PINGING From FIREWALL To 192.168.1.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PING Tue May 3 13:37:51 2005 192.168.1.1: 64 data bytes

—-Tue May 3 13:37:54 2005 192.168.1.1 PING Statistics—-
4 transmitted, 0 received, 100.00% packet loss.
3.024 seconds elapsed, throughput = 0.00 packets/sec; 0.000 bps.
###########################################
PINGING From FIREWALL To 10.10.9.8
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PING Tue May 3 13:37:54 2005 10.10.9.8: 64 data bytes
EchoReply from 10.10.9.8: len=64 ttl=255 seq=0 time=1.155 ms.
EchoReply from 10.10.9.8: len=64 ttl=255 seq=1 time=0.357 ms.
EchoReply from 10.10.9.8: len=64 ttl=255 seq=2 time=0.370 ms.
EchoReply from 10.10.9.8: len=64 ttl=255 seq=3 time=0.484 ms.

—-Tue May 3 13:37:58 2005 10.10.9.8 PING Statistics—-
4 transmitted, 4 received, 0.00% packet loss.
3.025 seconds elapsed, throughput = 1.32 packets/sec; 888.638 bps.
round-trip (ms) min/avg/max = 0.357/0.592/1.155
var/sdev/skew/kurt = 0.144/0.380/0.701/1.276

cool ! – here’s the script – copy all of the below into nokia.sh ;)

#!/bin/sh
# Test Nokia Ping Script by [NICK]
# www.linickx.com !!!
CONFIG=./ips.txt
IPADDRESS=`cat $CONFIG`
HOSTNAME=`hostname`
RESULTS=./$HOSTNAME-results.txt
echo $HOSTNAME > $RESULTS
echo “=============” >> $RESULTS
for i in $IPADDRESS
do
echo “###########################################” >> $RESULTS
echo “PINGING From $HOSTNAME To $i” >> $RESULTS
echo “~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~” >> $RESULTS
echo “PINGING $i”
ping -c 4 $i >> $RESULTS
done
echo “DONE !”