Saturday 13 December 2008

Cluster

I'm quite frustrated with the time it takes me to compile things, especially the Linux kernel as its huge. I'm sure everyone else is too, but I'm going to do something about it. I've been thinking over the past while just how cool it would be to have a cluster, if I needed more processing power I'd just walk over to it and power on a few boxes, then watch as compilation takes a fraction of the time. So, thats my new project. I will design and build a home cluster using a few computers I have kicking around. Watch this space. 


Monday 24 November 2008

Emacs

Downloaded Emacs after spending the day wondering why people are so darn obsessive about it. First thoughts upon running "apt-get install emacs":
"Wow. This is huge."
When it (finally) downloaded, and I plucked up the courage to run the text editor that had just cost me 15 minutes-ish to download, I was greeted with this horrible little grey monster, which I'm assuming is xemacs. I'd heard (and seen screenshots) of emacs in a terminal, and I'm now wondering how to achieve said terminal-running-emacs (temacs?). More updates to come once I've discovered how.

Thursday 20 November 2008

Why's Guide to Ruby

As you all know I've been learning Ruby recently, and I've been looking around for good resources on the web. Steve has been a good help, he introduced me to the wild side of coding, a fellow called Why the Lucky Stiff. He's an odd chap who's written a guide to the Ruby language that has cartoon strips in it (!), you can check it out here: http://poignantguide.net/ruby/
It really is quite entertaining, he seems to be smoking more than just tobacco in his pipe.

Wednesday 12 November 2008

Converting to Linux

So you've heard a lot about this thing called Linux. What is it? Is it really all that good? Is it as difficult to use as some people claim? How can I get it? Would it be difficult to convert my business to a Linux-using one?

I'm writing this article to clear up some questions for you.

Everyone seems to be talking about using Linux, what is it? Linux is an operating system kernel that is completely free and open source, not closed source like Microsoft Windows or Mac OS. Linus Torvalds originated the project, and still maintains it today along with an expanding team of coders. It's basically a clone of the UNIX kernel, so if you've used UNIX before, you'll be right at home.

GNU/Linux is the operating system that utilises the Linux kernel, there are several hundred distributions ("distro's") that are out today such as Ubuntu Linux, Gentoo Linux and Slackware Linux (to name a few). Each distro differs from the others in the default software that ships with it and the way that it performs certain tasks, some have a noticeable System V influence whereas others are influenced more by BSD. To see a big list of distributions and details on each one, check out http://www.distrowatch.com/.

Is it good? I think so. The main reason why I like it is because everything about it is free of charge (well, a few companies release distro's that aren't free, like Red Hat Enterprise Linux for instance). You can deploy a server running a distro of Linux (I can't be bothered calling it by its full name, so I'll simply refer to it as Linux from now on) for a fraction of the price of deploying a Windows one, you only need to buy the hardware. The vast majority of software for Linux is free and open source too, so you really start to notice the savings after a while. I've been running Linux on my laptop for so long now that the idea of paying for a software package is laughable, I can get a Linux equivalent for nothing! Say you own a company and you need to kit out a laptop for every employee; if you went for what I call the "Microsoft Route", you'd have to get a copy of Vista for each one (or buy a multi-user licence, or a corporate licence whatever) Pricey, whatever way you do it. Then you'll probably need to get Microsoft Office, which is another sizeable slice out of the budget cake, then whatever other specialist applications you use in your company. A lot of dough, if you're a new startup then ouch, it hurts. With Linux, you can just buy your laptops, stick Linux on them, sorted. Download whatever other apps you need for free too.

I have compiled a list of a few software packages commonly used in Microsoft Windows and their Linux equivalents/replacements, this is by no means a definitive guide, bear in mind there are other apps out there developed for Linux that will do the same thing. If your favourite open source project isn’t listed, then I’m sorry :P

