<?xml version="1.0" encoding="utf-8"?>
        <?xml-stylesheet type="text/css" href="http://www.linuxevolution.org/styles/feed.css"?>
<rss version="2.0"
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:admin="http://webns.net/mvcb/"
 xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
<title>Filed under: Linux | Linux Evolution dot org and the NSLU2</title>
<atom:link href="http://linuxevolution.org/archives/linux/index-rss.xml" rel="self" type="application/rss+xml" />
<link>http://linuxevolution.org</link>
<description></description>
<dc:language>en-us</dc:language>
<dc:creator>orvtech</dc:creator>
<dc:date>2010-12-26T18:58:30-05:00</dc:date>
<admin:generatorAgent rdf:resource="http://nanoblogger.sourceforge.net" />

<item>
<link>http://linuxevolution.org/archives/2010/06/09/shell_script_to_backup_nanoblogger_to_a_remote_server/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/06/09/shell_script_to_backup_nanoblogger_to_a_remote_server/index.html</guid>
<title>Shell script to backup NanoBlogger to a remote server </title>
<dc:date>2010-06-09T16:23:49-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, Linux, nanoblogger</dc:subject>
<description><![CDATA[<p>This is a simple script that creates full backups of our NanoBlogger blog by compressing our DocumentRoot directory and upload it to a remote server via SCP.</p>

<p>Lets take a look at it:<br />
<pre>#!/bin/bash
BLOG_PATH="/path/to/the/directory/that/contains/your/blog.conf/"
BLOG_NAME="orvtech.com"
DATE=`date +%d%b%Y-h%Hm%M`
NO_BAKUP="cache/*"
SCP_SERVER="<your_server_here>"
SCP_USER="<your_ssh_login_here>"
SCP_PORT="22"

cd $BLOG_PATH
tar -czpsf ~/$BLOG_NAME-nanoblogger.$DATE.tar.gz --exclude "$NO_BAKUP" *
ls -lah  ~/$BLOG_NAME-nanoblogger.$DATE.tar.gz
scp -P$SCP_PORT ~/$BLOG_NAME-nanoblogger.$DATE.tar.gz $SCP_USER@$SCP_SERVER:~/</pre>
</p>
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/howto/respaldar-nanoblogger/" rel="friend" hreflang="en">Respaldar NanoBlogger.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2010/05/18/find_the_biggest_file_or_folder_inside_a_directory/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/05/18/find_the_biggest_file_or_folder_inside_a_directory/index.html</guid>
<title>Find the biggest file or folder inside a directory.</title>
<dc:date>2010-05-18T10:57:05-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> OneLiners, Scripts, NSLU2, Linux, iPhone</dc:subject>
<description><![CDATA[<p>
By using the `du` command we can find the biggest file or directory inside a folder. The next example shows how to list the 10 most biggest files and floders inside 'HOME'
</p>

<pre>du -a ~/ | sort -n -r | head -n 10</pre>

<br />

<p>
If we use the `find` command we can list the 10 biggest files inside a directory, even if they are inside sub-folders.
</p>

<pre>find ~/ -type f -exec ls -ls {} \; | awk '{print $6"\t"$9}' | sort -k1 -n -r | head -n 10</pre>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2010/04/21/znc_irc_bouncer_start_up_script/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/04/21/znc_irc_bouncer_start_up_script/index.html</guid>
<title>ZNC IRC Bouncer start up script.</title>
<dc:date>2010-04-21T12:52:16-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, IRC, NSLU2, Linux</dc:subject>
<description><![CDATA[<p>
A few weeks a go I published an article about how to have push notifications to your iPhone from an IRC channel events. After installing and configuring ZNC I was a bit disappointed that it didn't had a start up script so I decided to write one. 
</p>
<p>
This script allows you to start, stop, reload the configuration and restart the service. lets take a look at /etc/init.d/zncd
</p>
<textarea class="bashcode"> 
#!/bin/bash
 
 ZNC_FOLDER="/usr/bin"
 ZNC_OWNR="your_user_here"
 
 if [ ! -f $ZNC_FOLDER/znc -o ! -d $ZNC_FOLDER ]
 then
 echo "ZNC startup: cannot start, it appears that it is not installed"
 exit 1
 fi
 
 case "$1" in
 start)
 echo -n "Starting ZNC: "
 su - $ZNC_OWNR -c "$ZNC_FOLDER/znc"
 touch /var/lock/subsys/ZNC
 echo "OK"
 ;;
 stop)
 echo -n "Shutdown ZNC: "
 kill -9 `ps -C znc | awk '{print $1}' | grep ^[0-9]`
 rm -f /var/lock/subsys/ZNC
 echo "OK"
 ;;
 reload)
 echo -n "Reloading ZNC:"
 kill -HUP `ps -C znc | awk '{print $1}' | grep ^[0-9]`
 echo "OK"
 ;;
 status)
 if ps -C znc > /dev/null
 then 
 echo "ZNC Bouncer is running"
 else 
 echo "ZNC Bouncer is not running"
 fi
 ;;
 restart)
 $0 stop
 sleep 2
 $0 start
 ;;
 *)
 echo "Usage: $0 start|stop|restart|reload|status"
 exit 1
 esac
 exit 0</textarea> 
