I was quite impressed with myself the other day that I’d actually managed to write a bash script within ubuntu which served a purpose. I wanted to be able to monitor the size of files within a particular directory, and report back their size when a change was observed.I found a program called fileschanged, which fulfilled half the problem, namely reporting back a file had changed, but I needed a greater level of detail than that. What it did allow me to do however was pass the filename as an argument (along with some other parameter) to another program. I duely spent an hour or so trying to figure out a script to take that filename and report back its filesize and the current time (which I assume is close enough to that which the file was changed). This is what it looks like:#!/bin/bashif [ -z "$1" ] && [ -z "$2" ]; then exitfiFN=$2DATE=$(date +%s)FILESIZE=$(stat -c%s "$FN")echo "$DATE,$FN,$FILESIZE"
Archive for category Ubuntu
Bash bash
Oct 16
I spent a large amount of time last week, after realising that I could very easy install compiz and XGL on my machine at uni, trying to install it upon my home machine. As its 64 bit, and owing to previous problems I’d experienced installing 64 bit applications (like linux for instance), I spent the best part of 2 days attempting to install both, before caving and completely giving up.I got to the stage where XGL is installed properly and seems to work ok, but the compiz gnome window manager isn’t working properly, meaning I have no borders to any panes I create.It’s not like I need a whizzy 4 sided cube spinning around, but I thought it might be fun…
Slug’s Talking Nicely
Aug 19
I’ve had a couple of problems getting my slug working nice under ubuntu. Firstly, although it is recognised by default and I can connect and browse via samba, when I actually came to playing my media, everything got screwed up, with Amarok trying to launch kmail…… I could copy files to ubuntu and play them properly from there, but straight off of the slug was a no go.I found the solution was to mount it under ubuntu using the command:sudo mount -t smbfs //NAS/DISK 1 /media/slug -o username=user,password=passWhere user and pass are your username and password for the slug respectively and the backslash indicates a space. This poses another problem however, that you don’t want to have to fire up a terminal everytime you want to listen to media, instead its better to get it automounted at startup using an entry in /etc/fstab:sudo gedit /etc/fstaband then add a line://NAS/DISK 401 /media/slug smbfs username=user,password=pass,rw
Again supplimenting user and pass with your username and password. The 40 indicates a space in the name of the share which is on the NAS, which annoyingly took me a large amount of time to figure out!
Another post about ubuntu? Where will it end?I was fairly excited from thursday evenings antics of getting things working on my machine at home, I thought I’d give it a try with my dev machine at uni. My graphics card, a 9600 (yes ATI, I know!) had been screwed since the day I’d put on Dapper, and to be honest, as I’m not using it that much for GL stuff, I wasn’t really bothered about it. After installing the ATI drivers, them not working and reinstalling the fglrx xorg drivers, I managed to get it working nicely within about 30 mins. This wiki page may help if you’re experiencing similar problems. In my case, my driver was loading, but I was having a problem with libdri.a menaing 3d acceleration got switched off. Anyway, glxgears is now shuvving out a good 3000+ fps so I’m happy enough with that.Aha, I thought, I’ll give the soundcard a bash – a 6 year old SBLive Platinum complete with live drive. Although this (with some tweaking in alsamixer) give outputs on the pci card, the front bay wasn’t getting any output to the headphone socket. I tried to install and compile the latest emu10k drivers from alsa, but then everything got screwed up and no drivers were loading. I removed them and reinstalled what I had before. I carried on with my troubles, inspecting my front bay for any connection problems, notcing one fairly major one…..having the headphones in the mic input – doh! I’d do well to check the obvious things first in the future.
Did I speak too soon?
Aug 10
It seems I may have spoken too soon about my linux joys with ubuntu. After performing a dist-upgrade on my previous beta version of Dapper, I discovered I’d have to go through the same problems of downloading kernel source and linux header packages for my new kernel version.I also discovered after doing this that actually there were further problems on booting Dapper straight up. Apparently the pointers to drives get screwed up somewhere in the process. Although I could boot into X using just the safety mode and booting from there, this wasn’t ideal and I still wanted my lovely little 64 bit install to be working nicely. I dicovered that adding the line ide=nodma to the line of the reference in grub solved the problem.So I’m in, great you might think, but oh no – lets try amarok on for size too… Amarok (A shiny linux media player I discoved) wasn’t playing any of my mp3’s at all, just whizzing through the lot of them. A short search revealed that in using the xine engine, xine needed further codecs to be installed to get sound out too. You’d think that a dependency would be put in place here to sort this out by default. One nice feature I like is the inbuilt submission to last.fm, a great idea in my book – I use it all the time.Anyway, now my Ubuntu is being nice. Oh no, have I just jinxed it?
Ubuntu Working
Aug 7
FInally, after a grand total of 10 months, I have a 64bit version of Ubuntu Linux working upon my home machine.This is great news, not only does it mean that I have a wonderful OS to try out for size, but that I can easily convert my subversion server code and latex source to my machine.As I’ve never mentioned it before, I’ll detail what the problem was here. First up, the graphics card didn’t have drivers which were working which meant that my X800 was pretty pathetic to be quite honest with you. There was a fairly simple solution through apt, which would have been nice if………………the network card on my A8N-VM CSM was working properly, which it wasn’t, due to use of an NFORCE chipset. A build of some drivers were neccessary, which required adding a load of packages (simple if apt were working!).Anyway, several days of man hours later, and this ubuntu thing works wonderfully. If you’re having similar troubles with this board, its probably best to use this page for guidance.