Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Tuesday, 16 September 2008

Command of the Hour: Top Variants

So, I'm trying to start something that I've dubbed "Command of the Hour" on my local Canberra Linux Users Group mailing list. Quite simply, everyone just chimes in and tells everyone else about some random, obscure and useful command that they know of. Doesn't matter what, doesn't have to be related to any previous post, it just has to be something that they've found useful or can see that others might find useful.

But then I thought, why limit this to just my local LUG list? Sure it's great to test drive the idea, but why not try aiming for a wider audience - so here I am copying my initial get the ball rolling post with some top variants here:


atop - I just had an issue where gnome wasn't logging in, but seemed to be stuck constantly accessing the hard drive. This command saved me by showing me exactly which program was using the hard drive and a quick aptitude remove mlocate later my system was working perfectly again. It monitors CPU, memory, disk and network highlighting any that are particularly stressed and shows the processes responsible. Processes are only displayed if they have done something interesting
since the last update. Kernel patches can be taken to enhance the experience if one is so inclined.

htop - Awesome ncurses graphical top. Looks pretty, coloured, and simply highlighting a process and pressing 'S' will attach strace to it to see what that run away process is actually up to. Tag multiple processes and alter the niceness of them all at once or just kill em' all. 'T' toggles between process tree view and ordinary top view.

powertop - I'm sure lots of people know about this one by now, but for anyone who doesn't it can show you various information about what is chewing up energy in your system and provide some recommendations for conserving power.

iftop - top for network traffic. Shows the traffic going to and fro on every individual transfer and totalled down the bottom in ncurses bar graph style. Amounts are displayed for the last 2, 10 and 40 seconds. Filters can be applied if one is only interested in a subset of the total traffic, and it can naturally do hostname lookups and show port numbers/service names.

ntop - another network top, but this one starts a web server on port 3000 to display it's results with pretty graphs. It has the advantage that it provides much more detail - it breaks packets down by size, protocol, etc. It has many displays to analyse the data in varying and sometimes entertaining ways. Of course, being heavyweight as it is, if all you need to know is that traffic is flowing from A to B, firing this one up may be overkill, though it would easily suit as a very
quick and dirty network monitoring solution.


And a few others that I haven't found so useful myself, but someone else might:

itop - top for interrupts. I can imagine it would be useful for checking if hardware is getting the computers attention when it should be.

jnettop - this is another network top. I prefer iftop since it gives me a graphical display (and it's help page is somewhat more detailed than "I must write something here... :)").

Saturday, 30 August 2008

MythTV scavanges Scrapheap Challenge episodes

My main desktop box has been running this nifty little program called MythTV for over a year now. MythTV is a home-brew Personal Video Recorder for Linux, which essentially means it's kind of like a VCR, but on steroids. It downloads TV guide data from OzTivo and once a week I go through the program guide sorted by genre to see if there is anything on that sounds like it might be worth watching. Then I check it's list of Upcoming Recordings to make sure I don't have any conflicts, resolving them if necessary and go away.
Every now and again when I have some time I bring up it's recorded programs view, pick something to watch, check that it's automatic commercial detection has done it's job making any necessary corrections (which usually takes less than a minute), sit back hit transcode (to permanently remove those commercials as well as reduce the file size) and enjoy the show.
If I'm not at my computer at the time, I can access MythTV remotely using the MythWeb plugin which lets me change my recording schedules remotely and even stream recorded programs to me. It also integrates with the MythMusic plugin which I have found handy on a number of occasions when I've been working on an assignment in a computer lab on campus and wanted some decent music to listen to ;)
Some months ago, I noticed this program in the guide called "Scrapheap Challenge" airing daily on ABC2. The description sounded interesting so I told MythTV to record it on a daily basis. Since then MythTV has not missed a single episode as all of season 9 was aired and then rolling back to the original season 1 from 1998 and showing every episode since (at the time of writing ABC2 is now up to season 7).
Each episode Scrapheap Challenge pits two teams of three members and an expert against each other to build some contraption that has to perform a specific task out of the junk they can find in a scrapheap in only 10 hours (except for some special episodes). The idea for the show came from a scene in Apollo 13 where the astronauts only had a short time to construct a carbon dioxide filter from whatever parts they could find on their space capsule. The show is hosted by Robert Llewellyn (who it took me a long time to realise played Kryten in Red Dwarf all those years ago) and Lisa Rogers (prior to season 5 it was Cathy Rogers) who offer entertaining (and sometimes ridiculous, especially in the episode introductions) commentary throughout the show.
Anyway, the reason for this post is mostly a plug for the show as I have been thoroughly enjoying it and highly recommend it to any aspiring engineer or indeed anyone with a technical mindset.

