Archive for the ‘Linux’ Category

Usefull linux commands (ongoing)

Monday, March 9th, 2009

These are just commnads i had to hunt for in linux and want to remember for possible later use.

this will show the last 10 lines of a file (messages in this example) and monitor the file for changes, press ctrl-c to exit

tail -f /var/log/messages

create a loop file (replace 1024 with the size in MB)

dd if=/dev/zero of=loop_filename bs=1M count=1024

mkfs.ext3 -F loop_filename

Check fragmentation of XFS filesystem (50% is not bad really, change sda6 to your xfs partition)

xfs_db -c frag -r /dev/sda6

Kill a stubborn process, #### is the process id (PID)

kill -9 ####

Mythweb weather and doppler radar

Thursday, March 5th, 2009

mythweb dopplerI previously posted my fix to get a partial fix to the weather page in MythWeb, but the doppler radar image wasn’t there… after further perusing i found a fix…

sudo ln -s /var/www/mythweb/data/ /var/www/

Seems this one was actually throwning a nice error in the Apache2 error.log…

[Thu Mar 05 05:02:58 2009] [error] [client 192.168.0.269] File does not exist: /var/www/data, referer: http://tv/mythweb/weather

Wheee… MythWeb weather works for me now (Mythbuntu 8.10)

Fix MythWeb’s Weather page (partially)

Thursday, March 5th, 2009

mythweb weatherJust installed Mythbuntu and was playing around with the MythWeb feature, really sweet. But, the weather page was only showing a horizontal rule.

Did some poking around with the module code. In the file /var/www/mythweb/modules/weather/handler.php It read:

// Get configured WeatherScreens from the database
$sh = $db->query(’SELECT screen_id, draworder
FROM weatherscreens
WHERE hostname=?’,
$_SESSION['settings']['host']);

Changing the last line to the following like I found in a similar section in init.php to:

hostname);

actually showed me my current conditions and three day forcast… the doppler radar image is missing though.

Hope it helps someone out there.

IPConfig

Friday, January 18th, 2008

The default output is to display only IP address, subnet mask and default gateway for each adapter bound to TCP/IP.

Adding /flushdns to this command will purge the local DNS resolver cache, this is handy when a website has VERY recently moved. I learned this command after my webhosts automatic DNS update failed renewing my account. Other computers in the house could see the website, but this one machine would not. After flushing its DNS cache, all was well.

Another switch is /displaydns, this lists all entries in the cache (including recent entries from the hosts file).

In Linux, the nscd daemon manages the DNS cache. To flush the DNS cache, restart the nscd daemon. To restart the nscd daemon, use the command `/etc/init.d/nscd restart`.

Backing up photos, mp3s or other large directories to DVD

Saturday, January 5th, 2008

DiscSpan allows you to backup a directory of files to multiple DVDs on the Linux platform. If you had 20GB of photos, it would prompt you for 5 DVDs. It performs the backup at the file-level, meaning that a complete copy of each file is stored on a disc.

http://sourceforge.net/projects/discspan

Slackware 12 VirtualPC woes

Thursday, August 23rd, 2007

Just downloaded the Slackware Linux 12 DVD. I use Ubuntu as a dual boot to Windows XP which unfortunately I am still stuck with. So I broke out Microsofts VirtualPC 2004 (which is free nowadays) and proceeded to install Slackware… all went flawlessly, until I typed startx… KDE popped up.. but the mouse was inoperative.

After lots of googling i discovered there is an issue with the 2.6 kernels and some virtual software, bummer… During my search i say reference to something called VirtualBox, a GPL virtualization product. COOL.. i prefer to use FOSS (free and open-source software) anytime im able to.

So, i installed VirtualBox, preceded to load up Slackware, and bingo, 100% flawless install.