<br /><p>
If your NSLU2 is running gentoo you could add it to the default run level like this:
</p>
<textarea style="height: 18px" class="bashcode"> 
rc-update add zncd default</textarea>
<br /><p>
The output should be something like this:
</p>
<textarea style="height: 18px" class="bashcode"> * zncd added to runlevel default</textarea> 
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/general/script-de-arranque-para-znc-bouncer/" hreflang="es" rel="friend">script de arranque para ZNC bouncer.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2010/04/11/bluetooh_audio_through_the_nslu2/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/04/11/bluetooh_audio_through_the_nslu2/index.html</guid>
<title>Bluetooh Audio Through the NSLU2.  </title>
<dc:date>2010-04-11T19:11:00-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, NSLU2, Linux</dc:subject>
<description><![CDATA[
<p>
<a href="http://twitter.com/POTUSCamacho" rev="Original author of this guide">@POTUSCamacho</a> has an interesting article about how to use the NSLU2 in combination with a USB bluetooth adapter as an audio server. POTUSCamacho explains how to do it with a mono audio adapter but clarifies that it should be possible to do it using a stereo adapter.
</p>

<p>Lets take a look at this interesting howto:</p>

<blockquote cite="http://potuscamacho-industries.blogspot.com/2010/04/linksys-nslu2-utilizing-bluetooth-audio.html">

<p>Once you have installed Ubuntu, log in and update your packages:
</p>
<textarea style="height: 18px"  class="bashcode">
sudo -i apt-get update</textarea>
<p>
Then install the following packages:
</p>
<textarea style="height: 35px" class="bashcode">
sudo -i apt-get install linux-sound-base bluetooth bluez bluez-alsa bluez-btsco bluez-compat bluez-utils python python-bluez vlc</textarea>
<p><i>
Note: I do alot of other development stuff on my unit. I may have left off something, and if so let me know if you try it and it doesn't work.
</i><br />

Now that the needed packages are installed, an .asoundrc needs to be created in your user home directory. An example:
</p>
<textarea style="height: 50px" class="bashcode">
pcm.bluetooth {
type bluetooth
device 00:00:00:00:00:00
}</textarea>
<p>
Edit the device section with the MAC address of your bluetooth headset. To find this, issue a reset of the bluetooth adapter by issuing the command:
</p>
<textarea style="height: 18px" class="bashcode">
hciconfig hci0 reset</textarea>
<p>
Then place your headset in pairing mode and issue the following command:
</p>
<textarea style="height: 18px"  class="bashcode">
sdptool browse</textarea>
<p>
Now copy the following python script into a file named pair.py:
</p>
<textarea style="height: 480px" class="bashcode">
#!/usr/bin/python

import gobject

import sys
import dbus
import dbus.service
import dbus.mainloop.glib

class Rejected(dbus.DBusException):
_dbus_error_name = "org.bluez.Error.Rejected"

class Agent(dbus.service.Object):
exit_on_release = True

def set_exit_on_release(self, exit_on_release):
self.exit_on_release = exit_on_release

@dbus.service.method("org.bluez.Agent",
in_signature="", out_signature="")
def Release(self):
print "Release"
if self.exit_on_release:
mainloop.quit()

@dbus.service.method("org.bluez.Agent",
in_signature="os", out_signature="")
def Authorize(self, device, uuid):
print "Authorize (%s, %s)" % (device, uuid)
authorize = raw_input("Authorize connection (yes/no): ")
if (authorize == "yes"):
return
raise Rejected("Connection rejected by user")

@dbus.service.method("org.bluez.Agent",
in_signature="o", out_signature="s")
def RequestPinCode(self, device):
print "RequestPinCode (%s)" % (device)
return raw_input("Enter PIN Code: ")

@dbus.service.method("org.bluez.Agent",
in_signature="o", out_signature="u")
def RequestPasskey(self, device):
print "RequestPasskey (%s)" % (device)
passkey = raw_input("Enter passkey: ")
return dbus.UInt32(passkey)

@dbus.service.method("org.bluez.Agent",
in_signature="ou", out_signature="")
def DisplayPasskey(self, device, passkey):
print "DisplayPasskey (%s, %d)" % (device, passkey)

@dbus.service.method("org.bluez.Agent",
in_signature="ou", out_signature="")
def RequestConfirmation(self, device, passkey):
print "RequestConfirmation (%s, %d)" % (device, passkey)
confirm = raw_input("Confirm passkey (yes/no): ")
if (confirm == "yes"):
return
raise Rejected("Passkey doesn't match")

@dbus.service.method("org.bluez.Agent",
in_signature="s", out_signature="")
def ConfirmModeChange(self, mode):
print "ConfirmModeChange (%s)" % (mode)

@dbus.service.method("org.bluez.Agent",
in_signature="", out_signature="")
def Cancel(self):
print "Cancel"

def create_device_reply(device):
print "New device (%s)" % (device)
mainloop.quit()

def create_device_error(error):
print "Creating device failed: %s" % (error)
mainloop.quit()

if __name__ == '__main__':
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)

bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.bluez", "/"),
"org.bluez.Manager")