Windows ApplicationLinux EquivalentNotes
Microsoft OfficeOpenOfficeThe free office suite, OpenOffice, is pretty darn sweet. And free.
Microsoft OutlookEvolutionEvolution is the open source community's answer to Microsoft Outlook, it has a calendar, contacts, all those things you know and love from Outlook.
Finance Applications (for example Quicken)GNUcashThis is a major stumbling block for accountants I'd imagine, you need your specialised apps! If you really can't stop using Quicken, then I'd suggest a package called WINE, which I'll discuss later.
Media Players (for example Winamp or iTunes)VLC, xmms, audaciousAs far as I know, you can even use Winamp skins with Audacious...
Adobe PhotoshopGIMPThis is the big one, the main reason why a lot of graphics designers stick with Windows or Mac OS. I think you'll like the GIMP though. Pity about the name.
Various Disk Partition ToolsGparted, fdiskGparted is nice and easy to use, and provides pretty much the same functionality as Partition Magic and the others, fdisk is more advanced (it's a command-line app) but I really like it. I wouldn't use anything else.
The fact that you have an NTFS partition kicking around that you need to get your data from...ntfs-3gTry ntfs-3g, it allows you to read/write to NTFS formatted partitions. Simple.

Thats enough to get you started I think, if you need more then Google is an excellent resource for finding software, all it takes is a simple search.

I mentioned an app for Linux called WINE; you're probably wondering what it is (or perhaps you Googled it... I don't know...). WINE is a Windows emulation environment that sets up an area on your hard-drive that looks like a Windows install, basically it means you can install/run Windows executables from Linux. So that means if you simply cannot live without that one Windows app, you can still run it.

Another great thing to do if you can't break your relationship with Windows is running a Windows install within a virtualisation environment such as Qemu or VMware. This means you can have Linux on a PC, but you can still run Windows if you need it badly.

Another suggestion is to set up a dual boot system, but thats another article...

One of the main reasons people don't switch to Linux is because they hear all the horror stories telling how opaque and unforgiving it is, and they get scared. Most people seem to be under the impression that they won't have any idea how the thing works once they get it installed (if they get it installed...) but this is untrue. Ok, as soon as you install it you might have troubles as its a little different to Windows XP or Mac OS, but this can be said about any OS. People always complain when it isn't what they're used to, but then again, this is a completely different operating system, of course it's different. Sorry, those sort of people irritate me... :D

Provided you start off with an easy to use distro (something like Ubuntu or Fedora) you shouldn't have any problems, provided you read the documentation. And you can quote me on that, the newer releases of these distributions are built so that its easy to migrate from Windows and Mac OS. 

So, where can you get Linux? Thats probably the easiest question to answer so far. Each distro has a website, with a download section. Simple. Some distributions, for example Ubuntu, will offer you something called a LiveCD, which is basically a disc that you can boot into; this allows you to "try before you buy". If you like it you can hit the install button, if you don't, you can throw the disc in the bin and get on with your Windows life. You can either download the .iso image and burn it to disc yourself, or you can mail-order them, and they'll come in a shiny package.

And thats it! You'll soon be loving your new free, highly configurable, easy to use operating system.

Now, some links to conclude:

http://www.distrowatch.com/ -- A definitive list of distributions with information.

http://openoffice.org-suite.com -- Open Office

http://projects.gnome.org/evolution/ -- Evolution Mail

www.gnucash.org/ -- GNU Cash, alternative to Quicken.

http://www.videolan.org/vlc/ -- VLC Media Player



http://www.gimp.org/ -- Home of the GIMP.


http://www.ntfs-3g.org/ -- ntfs-3g, a driver for reading and writing NTFS partitions.

http://winehq.org/ -- The wine project.

Tuesday 11 November 2008

Ruby Update

Last night I cracked out Programming Ruby: The Pragmatic Programmer's Guide and did a bit of learning. I'd done a bit of Ruby programming before I learned C, and this book brought back a few good memories... all the nice little things you can do such as capitalising a string by simply doing "yourstring.capitalize". Delicious. Plus regexp is built in! Madness! Yeah, I think I like Ruby.

