RSS | Comments RSS | Atom


jhcore.com

A source for news, reviews, guides, and tools for technology by John Paulett.

Ubuntu


Tech News & Ubuntu01 May 2007 12:47 am

I noticed an interesting project on Planet Ubuntu yesterday–VCSFrenzy. This tool allows you to get desktop notifications of changes to version control systems (VCS). Sure, some VCS let you have hooks that email you whenever a commit occurs–but this tool provides a lightweight and simple method of keeping track of multiple vcs’s.

So I have started helping Pete work on this project.

So far we have support for subversion and bazaar (additionally with mercurial in my branch right now). Stay tuned as this program gets some support for more VCS’s and gets some cool new features.

Guides & Ubuntu & Virtual Machine25 Mar 2007 06:34 pm

UPDATE: Check out the new guide to installing VirtualBox 1.4.0 from a repository.

This is a guide to installing Microsoft Windows Vista on a Ubuntu Edgy machine using VirtualBox. Note that Feisty is not yet fully supported by VirtualBox, but the edgy package is reported to work in feisty.

Certain versions of Vista may be illegal to run in a virtual machine, according to the EULA, namely the Home flavors of Vista.

Get Ready

I like to keep stuff clean, so I am going to download everything to a folder. Adjust according if you decide to not make this folder.
At the terminal:

mkdir ~/install_files

Install VirtualBox

Get VirtualBox and the necessary libraries.

cd ~/install_files
sudo apt-get install libxalan110 libxerces27
wget http://www.virtualbox.org/download/1.3.8/VirtualBox_1.3.8_Ubuntu_edgy_i386.deb
sudo dpkg -i VirtualBox_1.3.8_Ubuntu_edgy_i386.deb

If you have any dependancy issues:

sudo apt-get -f install

Add yourself to the vboxusers group. System > Adminstration > Users and Groups > Manage Groups > vboxusers > Properties, click the box next to your user’s name.

Make sure to restart. If you get an error “VirtualBox kernel driver not accessible, permission problem …”, make sure you are in the vboxusers group and restart your computer. (Logging in and out, did not work for me).

Set Up VirtualBox

From the terminal:

VirtualBox

Go through the steps to make a new virtual machine (Click “New”). Remember that Vista has a minimum requirement of 512 MB RAM and 15 GB HD (if you have a powerful system, consider using 1 GB RAM and 20 GB HD, with a dynamic disk). ubuntugeek.com has a screen by screen guide for making a new virtual machine

On the settings tab, mount your Vista DVD (or ISO if you have it and want a speedy install).

Now just start the virtual machine, and wait about an hour as Vista installs. You won’t get any Aero fanciness with a virtual machine (but you should already be running Beryl …right?)

Install the VirtualBox Additions

From the Devices menu, click “Install Guest Additions”

Get the Missing Network Driver

Microsoft decided to not include the network driver that VirtualBox uses in Vista, so you will have to install it yourself. (Doesn’t Microsoft claim that Windows has better driver support than Linux ….. ?)

cd ~/install_files
wget http://www.amd.com/us-en/assets/content_type/utilities/V4.51.zip
unzip V4.51.zip -d driver
mkisofs -o driver.iso -R -J driver

In the VirtualBox window, mount driver.iso . Then go to:
Control Panel > Hardware and Sound > Device Manager. Right click on Ethernet Controller > Update Driver Software > Browser my computer…
Navigate to the CDROM drive, and click ok.

Wait a minute… and congratulations, you have installed Vista

Troubleshooting

I did upgrade to Feisty, but had an issue when upgrading. There seemed to be an issue of upgrading the kernel. I was told to run /etc/init.d/vboxdrv setup, however, this kept on erroring out, which showed a compilation error in /var/lib/vbox-install.log .

To rectify the situation, find out what version of the kernel you are running:

uname -r

This should give you what version of the Ubuntu linux kernel you are running. In my case it was “2.6.20-13-386″. Now you want to install the kernel headers for your specific version of the kernel. In my case:

sudo apt-get install linux-headers-2.6.20-13-386

Modify the numbers of the end of the apt-get command to match what uname -r tells you!

Now, just reinstall the VirtualBox package (I had to do it twice, until I got no errors) that you downloaded earlier,

cd ~/install_files
sudo dpkg -i VirtualBox_1.3.8_Ubuntu_edgy_i386.deb

Now everything should work nicely!

If you have any further issues, post them in the comments and I will try to help.

References

[1] - VirtualBox How-to
[2] - Virtual Machine Comparison
[3] - AMD Drivers List
[4] - VirtualBox User’s Manual (PDF)

Guides & Ubuntu23 Mar 2007 10:30 pm

Ubuntu 7.04, Feisty Fawn, has just been released, so why not upgrade your machine.

To replace all your repositories, at the terminal:

sudo sed -e 's/edgy/feisty/g' -i /etc/apt/sources.list


Note:
You can likely also upgrade Dapper to Feisty beta. I have not tried this, directly. I have upgrade from Dapper to Edgy using this method before. So you could upgrade to Edgy first, or go straight to Feisty (if you are brave):

Now update:

sudo apt-get update

If you get any error messages, comment those lines out of /etc/apt/sources.list (make sure you sudo to edit the file). Certain repositories, such as automatix are not ready for Feisty yet.

Now upgrade:

sudo apt-get upgrade