if len(sys.argv) > 1:
path = manager.FindAdapter(sys.argv[1])
else:
path = manager.DefaultAdapter()

adapter = dbus.Interface(bus.get_object("org.bluez", path),
"org.bluez.Adapter")

path = "/test/agent"
agent = Agent(bus, path)

mainloop = gobject.MainLoop()

if len(sys.argv) > 2:
if len(sys.argv) > 3:
device = adapter.FindDevice(sys.argv[2])
adapter.RemoveDevice(device)

agent.set_exit_on_release(False)
adapter.CreatePairedDevice(sys.argv[2], path, "DisplayYesNo",
reply_handler=create_device_reply,
error_handler=create_device_error)
else:
adapter.RegisterAgent(path, "DisplayYesNo")
print "Agent registered"

mainloop.run()

#adapter.UnregisterAgent(path)
#print "Agent unregistered"</textarea>

<p>
Now place your headset into pairing mode again and issue the follow command:
</p>
<textarea style="height: 18px" class="bashcode">sudo -i python pair.py hci0 00:00:00:00:00:00</textarea>

<p>
Once again replacing the address above with your headsets MAC.
The last step involves editing the vlcrc. To do this, issue the command:
</p>

<textarea style="height: 18px" class="bashcode">
pico .vlc/vlcrc
</textarea>

<p>
Scroll down and replace:
</p>

<textarea style="height: 18px" class="bashcode">
alsadev=(default soundcard) </textarea>

<p>To:</p>

<textarea style="height: 18px" class="bashcode">
alsadev=bluetooth</textarea>

<p>
If it does not exist then create it.
</p>

<p>
Now you should be ready to listen to audio. To listen to the audio from NASA TV's online video stream, issue the command:
</p>

<textarea style="height: 18px" class="bashcode">
cvlc --aout-rate 8000 --novideo http://www.nasa.gov/55644main_NASATV_Windows.asx</textarea>

<p>
If everything is working you should hear audio. Keep in mind that the sample rate needs to be 8000Hz since that is the sample rate the headset can handle.
</p>

<p>
To pair another headset, or to re-pair the current, the /var/lib/bluetooth/(your MAC)/linkkeys file must be deleted. It will regenerate once you have paired the devices. Also remember that the .asoundrc file must be edited to match a different headset as the MAC will be different.
</p></blockquote>