I'll give you more details as I learn more, I didn't write much in the way of actual code last night, I'm still learning how it all hangs together.

Mac Rant

This is genius, my good friend Moley just had a bit of a rant about Mac OS:

http://mole-spot.blogspot.com/2008/11/on-mac.html

Give him love.

Monday 10 November 2008

Ruby

I've been thinking a lot about this recently: I feel that it's a severe hole in my programming knowledge if I don't know any object-oriented languages.

I only know C. Which isn't object-oriented. What am I going to do about this? I think I'm going to learn Ruby, as its apparently 100% OO'd and nice to write in.

I'll let you know how it goes!

Erm, can anyone recommend any books?

Saturday 8 November 2008

My Backup Solution

Last night I put the finishing touches on my little backup system for my home network and it all works!

About 2 months ago I grew annoyed with the fact that I had no real backup system in place for my gear, I decided that something needed to be done. I did a quick search for backup schedulers and didn't find anything out there that tickled my fancy, so I thought "What the heck, I'll build my own."

It consists of a daemon on a server computer (which I wrote in C) and a little Python script on each computer in my network (written for me by my good friend Steve as I lack Python skillz).

The daemon comes up when the server boots and sends a broadcast packet to let everyone know it is awake and ready to receive files, each host then sends the server a request to join the backup queue. The server works through the queue, starting what I call the backup transaction with each host in the queue in turn; first it sends the host a "backup now!" packet, the host sends the compressed backup files then tells the server when it's done. The daemon then moves on to the next client in the list. Basic stuff really. But it took me ages to get right...

The daemon should compile on a Linux box (well, I hope so, it compiled on mine...). The log directory needs to be set to somewhere that is writeable by the user you run the executable with obviously.

I'm not going to be so arrogant as to say that my code is perfect, it isn't. I'm putting it up here to show everybody and to learn from your comments. Don't insult me too much please :P


Here goes:
BUddyd.c: http://pastie.org/310236
BUddy.py: http://pastie.org/310981

The "auto client" I talk about is an edited version of the BUddy.py script that listens for the broadcast packet and then joins the queue. I'm just sticking with the manual way for now.



Friday 7 November 2008

Me on a Mac

I'm in the computer room in school at the moment, its lunchtime and Steve & Connor are with me. We're on Macs. Yes, Macs. As in the computers. Not Emacs. I think its a new iMac, not too sure having never really been interested in this sort of thing. 

So, turns out you can get a terminal pretty easily on these, on all the Windows computers in school you can't have command prompt. I have no idea why its ok for students to get a terminal on a Mac. Strange. Maybe the old "You can't hack a Mac" ideology has prevailed here again, all the IT staff are Mac fanboiz... :P 

To tell you the truth, I'm beginning to see why people love these Apple computers. They actually seem quite nice, I mean the monitor is very pretty looking compared to my HP block of plastic I have at home and the picture quality is gorgeous. Splendid. 

Unfortunately they cost the earth, and you can't really configure anything the way you like. Plus you can't ALT+p to get the screaming fast programs menu up (hehe, see my previous post on my new love: wmii). Which is why I probably won't be getting a Mac any time soon. I love my Linux experience, I've become used to downloading programs for free and not feeling guilty about it, then configuring them to precisely the way I want them, this isn't really what this Mac is offering me. Plus it's £1000+... 


wmii

So. I'd been hearing over the past few days about another lightweight window manager called wmii. I'd heard that it was even lighter than Fluxbox (I was skeptical) and pretty much cut out any mouse usage as everything is done by using keyboard shortcuts (I was excited). So, I thought I'd give it a whizz, and, so far so good.

Get it here: http://suckless.org/wmii

I had a little trouble compiling the source, and to be perfectly honest I gave up. I'm not into fixing mistakes, I ended up using apt-get to install. Apart from that, things have been dandy.