Monday, 14 July 2008

N800 as Remote Speaker and Overdue LCA Overview

Well it has been a long time, I really don't have any excuse. So much for blogging about LCA, ey? I actually have a half written blog post about it still sitting on my Zaurus, but I never got around to finishing it. My Internet Tablet functioned beautifully (except for a bug regarding the bluetooth keyboard requiring me to reboot it every now and again to get the on screen keyboard to come back) and was all I really needed there. The only use the Zaurus got was a little bit of showoff, typing that unpublished blog post when I didn't want to pull out that bulky dell keyboard and listen to music on the train when I didn't want to exhaust the N800's batteries. The only time a full sized laptop would have been particularly handy was during some of the tutorials where it was impossible to keep up on the tablet.
It was awesome being able to meet so many people including some of Nokia's employees and seeing the N810 in the flesh, as well as Linus himself. If you must know I saw him four times - after a kernel talk I saw him sneak into an unmarked room, when he walked in on the kernel dev panel talking about kernel debuggers ("Linus! We were just talking about... ice cream.... Would you like some ice cream Linus?"), when he ducked up the stairs to grab a snack and during the meal on the last day.
By now there isn't much point in posting info about any of the talks since it has well and truly been blogged to death. If you haven't already go watch the vids - In particular I recommend Tux' Angels: Incident Response Revealed (about IT forensics using open source tools) and Viktor Olier's talk on the RepRap (I think it was titled The Replicators are Coming or something).

Nightwish was *awesome*. I did have to miss out on the Penguin Dinner that night to make it, but ohh was it worth it. Unfortunately I missed out on a shirt since they had stopped selling them before interval when I was planning on getting one. No matter - I have since ordered some Nightwish and Sonata Arctica merchandise from overseas. Google paying for the bar tab at the Students party followed by gelato was pretty sweet - I think that brings the total meals of mine that Google has paid for to 5 :-)


But anyway, moving on to today's post: I now have found yet another use for my Internet Tablet!

