How Many RAM Slots are You Using?

I was cleaning out my blogroll, which led to this great tip from Jeff’s Healthcare IT blog (as well as the previous post about default passwords).  Instead of opening up your case, this command will tell you what is in use.  Should be similar for other Linux flavors as well.

sudo dmidecode -t 17

Visit his site for more details.  Thanks, Jeff!

Advertisements

Fix for VMware-Server error – “version `GCC_4.2.0′ not found”

I have had to employ this fix more than once, so it goes on the blog.  It applies to VMware-Server 1.x on newer kernels – I dunno if the 2.x version has the same issue.

Thanks Dave.

The fix:

cd /usr/lib/vmware/lib
/usr/lib/vmware/lib$ sudo mkdir bak
/usr/lib/vmware/lib$ sudo mv libgcc_s.so.1/libgcc_s.so.1 bak/

Make sure to run the vmware command in a console to determine the error you are having – after all, it might not be opening for an entirely different reason.

Very Useful Link on Shell Scripting….

I found this while surfing Linux.com.  Very handy if you are into shell scripting (and who isn’t?, haha).

Speaking UNIX

Enjoy!

Fun Script to Track Your Blog Hit Count…

I got the inspiration for this script from CoolTechie’s blog. He made a script to display cricket match scores from a web site. I decided to have a little fun with it, so made one of my own that periodically checks this blog and displays a popup window if the hit counter has changed, with the current visitor count.

I started with the command, “touch blog-hits”, then edited it in vi. When I was done, I typed “chmod +x blog-hits” to make it executable and ran it by typing “./blog-hits”.

Here is the script…


### Adapted from a soccer score script found on
### http://cooltechie.wordpress.com/2007/12/04/cricket-scoreboard-kde-desktop/
### Thanks out to cooltechie!


#!/bin/sh


####################
# Set variables - interrupt, url, url title, search phrase, and unchanged counter
####################
USER_INTERRUPT=13
url="https://symbolik.wordpress.com"
hits="a"
same="b"
##phrase="hits" ### this is the default, change if you use something else
phrase="bipeds"
title="Linux Free Trade Zone" ### I wanted to come up with a cool way to extract the title of the URL, but it got late...


####################
# Catch Control-C events to break out of the loop and remove the dump file
####################
trap 'echo "Quitting..."; rm -f dump; exit $USER_INTERRUPT' TERM INT


while [ 1 ]
do
lynx -dump $url > dump
hits=`grep "$phrase" dump`
if [ "$hits" != "$same" ]
then
kdialog --title "$title" --passivepopup "$hits" 10
same=$hits
fi
sleep 60
done

It grabs the text of the url, looks for the word “hits” or whatever phrase you tell it to if you have changed that on your site, and compares it to the old value (same). When the current value is different from the “same” value, such as when the script is first run and when people visit your blog, it displays that new hit count in the popup for 10 seconds, then waits one minute before re-downloading a text dump of the site. You end it with CTRL-C, which also tells it to clean up the dump file it makes. You can run it in the background if you want. I am sure there is plenty of stuff you can add to this as well, and it might even be a little buggy (inaccurate). I just thought it would be fun to have a little popup counter, and it was fun to do.

One thing I found is that it also prints the phrase you searched on to display the visitor count line, because that phrase is getting appended to the “hits” variable. Too tired to troubleshoot, however…

Anyway, enjoy!