So, why's it different? Well, first off its a tiled window manager, which is something that I've never tried before, basically you don't drag the windows about but just let it arrange them all nicely as if they're tiles on a bathroom wall. Which works rather well, you no longer have to do all this yourself when you have four terminals open, it resizes them to all fit on your screen. Its magnificent.

And yes, it is very lightweight. But only because there's virtually no graphics involved, window decoration seems to consist of flat colours. But I don't mind, things zip along nicely.

Another nice little touch is what the wmii crew call the programs menu, you hit ALT+p and a list of all the programs you have installed come up and you just enter the one you want. Which is nice and easy, you need to try it for yourself to really understand, I haven't done it justice with my clumsy explanation :P

So, yeah, wmii is great and light, and I think I'll stick with it for a while, I love the tiling part. Bit hard to configure at the minute, I still haven't grasped it yet...

Get it.

Thursday 6 November 2008

ICT blog

Steve started a blog about our adventures in ICT. And I'm writing a little on it.

Check it out:

http://ictlol.blogspot.com

Enjoy. Despite its complete lack of purpose. :D

Saturday 1 November 2008

Fluxbox Install Guide

Fluxbox is a lightweight window manager for the Linux operating system, and boy is it nice. It's basically like Gnome or KDE, without all the extra bloat. Here's it what it can look like when you configure it the way you want it:


Check out the project website here.
Link
So, how do you install it?
On Debian and Ubuntu it's nice and easy, simply type these magic words into your terminal:
#apt-get update
#apt-get clean
#apt-get install fluxbox

Do this all as root (thats what the # means).

This will do it all for you. Lovely.

On Ubuntu you need to check whether or not you have the Universe repositories in your /etc/apt/sources.list file, or else this won't work as it won't be able to find the package, and we don't want that now do we?

Note that this way will give you the not-so-bleeding edge version of fluxbox, if you want the still-warm-from-the-oven-freshly-baked new version then you're going to have to compile from source. This is where you Ubuntu dudes start to click the "Back" key on your browsers and look for another easier way of doing it, but I assure you, this is simple. You're going to need to find the latest source tarball, at the time of writing it looks like 1.0.0 is the latest stable version, so lets get that. You can go more recent if you want (you could get the development version, apparently its pretty stable at this stage anyway)

$ wget http://kent.dl.sourceforge.net/sourceforge/fluxbox/fluxbox-1.0.0.tar.gz

You'll need to extract that tarball:

$ tar -xvvf fluxbox-1.0.0.tar.gz

The -xvvf part is just the command line arguments that tell tar to extract the file and be verbose about it.

Now for the fun part, from the extracted directory you just run the configure script:

$ ./configure

Provided that ran through with no errors you can now get to compiling and installing:

$ make
# make install

Notice how the "make install" is run as root? Thats the install step that puts the files into their correct place, so it needs root access to do that.

Fluxbox is now installed! Note, if you had trouble with the configure script and it said something about a missing dependancy, you can do a sneaky little trick and get the dependancies automatically:

# sudo apt-get build-dep fluxbox

Thats kind of a dirty hack, don't tell any of your Slackware mates you did it...

Now, we need to get this running on startup. Change your /etc/X11/default-display-manager file so it is simply:

/usr/bin/fluxbox

Then, if you have the file "xsession" in your home directory, set it to:

exec startfluxbox

If you don't have one, then just make it. As long as its there and looks like that it should work.

On startup you won't get the Gnome login screen, you'll get the little command line one now, after logging in you then need to type the command:

$ startx

And Fluxbox will start, as it is now your default window manager.

One of the marvelous things about this window manager is the fact that there's loads of styles made by various people already, they've all been creative so people like me don't have to...
You can get some at http://themes.freshmeat.net/browse/962/. There's a whole lot of stuff on there that you wouldn't ever dream of getting, but then again there's a few gems.

Enjoy your new low-fat window manager!

Tuesday 28 October 2008

Windows Azure

Looks like Microsoft is to release "Windows Azure", a new cloud based platform. Looks like you buy it, then all your data is stored somewhere in the deep dark underbelly of the MS network. I can almost hear the tinfoil hats rustling... 

Apart from all the obvious privacy concerns, I think that if Microsoft implement this well it could just work. Then again, everyone says that before a big MS release :P

Full article here:

Saturday 25 October 2008

Arch Linux

So, I downloaded the Arch Linux .iso and got to work installing it on my tester PC. Install was relatively painless, (suprisingly fast might I add), it had me selecting exactly the packages I wanted which was a nice touch, then had me edit my own config files, which struck me as kind of opaque for newbie users. I had no problem having done them all before, but I'd imagine someone less experienced being a little put off. Everything is well documented on their site (http://archlinux.org), they have quite an impressive wiki going there.

Now. How does it run then? Not too badly, I had the usual trouble with Xorg not finding drivers and what-not (right now that computer is still X-less...) but thats more my fault than Arch's, I chose to install an sshd too, and that doesn't work for some reason, keep getting an error when I try to login remotely. Thats another day's problem though... Pacman (Arch's wonderfully named package manager) seems alright, took me a while to figure out to be honest, I'm used to apt-get.