<p>
To find out more info about this article, please visit <a href="http://potuscamacho-industries.blogspot.com/2010/04/linksys-nslu2-utilizing-bluetooth-audio.html">POTUSCamacho Industries</a> blog.
</p>
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/archives/2010/04/12/audio_via_bluetooh_desde_el_nslu2/index.html">Audio vía bluetooh desde el NSLU2.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2010/03/26/a_bash_cgi_as_a_workaround_to__htaccess_files_on_lighttpd/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/03/26/a_bash_cgi_as_a_workaround_to__htaccess_files_on_lighttpd/index.html</guid>
<title>A BASH CGI as a workaround to .htaccess files on lighttpd</title>
<dc:date>2010-03-26T12:49:32-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, NSLU2, Linux, nanoblogger, lighttp</dc:subject>
<description><![CDATA[<p>
As you might remember, in a previous post I explained how to maintain a permanent link which always points 
to the latest submission on your nanoblogger website. Since I decided to migrate from apache to lighttp I 
lost the ability to use .htacees files thus .htacees file based redirects do not work anymore.
</p>
<p>
<br /><b>The workaround.</b><br />

We will keep using the /latest url for the redirects the only thing is that we will use a CGI written in 
BASH to accomplish the redirect. The script will parse our RSS feed (rss.xml) to check which is the latest 
post and redirect to that url. The redirect is accomplished by sending the HTTP headers 'Location' and 
'Status'. Let's take a look at the script:
<br />
<i>latest.cgi</i><br />

<textarea style="height: 80px" class="bashcode">
#!/bin/bash
DocummentRoot="/var/www/linuxevolution.org/htdocs"
Latest=`cat $DocummentRoot/rss.xml | grep link | grep archives | head -n1 | sed -e :a -e 's/<[^>]*>//g;/</N;//ba'`
echo "Status: 302 Moved"
echo -e "Location: $Latest\n"</textarea>
</p>
<p>
Here we are sending the Status header to prevent search engines from associating more than one url to the 
same content (this will give us a lower score in some search engines' systems) and then we send the 
Location header to do the actual redirect.
</p>
<p>
<br /><b>Lighttp and CGIs.</b><br />

In other to execute this CGI we need to make some minor modifications to our VirtualHostost configuration. 
Lets add these two lines to it:
<br />

<textarea style="height: 26px" class="bashcode">
cgi.assign = ( ".cgi" => "/bin/bash" )
url.redirect =( "^/latest/(.*)" => "http://www.linuxevolution.org/latest.cgi")</textarea>


</p>
<p>
In the first line we are telling lighttpd to use /bin/bash to execute any *.cgi file (you can change this 
to anything like *.sh, *.bash). In the second line we redirect all requests to /latest/ to the url 
/latest.cgi. You can either use /latest.cgi or /latest/ for these urls in your signature at the forums; 
personally I like to use /latest/<name of the forum here> to keep track of where is my traffic coming from 
even if I don't get the HTTP referrer.
</p>
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/howto/un-cgi-en-bash-para-mantener-tu-firma-al-dia-en-todos-los-foros-en-que-participas/" rel="friend" hreflang="es">Un CGI en BASH para mantener tu firma al dia en todos los foros en que participas.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2010/02/23/find_ms-dos_formatted_files/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2010/02/23/find_ms-dos_formatted_files/index.html</guid>
<title>Find MS-DOS Formatted Files. </title>
<dc:date>2010-02-23T11:18:30-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, Linux</dc:subject>
<description><![CDATA[<p>I recently came across a problem where I had a bunch of perl scripts that were modified under MS Windows and had the MS-DOS format. I found a bunch of errors on the crond logs since these scripts were being called by a crontab. Long story short I had to find all these scripts so I used this recursive grep inside the directory where this files were uploaded.</p>

<textarea style="height: 35px" class="bashcode" readonly wrap="off">grep -IUl --color '^M' -R ./*</textarea>
<br />
<p>The output of this command will generate a list of files that are formatted as DOS files.
<a class="DiggThisButton">('<img src="http://digg.com/img/diggThisCompact.png" height="18" width="120" alt="DiggThis" />’)</a>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/howto/encontrar-archivos-con-formato-ms-dos/" rel="friend" hreflang="es">Encontrar archivos con formato MS-DOS.<a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2009/11/30/the_nslu2_as_a_last_fm_to_twitter_bridge/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2009/11/30/the_nslu2_as_a_last_fm_to_twitter_bridge/index.html</guid>
<title>The NSLU2 as a last.fm to twitter bridge.</title>
<dc:date>2009-11-30T16:57:10-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, Last_FM, NSLU2, Linux, Twitter</dc:subject>
<description><![CDATA[<p>This simple script came from the need of updating <a href="http://twitter.com/m1n1m3">my twitter</a> 
status with the songs that I am playing, the trick is that it will only update my profile 
if the song has been tagged as 'loved' on last.fm. It will also detect if it is Monday 
and will add the <a href="http://twitter.com/#search?q=%23mm"><i>#mm</i> hash</a>.</p>

<textarea class="bashcode" readonly wrap="off">twitter_user="<your_twitter_user_here>"
twitter_passwd="your_twitter_password_here"
URL="http://twitter.com/statuses/update.xml"
tags="#lastfm"
lastfm_api="<your_api_from_lastfm_here>"
lastfm_user="<your_lastfm_user_here>"
bit_ly_user="<your_bit.ly_user_here>"
bit_ly_apikey="<your_bit.ly_api_key_here>"

fmtwitted=`cat /tmp/lastfm2twitter.tmp | \
sed -e 's/status=Just played: //g' -e 's/#.*//g' | \
grep '[a-z]'|sed -e 's/\ //g' -e 's/\-/./g'`

fmcurrent=`curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1&user=$lastfm_user&api_key=$lastfm_api" | \
grep -E '<name>|</name>|<artist\ |</artist>' |\
head -n2| sed -e 's/<[^>]*>//g' | tr '\n' '.' |\
sed -e 's/\ //g' -e 's/.$//g'`


lastfm_song_url=`curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1&user=$lastfm_user&api_key=$lastfm_api" |\
grep -E '<url>|</url>' | sed -e 's/<[^>]*>//g' |\
head -n1| tr '\n' '.' | sed -e 's/\ //g' -e 's/.$//g'`
bit_ly_url=`curl -s "http://api.bit.ly/shorten?version=2.0.1&longUrl=$lastfm_song_url&login=$bit_ly_user&apiKey=$bit_ly_apikey" | \
grep shortUrl | sed -e 's/\"/\ /g' | awk '{print $3}'`

today_mm=`date +%A`
if [[ $today_mm == "Monday"  ]] 
  then tags="$tags #mm"
fi


if grep $fmcurrent /tmp/lastfm_loved.tmp  > /dev/null
  then if [[ "$fmtwitted" == "$fmcurrent" ]]
      then exit 0
        else curl -s "http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1&user=$lastfm_user&api_key=$lastfm_api" | \
	grep -E '<name>|</name>|<artist\ |</artist>' |\
	head -n2| sed -e 's/<[^>]*>//g' | tr '\n' '-' | \
	sed -e 's/^[ \t]*//' -e 's/-/\ -\ /g' -e 's/- $//g' -e 's/\ $//g' |\
	awk '{print "status=Just played: "$0}' > /tmp/lastfm2twitter.tmp
	lastfm2twitter=`cat /tmp/lastfm2twitter.tmp; 
	echo $bit_ly_url 
	echo $tags | tr '\n' ' '`
	echo $lastfm2twitter > /tmp/lastfm2twitter.tmp
	curl -s -u $twitter_user:$twitter_passwd -d @/tmp/lastfm2twitter.tmp $URL > /dev/null
	  fi
	  else exit 0
fi</textarea>
<br />
<p>As you can see I am using bit.ly to shorten the urls of the song, you will need a bit.ly API for this to work. 
I think what is left is to optimize the script storing the curl requests in a file sort of like a cache 
and add a routine to detect if it is longer than the 140 charaters allowed by twitte and shorten the text 
to be posted as the status.r</p> 
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/howto/el-nslu2-como-un-puente-de-last-fm-a-twitter/" rel="friend" hreflang="es">El NSLU2 como un puente de last.fm a twitter.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2009/11/03/monitoring_script_for_resources/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2009/11/03/monitoring_script_for_resources/index.html</guid>
<title>Monitoring Script for resources </title>
<dc:date>2009-11-03T11:37:17-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Scripts, NSLU2, Linux</dc:subject>
<description><![CDATA[<p>This is a small script to display the resources utilization of a NSLU2 running linux on a web page
in plain HTML, It is coded in BASH and some JavaScript in orther to display the information. Here is what the 
output looks like:
<br />
<script src="http://orvtech.com/resources.js" type="text/javascript"></script>
</p>

<br /><p>Source Code of resources.sh:</p>
<textarea class="bashcode" readonly wrap="off">#!/bin/bash

#GETTING THE DAYS OF UPTIME
let UP_TIME=`uptime | awk '{print $3" "$5}' | sed 's/:/ /g' |\
awk '{print "("$1"*24)+"$2}'`

#CALCULATING FREE RAM PERCENTAGE
mem_total=`grep MemTotal /proc/meminfo|awk '{print $2}'`
mem_free=`grep MemFree /proc/meminfo|awk '{print $2}'`
percent=$(echo "scale=2; $mem_free/$mem_total*100" | bc -l)

#GETTING THE AVERAGE LOAD OF THE SERVER 
load_10=`uptime | awk '{print $11}'|sed 's/,//g'`

#BUILDING THE *.js FILE
echo "var resources=\"<b>Last Updated: </b> `date`<br /><b>UP Days: 
</b>$UP_TIME<br /><b>Free RAM:</b> $percent% ($mem_free kB)<br />
<b>Load: </b>$load_10<br />\";"
echo "document.write(resources);"</textarea>

<p>You then direct the output of that script to a file in your RootDirectory, in my case I am using  /resources.js and I execute resources.sh every 5 minutes from a cronjob.</p>
<br /><p>Source Code of resources.js:</p>

<textarea style="height: 55px" class="bashcode" readonly wrap="off">var resources="<b>Last Updated: </b> Tue Nov  3 12:00:02 EST 2009<br />
<b>UP Days: </b>2549<br /><b>Free RAM:</b> 5.00% (1552 kB)<br /><b>Load: 
</b>0.21<br />";
document.write(resources);</textarea>

<p>I use the following code to display the information:</p>
<textarea style="height: 35px" class="bashcode" readonly wrap="off">
<script src="http://orvtech.com/resources.js" type="text/javascript"></script></textarea>
<br />
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/howto/script-para-monitorear-recursos-del-sistema-en-el-nslu2/" rel="friend" hreflang="es">Script para monitorear recursos del sistema en el NSLU2.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2009/11/01/almost_there/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2009/11/01/almost_there/index.html</guid>
<title>Almost There.</title>
<dc:date>2009-11-01T20:08:45-05:00</dc:date>
<dc:creator>orvtech</dc:creator>
<dc:subject> Linux</dc:subject>
<description><![CDATA[<p>
Almost two years have gone by since I last updated the site, we have migrated from a plain HTML site that had to be edited and managed using vim to the previous template but using nanoblogger as the back end for content manager. There are still some issues that I need to address like maintaining the same CSS between the old content and the new content... ultimately the old content will need to be migrated. 
</p><p>
I have also been working on a picasa albums plug-in that I will release as soon as it gets properly tested. The ability to have a multilingual content is also something that I have been thinking of. 
</p><p>
In 2 weeks I should finally have internet at home and should not need to 'borrow' it from my neighbors, by then I should be working again in to getting a gentoo stage3 of the latest release possible  for the NSLU2.
</p>
<p><i>
<b>Spanish version:</b> <a href="http://orvtech.com/nslu2/ya-casi-estamos-listos/" rel="friend" hreflang="es">Ya casi estamos listos.</a>
</i></p>]]></description>

</item>
<item>
<link>http://linuxevolution.org/archives/2009/11/01/linux_on_the_nslu2/index.html</link>
<guid isPermaLink="true">http://linuxevolution.org/archives/2009/11/01/linux_on_the_nslu2/index.html</guid>
<title>Linux on the NSLU2</title>
<dc:date>2009-11-01T13:16:16-05:00</dc:date>
<dc:creator>iDontknow</dc:creator>
<dc:subject> NSLU2, Linux</dc:subject>
<description><![CDATA[<p>The Linksys NSLU2 (aka "slug") is sold as a NAS device but in reality it is much more useful than that. It is a complete, cheap, embedded Linux system. Best of all is the fact that the official Linksys firmware uses the Linux kernel, and so Linksys released the <a href="http://localhost">source code</a>. This led to some excellent custom firmware projects like Unslung and OpenSlug. </p>
<p><i>
<b>Spanish version:</b><a href="http://orvtech.com/general/linux-en-el-nslu2/" hreflang="es" rel="friend">Linux en el NSLU2.</a>
</i></p>]]></description>

</item>
</channel>
</rss>