You will be asked to keep certain configuration files, it is up to you (I am not responsible if you overwrite your perfectly crafted configuration files). I was only asked for a handful of packages. I may take a while to download and setup (several hours). You can likely let apt download for an hour or two, but then you should be around to answer the configuration questions. I haven’t noticed any problems just keeping the old versions…

One more command:

sudo apt-get dist-upgrade

This command should be quicker than the plain upgrade, but will still likely take an hour.

You likely will have to restart your computer. You should run the update, upgrade, and dist-upgrade apt commands regularly. I have noticed that there are changes almost daily to the packages. You could add something like the following to your crontab. Make sure to get root’s crontab, via sudo crontab -e

0 4 * * * apt-get -y update && apt-get -y upgrade && apt-get -y dist-upgrade && apt-get -y clean

This will update your system every night.

Congratulations, you are running the latest and greatest version of Ubuntu.

Guides & Ubuntu23 Mar 2007 10:19 pm

I finally managed to get a sound card for an old computer. Now, I can make my Ubuntu Alarm Clock! What better way to wake up each morning, than to have your friendly linux box read the news to you? The techniques that I am using are nothing new (Hak5 did it and some people at the Ubuntu Forums have talked about it). It is pretty simple, just download and install the rss2html.pl file and the necessary perl libaries, then create a bash script and add it to the crontab.

Get the programs

You will need festival and perl. You will also need mplayer if you want to play music. You can do the standard “sudo apt-get install …” to get these (they were all installed in my basic edgy installation).

I am going to use cpan to install the perl modules. cpan is like apt for perl. You might have to set up cpan if this is your first time using it. If you are asked to set it up, I recommend typing “no” on the first question, and cpan will autoconfigure.
At the terminal:

sudo cpan

This is the cpan terminal, autoconfigure if necessary. It may take a while to install each package. If it says it requires other modules, install them as well.

install XML::RSS
install XML::Parser
install DateTime::Format::Mail
install DateTime::Format::W3CDTF

Create a file called “rss2html.pl” in ~/alarm and put this in it:

rss2html.pl

#!/usr/bin/perl -w
# rss2html - converts an RSS file to HTML
# It take one argument, either a file on the local system,
# or an HTTP URL like http://slashdot.org/slashdot.rdf
# by Jonathan Eisenzopf. v1.0 19990901
# Copyright (c) 1999 Jupitermedia Corp. All Rights Reserved.
# See http://www.webreference.com/perl for more information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

#  ~~~P1mped 0ut l33t hax0r s7yle by d1gital~~~

# INCLUDES
use strict;
use XML::RSS;
use LWP::Simple;

# Declare variables
my $content;
my $file;

# MAIN
# check for command-line argument
die "Usage: rss2html.pl
 ( | )\n" unless @ARGV == 2;

# get the command-line argument
my $arg = shift;

my $lines = $arg;
$arg = shift;
# create new instance of XML::RSS
my $rss = new XML::RSS;

# argument is a URL
if ($arg=~ /http:/i) {
    $content = get($arg);
    die "Could not retrieve $arg" unless $content;
    # parse the RSS content
    $rss->parse($content);

# argument is a file
} else {
    $file = $arg;
    die "File \"$file\" does't exist.\n" unless -e $file;
    # parse the RSS file
    $rss->parsefile($file);
}

# print the HTML channel
&print_html($rss);

# SUBROUTINES
sub print_html {
    my $rss = shift;
    print <{'items'}})
    {
      next unless defined($item->{'title'});
      print "$item->{'title'}... ... ... ... ...\n";
      if($i==$lines - 1){
         last;
      }
       $i = $i + 1;
    }

    print <

Play a Random Song

You don’t have to do this, but I want to hear a song after the news, so make a file, music.sh in ~/alarm
From the Ubuntu Forum

music.sh

#!/bin/bash
#made by rusl modifying file
#from http://www.macosxhints.com/article.p...51108193636341

# File locations
WritingsPath=/home//
/
TempLog=/tmp/random-alarm-music.log

# Create a temporary logfile of all matches
find $WritingsPath -iregex ".*.mp3" > $TempLog
find $WritingsPath -iregex ".*.ogg" >> $TempLog
find $WritingsPath -iregex ".*.wav" >> $TempLog

# Choose a random line number (any number from 1 to the length of the file)
LowerBound=1
RandomMax=32767
UpperBound=$(cat $TempLog | wc -l)
RandomLine=$(( $LowerBound + ($UpperBound * $RANDOM) / ($RandomMax + 1) ))

# Use sed to grab the random line
Command=$(sed -n "$RandomLine{p;q;}" "$TempLog")

# open the random line in TextEdit
mplayer "$Command"

Make Your Alarm File

Make a file alarm.sh in ~/alarm

alarm.sh

rm -rf alarm.txt
echo "good morning , today is" >> alarm.txt
date >> alarm.txt
echo "From Digg" >> alarm.txt
~/alarm/rss2html.pl 6 http://digg.com/rss/index.xml >> alarm.txt

echo "From Slashdot" >> alarm.txt
~/alarm/rss2html.pl 6 http://rss.slashdot.org/Slashdot/slashdot >> alarm.txt

festival --tts alarm.txt
rm -rf alarm.txt

~/alarm/music.sh

You can add any number of news sources.

Set Permissions

cd ~/alarm
chmod +x rss2html.pl
chmod +x alarm.sh

Set Your Alarm

Use the crontab to set your alarm. From the terminal:

crontab -e

And paste this into the file:

0 7 * * * /home/USERNAME/alarm/alarm.sh

Further additions

  • Hak5 has a script to get the weather.

« Previous Page