Linux: March 2007 Archives
My poor abused laptop has a habit of loosing it's DVD drive on a regular basis, after a few drops too many. Normally I had simply rebooted after pushing back in the drive, but I was feeling like a dirty windows user with that method :)
As it turns out, Linux provides the answer. In Ubuntu, simply install "hotswap" using apt-get or your preferred method. To rescan for IDE devices run the following command:
sudo hotswap -c 1 rescan-ideIgnore the errors and simply enjoy your DVD :)
We have had a nice native IPv6 network at Blacknight for a while. Until recently we haven't been making much use of it, but that is changing. Various hosts on the network such as www and mail are gradually being IPv6 enabled.
Documentation for setting up native IPv6 on Redhat based distributions was a bit lacking so I've included the steps for adding an IPv6 address to eth0 below. I've also added details on how to add it to Debian based distributions.
Continue reading Native IPv6 Networking On RedHat And Debian Based Distributions.
I have been using IE4Linux for a while in order to test some websites I'm responsible for and make sure that they are useful to people who still have to use Internet Explorer. To make it even handier, the IE View extension for Firefox works well under Ubuntu.
The only problem I've run into is that the "find" button in the IE View preferences doesn't like Linux file paths, so to use it you have to enter the path to IE manually. In my case this is /home/niall/bin/ie6. Once it's setup properly, I can rightclick on the link and select "Open Link Target In IE" and suffer for a few minutes in the name of testing!
It looks like Dell are beginning to see the light! They are now commiting to use only hardware that has drivers in the mainstream kernel where possible. It will be very interesting to see if they can put some pressure on the makers of graphic cards, namely ATI and Nvidia, to open up more.
A Dell laptop with no binary blobs to cause random crashes appeals to me after living with a laptop with an ATI graphics chipset for a few years.
One of the better reasons for using Firefox are it's extensions. Currently I am using the following:
- Web Developer Very handy toolbar that gives a lot of essential functions for anyone who does ANY work with html.
- HostIP.info Pointless really unless you are like useless info. Has already turned up some interesting facts :)
- User Agent Switcher Another good extension which is good at turning up interesting ways of getting into sites!
- Flashblock I tend to dislike useless flash ads, so anything that kills them while leaving the option of clicking on flash games for a bit of distraction is always going to be handy.
- ShowIp With the work I do on a day to day basis, it is very handy to know what IP address you're looking at when you view a site. This simple extension displays the IP of the site in the status bar and offers shortcuts to online DNS utilities if you click on the IP.
- Switch Proxy My laptop is thrown onto lots of different networks, often with different proxies. This extension gives me a nice drop down menu with a list of proxies and can be a nice time saver.
I have had no optical drive in my Laptop for a while since the original fell out a couple of months ago. I finally put in a DVD Drive this evening and attempted to watch a DVD. I started up MPlayer and got the following error:
libdvdread: Error cracking CSS key for /VIDEO_TS/VTS_01_0.VOBThis was happening for every DVD I tried. As it turns out, the error seems to have been caused by the fact that the region on the DVD Drive I put in was set to Region 1 (America). Changing the region was fairly easy. There is a imaginately named utility called "regionset" available from apt (apt-get install regionset) which can quickly set the correct region. Run it as root (sudo regionset) and tell it that yes, you do wish to change the dvd region. Then put in the number for the region you're in. Once this is done, you can then hopefully enjoy your movie.
I came across Damn Interesting in my wanderings. I shouldn't be allowed near sites like this as it's too easy to lose hours of my life which could probably be put to more productive use :)
What were Ubuntu thinking when they designed the new logo?
Or am I just too dirty minded from exposure to the net?
Originally seen here.
Or am I just too dirty minded from exposure to the net?
Originally seen here.
I have setup FeedOnFeeds for aggregating various RSS feed I'm subscribed to. While not the prettiest, it is a decent piece of software which allows me check all my feeds in one place, and can be checked from any web enabled device.
However there is no inbuilt authentication, so I have been protecting it with a htaccess file. Firefox can save the password, but having the password box pop-up every time I open my browser was getting annoying, so I decided to make life slightly easier for myself :)
I access the Internet primarily from three ip addresses so it was easy to convince Apache to trust those. The .htaccess file for my FeedOnFeeds folder is now:
AuthUserFile /path/to/htpasswdSome info has been changed, enter valid ips and a proper path to the htpasswd file. When I go to my FeedOnFeeds folder now, Apache will check to see if I'm coming from an allowed ip address. If I am, it will allow me straight in unmolested. If I am coming from an unknown ip address, it will ask for a username and password, and check it against /path/to/htpasswd. Once I enter the right username and password, I will be allowed in. For FeedOnFeeds, the "allow from localhost" line is important. You tell FeedOnFeeds to check the rss feeds you are subscribed to by calling "/usr/bin/GET http:/site.com/feedonfeeds/update-quiet.php" from cron on a regular basis. Without the "allow from localhost" line, you have to give GET a valid username and password. The net result of this, is that now I only get asked for a username and password when I'm out and about, which makes me a little less cranky :)
AuthName "FeedOnFeeds"
Authtype Basic
require valid-user
order deny,allow
deny from all
allow from 1.2.3.4
allow from 4.5.6.7
allow from localhost
Satisfy Any
I'm currently in the market for a new MP3 player. I currently have a Creative Zen Touch 20GB which, in fairness, is a great device. The main points going for it are good battery life and a decent interface. However it lacks USB Mass Storage support, and has a very very annonying "Random" button on the front which I'm too good at accidently pressing.
Standard USB Mass Storage support is the main feature that I will be looking for in the new player. I have about 10G of music on the Zen, which means 10G free. You can transfer normal files to it, however unless the computer at the other end has the correct software, it's not all that useful. If I'm using Ubuntu or Debian, it's not too big a deal as I can simply apt-get install gnomad2, but on a Windows PC the Creative software is up to usual Creative standards. In order words, not the best.
Another nice feature would be Ogg support. I'm not going to re-encode the big pile of CD's in the corner of my room, but I would have no problem encoding new CDs using Ogg. WMA support is very down on my list of priorities for some odd reason :)
From searching around the internet I've come across the following options:
- IRiver H340: Seems to do all of what I want. Doesn't explicitly say USB Mass Storage Support though.
- Vibes: Looks nice, but has only 12G of space.
- Rockbox Based Player: Getting a device and flashing it with Rockbox will mean that even an Ipod will do what I want, and will even give me Doom!!
After reading a response to a post I put up on the Irish Webmaster Forum, I headed to the Garda website. From what I can see of it, it is absolutely useless for any informative purposes under Linux.
To give an example, say I want to get the phone number for the Garda Station in Listowel, Kerry. First of all I will go to www.garda.ie. This will present me with a page with the option to click on "New Visitors" or "Previous Visitors". The only different between the two is that "New Visitor" forces me to read a message from Noel Conroy before having to click the "Enter" link in order to get to the same page as "Previous Visitors" would have originally sent me to.
Once I get to the home.html page I can try to get to the "Contact Us" link. This will do absolutely NOTHING in Firefox. When you click on the link it goes to "javascript:hili('cux','cu');" My Javascript isn't the best at the moment, so I can't figure out exactly what this is supposed to do, but I can tell you for fact that it doesn't work on Firefox 2.0.0.2 on Ubuntu.
I eventually clicked on the "FAQs" button in order to see if there is some reason for the lack of any standards support. I clicked on the "I want to email a Garda Station" link. This kindly informed me that the Gardai "do not have external e-mail facilities for the general public to contact Garda Stations", but gave me a "local stations" link to click. From here I was able to click on Kerry, and was able to find the number for the Listowel Garda Station in a couple of seconds.
What I would love to know, is why the link for "Contact Us" can't be changed from "javascript:hili('cux','cu');" to "stations.html". It takes less characters ( :) ), is compatible with every browser that I know, and is a LOT simplier to implement. It is the same with every other link in the blue box at the top left of the page, every one of them uses the hili javascript function. I don't really care what the hili function is supposed to be able to do, but it is unusable under Firefox.
The Garda website should be a public website which should be available to everyone. The unnecessary complication that has been added to the links on the website means that I cannot use the site. I don't even want to think about how bad it must appear to people who with disabilities who use.
To quote from the NDA website:
Irish public policy includes requirements for government departments and agencies to procure accessible ICT solutions where possible. In particular, all government departments are now expected to have their websites accessible to Priority 1 & 2 of the Web Content Accessibility Guidelines (WCAG) 1.0 from the Web Accessibility Initiative (WAI). The National Disability Authority have adopted WCAG for these guidelines.There is no way that the Garda website can pass any WCAG test. The lack of bog standed links means that even a simple search engine bot, such as GoogleBot, won't be able to index the site. What even more amazing is that a lot of Gardai email addresses are under the iol.ie domain. I have no problem with IOL, they provided me with Internet when I was on DialUp, but I would have hoped that the Garda would have their own infrastructure for email. I have every respect for the job that the Gardai do, however I would have hoped that the Garda Website would be usable be every Irish Citizen. With a little work the Garda Website could be a great resource, but as it stands it is unusable for a sizable minority of Irish Citizens, and not following EU Guidelines for IT. Surely the Gardai should be able to provide a usable website, there is plenty of people in Ireland who can do a lot better job than the current website.
A while ago Michele blogged about generating stats from Rbldnsd. Since then I've had to put it into practice.
During the post he mentioned Jeff Chan's script for getting the numbers from rbldnsd's stats file. The only problem with this script was that it rapidly ran out of steam when you went over ten zones. This becomes a problem when you consider that a dnsbl like countries.nerd.dk has over 200 zones.
A new script was created in order to get around this limitation, which is available here. If no argument is passed to the script, it will return the aggregate numbers for all the zones, and if the zone name is passed in as an argument it will give the numbers for that zone. In both cases it will return two lines. The first is the number of positve hits on the zone, the second line is the total number of requests to the zone.
In order to use the script with mrtg you will have to edit the $statfile variable to point at where rbldnsd is outputting it's stats. For each DNSBL, you have to setup a target in your MRTG config. The target for sbl.spamhaus.org would be:
A new script was created in order to get around this limitation, which is available here. If no argument is passed to the script, it will return the aggregate numbers for all the zones, and if the zone name is passed in as an argument it will give the numbers for that zone. In both cases it will return two lines. The first is the number of positve hits on the zone, the second line is the total number of requests to the zone.
In order to use the script with mrtg you will have to edit the $statfile variable to point at where rbldnsd is outputting it's stats. For each DNSBL, you have to setup a target in your MRTG config. The target for sbl.spamhaus.org would be:
Target[sbl.spamhaus.org]: `perl /etc/mrtg/rbldnsdstat.pl sbl.spamhaus.org` MaxBytes[sbl.spamhaus.org]: 4800000MRTG should then be run every five minutes using cron.
Title[sbl.spamhaus.org]: RBLDNSD - sbl.spamhaus.org
PageTop[sbl.spamhaus.org]: <H1>sbl.spamhaus.org requests </H1>
I have recently had reason to convert an Access MDB file to CSV for use in a mysql database. I don't like the idea of an Access database on a production server and Microsoft has been agreeing since 1999.
As it turns out it is actually very easy, there is GPL software available for the job at http://mdbtools.sourceforge.net/. If you are using Ubuntu or Debian you can use apt-get install the mdbtools package.
To get the list of tables, you run the following command:
mdb-tables database.mdbYou can then get a CSV version for each table using:
mdb-export database.mdb table_nameYou can also convert the mdb into a format required by MySQL. First you must get the put the table schema into the database using the following command:
mdb-schema database.mdb | mysql -u username -p database_nameYou then import each table by running:
mdb-export -I database.mdb table_name | sed -e 's/)$/)\;/' | mysql -u username -p database_nameSed is required as mdb-export doesn't put a semi-colon at the end of each insert statement, which MySQL definately doesn't like. After running this, you can now be rid of the horror that are Access MDB files :)
Michele recently posted about using mod-rewrite to redirect domain.tld to www.domain.tld. Why redirect to www.domain.tld though?
Most websites today respond to www mainly because that's just how it's done. However when I'm sending email to someone, I don't send it to user@mail.domain.tld, so why do I have to type "www." to go to the website? The server should hopefully know that I want the website if I'm connecting to port 80 or port 443. Why should I need to type a whole FOUR extra characters :)
There is already a campaign underway to promote the deprecation of "www.", it can be found at http://no-www.org. I propose that Michele changes his rewrite rule to the following:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^domain.tld$ [NC]
RewriteRule ^(.*)$ http://domain.tld/$1 [L,R=301]
Think of all the w keys you will save!