Conclusion: Quite a nice distro if you know what you're doing, if you're comfortable with editing config files yourself then go for it!

Thursday 23 October 2008

Google to release Android source code

Looks like Google has released the source code for their "new" Android mobile platform: http://source.android.com/download. Looks interesting, but I don't think I'll bother to be honest... I have a lot to be getting on with already apart from writing apps for a platform where Google has the right to kill your app at any time and on any phone they please: http://www.theregister.co.uk/2008/10/16/android_kill_switch/.

Favourite quote from the download page: "To build the Android source under Linux, you will need Ubuntu." Need? Ubuntu?

:D

Arch Linux

I've been thinking recently about how I'd like to have a look at a new distro, after about a year now of using Debian Etch I'd like a change. So, after looking at Gentoo and not really liking it (I'm a busy man and don't have time to compile everything from source!) I've settled on trying Arch Linux, with its promises of being nice and light and configurable. So, tonight I'll download the .iso and I'll let everyone know how it goes. I wouldn't have to download it myself if Steve had just brought me in the install disk today in school but no. He forgot. Friends eh?

Linus' Blog

Turns out Linus Torvalds (father of the Linux kernel and general legend) has jumped on the blogging bandwagon recently, http://torvalds-family.blogspot.com/. Dropped him a quick comment...

Wednesday 22 October 2008

Tilda

Just discovered a nice little app for Linux called Tilda, allows you to have a drop down terminal that you can show or hide at will. Pretty neat stuff, I've mainly been using it to do quick command-line stuff while keeping a browser window open (it stays on top of all the windows if you want it to.) Check it out here.

AOL to Nuke User's Content

http://techdirt.com/articles/20081021/0206432604.shtml

Wow, that sounds like a nice way to lose the (probably very few people now) that actually respect you as a company... Well done AOL :P

Monday 20 October 2008

Update

I ended up just quitting MS Word. Losing 30 minutes work. Bleh.

Binary Rain

Hey, just thought I'd start a blog while I'm waiting for MS Word to unfreeze itself, I was working on some Data Flow diagrams for my ICT project and it just froze :( I wish the school computers ran a decent operating system...

So, let me introduce myself, I'm Josh Lockhart, student, musician and all round computer enthusiast. I play guitar, write C and use Debian GNU/Linux. I'll probably end up just writing about things that I've been doing on my computer in this blog, that is if I stay committed to it :P

I go to school, I'm in Upper Sixth and I study Maths, ICT (Information and Communications Technology, the worst subject and course known to man) and Chemistry. I live in Northern Ireland.

Wow, Word is still not responding...