When it's late at night and I'm at college and want to watch a video or listen to music without disturbing my neighbors I use a 5 meter headphone extension cable to reach my bed. I've been meaning to look into a bluetooth headset but haven't got around to it yet. Anyway, I've come back home for a few weeks while uni is on break and it's late at night and I want to watch a video without disturbing my mother. Problem is I forgot to pack my headphone extension cable and it's too cold and uncomfortable to sit next to the computer watching it.
So I started wondering if there was any way that I could use my Internet Tablet as remote speakers across the room - then I could plug my earphones into them and effectively have (almost) wireless earphones. Turns out that it is possible and not too difficult at all.
The two are connected via wireless using my Linksys WRT54GL - which wouldn't be necessary if I could get my laptop to use ad-hoc properly or if either device supported functioning as master. Another option that I haven't looked into yet is using bluetooth PAN, or possibly hacking the tablet to look like a bluetooth A2DP headset, but that's for another time and probably another person to hack into existence.
On my tablet I opened a terminal and ran:
esd -public -tcp -nobeeps
I then opened a second terminal window and SSHd into my laptop. There I ran:
export DISPLAY=:0
export ESPEAKER=192.168.1.101 (My Internet Tablet's IP)
mplayer -ao esd -delay -0.3 video.avi

I had to use the -delay -0.3 parameter as the audio was slightly delayed due to the overhead of sending it over the network and I found that number gave pretty good lip sync - you would probably have to fiddle around with it to find the optimal setting for your situation. This technique should work for any application that can use esd to output sound.

Thursday, 24 January 2008

Another Blog to Shout About

Well, just about everyone else is blogging these days, so why not me? I've dabbled a bit in just about everything to do with computing, but not really enough in any one area to consider myself an expert. I tend to think of myself as a bit of a Jack of all computer related trades, and this blog will probably start to reflect that with posts on a wide variety of topics.

But who can say, ey? Plenty of friends and people I know consider me to be a computer expert, some have even used the term "genius" to describe me. Maybe it's all relative - I consider Andrew Tridgell a computer genius, and I've heard that he thinks of Linus Torvalds as a genius, so the question really is: Who does Linus think of as a Genius, or is he really the top dog?

I've been thinking about starting a blog for quite some time now because I've done many random things (not always ending in success mind you) that I felt like documenting at the time but didn't - now I have somewhere to put all of that, my only excuse left can be laziness, lack of time or both. Perhaps I will persist and avoid this blog befalling the same state of disarray as so many of my past projects...

I will be attending linux.conf.au in Melbourne next week and fully intend to blog about my experiences there. This will be my first time attending a conference like this and I don't really know what to expect - but it should be fun finding out!

What else can I say? I'm a full time Software Engineering student at the Australian National University in Canberra, Australia. I have a passion for Linux and Free/Libre/Open Source Software, and Linux has been my primary OS for many years now. I have a considerable collection of gadgets and machines running Linux, most notably:
* A GP2X Personal Entertainment Player which I primarily use for killing time playing old SNES ROMs and I daresay will come in handy on the train to and from Melbourne for the conference next week. Came running Linux out of the box.
* A Sharp Zaurus SL-C3200 currently running pdaXii13. This too came with Linux out of the box and QTopia for it's GUI. This little beast doesn't see too much use these days but it's 6GB microdrive comes in handy to store plenty of music for when I don't want to waste the battery on my Most Valued Gadget:
* And the MVG (Most Valued Gadget) award goes to my Nokia N800 Internet Tablet running the Linux based Internet Tablet OS 2008. I don't know how I lived without this gadget, I really don't. It does just about everything - Kagu Media Player plays music from one of the two 8GiB SD cards I have in it, while Vagalume Last.fm Client streams new and exciting music from last.fm. It's built in mapping software has helped me to find places on more than a few occasions, while Maemo Mapper does all my mapping related tasks that the built in mapper doesn't. It's mozilla based web browser works like a charm, the webcam has captured a number of amusing moments when I haven't had any other camera available. I can SSH into any of my other boxes from it. Video playback works great, although I haven't actually used that too much. Pidgin, Skype, Gizmo and Modest Email clients all work great although to be honest I don't use them anywhere near as often as everything else I have on the tablet. GPE PIM todo has my shopping list and checklist of things I need to do before I go to Melbourne next week ;) Well, this summary was a little longer than I anticipated - almost enough so to get a post of it's own - perhaps I shall post a full review of this device, everything I use it for, like about it, and the few things I dislike about it at a later date.
* A Dell XPS M1710. This one didn't run Linux out of the box, but naturally it didn't take me long to set it up for dualboot with Kubuntu. Yeah, I went all out on this machine - I'm a dormant gamer (would play more if I had the time) and wanted a machine that could easily handle what my old laptop could not (last LAN with my old laptop I was quoted as saying that I "should really upgrade my framerate tower" when it dropped down to seconds per frame during the later rounds of one particular tower defence map), yet still be portable enough to take with me - even if I'm just going home for a few weeks on train or plane - something my desktop is certainly not.
* My desktop box. Like most computer enthusiasts I put this together myself so I can't simply quote a brand and model for you to google. Currently it's still set up to dualboot 64bit Kubuntu and XP, the latter of which hasn't been booted since I got the M1710 (it was only ever there for gaming) and I'll probably claim that space for Linux in the not too distant future. This machine is unsurprisingly used for mundane computing tasks when I'm in my room such as typing up this blog post and listening to music. This computer doubles as my MythTV box and most of it's 1.4 Terrabytes of storage are filled up with things MythTV has recorded. Has an annoying tendency to only crash when I've gone away - usually half an hour before I attempt to log in remotely, so that means it's next crash will probably be while I'm in Melbourne next week.

Well, that's enough for the first post - I've got a few more things that I want to put up tonight, but they deserve their own posts.