Tag Archives: Ubuntu

Network Monitoring

I’ve been searching for some simple tools to monitor my internet connection for some time, and finally I’ve found a few tools that do the trick.

If you’re looking for a console application to give you a quick heads up on the transfer speeds across a network interface have a look for ifstatus (not to be confused with the ifplugd suite) .

Ifstatus

If you’re looking for something to log and display network statistics checkout vnStat

vnstat graphvnstat graph

Minor niggle: both these programs needed compiling and required additional dependencies which I recall were GD, for the graph creator of vnStat (vnstati) and curl for the console interface of ifstatus.

If you have any other suggestions, queries or points, please leave a comment!

Fail.

Example one – forgetful screenshots

screenshot-fail

A couple of screenshots. Firstly, every now and then, people send us screenshots. They do this by sending them in word documents, which is bad enough. (Please, just send us an image file!) This example though, is quite fun.

Make sure you actually copy the screenshot in, instead of just linking it πŸ˜‰

Example 2 – Infect yourself, and pay money for the privilege

Stupid-Script-Kiddies

My second example, is of a website trying to extort money, by making you think your computer has been infected with a virus. These are nasty sites, and I hate them with a passion. They feed off of people’s fear of computers. The interesting thing here is, this computer can’t be infected in this way… it’s running ubuntu, their silly antivirus software looks very, very out-of-place!

(See my first post this month if you’re afraid of computers.)

Click on the image for the full screenshot. It is quite large. As you can see from the timestamp, I’ve been meaning to post this one for a while πŸ˜‰

p.s. Does anyone know how to force formatting in wordpress? This post took about 10 minutes of fiddling to get the images to go some-where near where I wanted them :/ If you do, please comment! If you don’t please comment. In fact, please comment, comments make my day!

Karmic notebook Theme

Finally got around to upgrading to Karmic Ubuntu, and so far Its looking good. There is a few oddities in the theme, which makes using it a bit annoying, but I guess I’ll get used to it. See the screen-shot below for what I mean, the strangeness of the interface The bar at the top, the new greying out an in of active icons all help to make the best use of this screen size. You can tell the design team are doing good work πŸ™‚

One small problem, is the lack of a clock, or logout button. For some strange reason, both didn’t make it, and hitting the power button no longer brings up the shutdown interface. I’ve been using the command ‘shutdown -h now’ in a terminal for the moment, will have to dig around, see why it isn’t there/coming up later.

Theme Problem

Quick useful sysadmin stuff

Two useful things I have found or use πŸ™‚

Firefox Awesomebar search trick

A wonderful tip, that someone sent into the ubuntu-uk podcast. (I can’t remember who, or the episode. Comment if you know and I’ll credit them here! πŸ™‚ )

You can search, in any website’s search function, using firefox’s address bar. Now, at first glance this sounds really boring and useless, but it really isn’t, at all.

First, we need to find a website to search. Let’s use launchpad’s bugs search, for Ubuntu. So, we go here:

https://bugs.launchpad.net/ubuntu/

Screenshot Firefox add search bookmarkThen, right click on the search box, and click “Add a keyword for this search”. This brings up the standard bookmark – your search keywords are stored as a bookmark. Give it a useful name, something to help you next time you go sorting through your book marks. Now, the keyword is how we use this trick. I’m going to use “bugs”, but you can use anything you want, just remember, this is the word you put before your search string in the address bar. Click Add.

Screenshot Firefox address bar search for bugsNow, all we have to do, is to search for a bug. Let’s use the classic bug 1.

Open a new tab (CTRL + T), then in the address bar type [your keyword] microsoft market share, and hit enter.

Lo and behold:

Screenshot Firefox launchpad bug 1

Testing SMTP-AUTH the fast way

Found a really handy little command line program called “swaks”. Great if you’ve ever needed to test SMTP-AUTH, and didn’t want to have to base64 the username and password yourself. Here’s a quick rundown on the command and flags I use with them. (Should be fairly obvious, comment if not!)

swaks -s [smtp-server-name-or-ip] -au [smtp-auth-user] -ap [smtp-auth-password] -f [from-address-of-testing-email]

Hit enter, and it’ll ask you the “to” email address. Type it in, and it gives you the full connection readout, just as if you were doing it with telnet (or netcat) on the command line:

<- 220 smtp.our-domain.com ESMTP
-> EHLO gemini
<- 250-smtp.our-domain.com
<- 250-AUTH LOGIN
<- 250-AUTH=LOGIN
<- 250-PIPELINING
<- 250 8BITMIME
-> AUTH LOGIN
<- 334 Z29vZCB0cnkgOikK

And so on. πŸ™‚

phpmyadmin in ubuntu now being exploited en-masse

Update: ubuntu patched this issue a couple of days after this post. If you’re reading, thanks guys! You just made my job a lot easier πŸ™‚

At some point, I might try to look at helping maintain this, and other packages like it in the ubuntu archive. No idea how, though a colleague may be able to help…

———————–

The versions of phpmyadmin in ubuntu (at least Dapper – Intrepid) are susceptible to arbitrary code execution, as the web-server’s user. A bug1 was reported on the 15th of June about this issue, and marked as high priority on the 21st.

The phpmyadmin team patched this problem in their software on May the 24th. 2

Debian patched this in their system on the 25th of June.

I tried talking to people on #ubuntu-security about this problem. They said “motu” and “we’re not interested, its in universe”. I tried talking to people in #motu, and they talked about work-arounds.

The main questions now are:

  • Please can someone work on the bug?
  • Why did it take so long between upstream report and launchpad report?
  • Why has the bug been left to the point where it is getting automatically exploited, en-masse? 3
  1. https://bugs.launchpad.net/ubuntu/+source/phpmyadmin/+bug/387215
  2. http://www.phpmyadmin.net/home_page/security/PMASA-2009-3.php
  3. http://seclists.org/fulldisclosure/2009/Jul/0021.html

Current Cost – watt hours and pachube

This is an email i sent to JTΒ  so I apologise if it doesn’t make sense to y’all. Please ask questions if you don’t get me!

So we have this ‘Current Cost’ meter thing (free from Southern Electric) at the house. It’s a small wireless electricity meter. Well it’s more of a monitor or display actually but you get me….[insert pic].

Long story short, I’d noticed the RJ45 on the bottom and it’d got me wondering. A few google searches later and whammo i’d found what I needed. A bit of hardware, a bit of software (links on manyfacturers website!) and whammo….

I wired up the current cost (enegry meter) at the house to my laptop and it’s uploading to this Pachube (bless you) website:
http://www.pachube.com/feeds/2196

The graph is a bit useless atm (no history or dates on it πŸ™ ) but the program here:
http://apps.pachube.com/google_viz/
Could probs snazz it up a bit.
There seems to be a binary pattern from some device that is turning on and off at regular intervals and using ~100w… i wonder if it’s the compressor on the fridge/freezer as it goes on thru the night lol.

Graph of peak watts and temperature from current cost and excel

Graph of peak watts and temperature from current cost and excel

The long jittery spikes are the washing machine/dishwasher/tumble dryer (the last being the biggest draw lol).

One guy is even trying to record signatures for each appliance and then work out from the data which appliance is causing the spikes.
http://chrishodgins.tumblr.com/post/33810511/via-chart-apis-google-com-so-its-the-bank
The idea behind this is if you can work that out, you can make a pie chart of the biggest consumers…

I have more results than are uploaded; i created a funky excel file which Should update from the mdb created from one of the apps i’m using but atm i think the file is locked or summat :(. Made a pretty graph to! Also predicting the future temperature based on a polynominal curve or something lol.

All gd fun. Now i jus want one of these tiny minuture computers:
http://www.fit-pc.co.uk/fit-pc-slim.html
or this awesome plug pc:
http://www.pcpro.co.uk/news/258238/plug-sized-pcs-arrive-in-uk.html (sweet) (Ubuntu on a plug [ via Youtube])
to record/upload the results, although it would make more sense to use the ipcop or home server since they are always on and the current cost device is wireless. (unfortunately our model does not have internal data logging πŸ™ ). Don’t know how to work out kwh from current usage of watts every 3 seconds… i might be able to put something from averages tho. Any suggestionsΒ  anyone? I might just be being dumb lol.

Now all we need is the x10 plug thru devices to monitor electricty usage (by appliance) and bobs your uncle – we know exactly where the electricity is going.

IMOΒ  (as a soon to be Building services engineer in training) this technology should be wired into all new houses in the actuall plug sockets. Want to know which of your kids (or indeed partner) is using the most electricity? πŸ˜‰

The trickle usage these measuring devices could be designed to run on could easily be offset by a small(ish) solar pv installation too! (i’m talking around 10-30wh/day here πŸ˜‰ ).

Oh and here’s how to connect the current cost to pachube:
http://community.pachube.com/?q=node/100

On the upside i’ve also unplugged the fancy pants MPPTΒ  solar charge controller and hooked the install back up to the basic on/off controller, and now it’s definetly shifting amps! I was a bit worried that in full sun 53watts of panels was ONLY putting through 0.3-0.1a @11.7 (i know, discharged). Hmm gonna have to find out whats wrong with fancy pants, he wasn’t cheap! :'(

New Keyboard

Ok, so Kirrus has just left – he was visiting home for a break and to get Christmas pressies lol.

He’s taken with him his Microsoft keyboard which I was using with my laptop and a second monitor, so now I need a new keyboard.

So I’ve looked around, and the best keyboard I could find quickly is made by…you’ve guessed it, none other than our arch nemesis – Microsoft. It’s a Microsoft Natural 4000 in actual fact (to save you having having to google the reviews).

Now I don’t mind buying a Microsoft keyboard if it is the best available, but I’m not so happy that my money is going to them – surely they have plenty already and they don’t seem to be using it to develop excellent operating systems.

So my point to you Ubuntu (Canonical) folks – Please start making (good, obviously) keyboards! I would much rather my money going towards the development of a competitor; into the development of Ubuntu!

And since I have made so many mentions of them, I feel I must balance it up. Every time any of the staff or students at the school I work complain of Viruses, I always suggest they would be better off using Ubuntu, from Canonical and many other individuals. Ubuntu is certainly maturing very nicely. I think it’s nearly ready. If only Ubuntu had an alternative Desktop management configuration system like it’s competitor. That would really make Ubuntu Rock.

Thanks Ubuntu and Cannonical, and all you ‘others’!

What OS does the universe run on?

A friend of mine writes and draws his own comic, Jayden and Crusader. He’s drawn a “Computers of the Gods strip” page, which of course ends with Ubuntu

Find it here: http://www.jaydenandcrusader.com/2008/08/15/the-computers-of-the-gods/

He always appreciates contructive comments, though make sure you read his comments after the strip πŸ™‚

Firefox won’t upgrade!

Firstly, apologies about the lateness of writing a new post. I’ve been struggling with my server, trying to work out why apache2 is eating RAM. I’ve made a really nasty hack to sort it out for the moment though, which will give me more time to find out what is going wrong.

One of my old friends from Church sent me an email, asking me what was wrong with his firefox. Every time he launched it, what appeared was firefox 2. Very strange, since the version of firefox he has installed is:

3.0.1+build1+nobinonly-0ubuntu0.8.04.3 - meta package for the popular mozilla web browser

Well,Β  that looks like the normal browser to me. At one point, he has had the “ubuntuzilla” browser installed for a little while. (But not anymore).

A couple of questions on the Ubuntu-uk mailing list didn’t turn up anything. So, I asked “how do you find what binary a command runs”? The answer came back from Matthew Wild (thanks!):

ls -l $(which firefox)

I cheated a little. I’ve not come across $(command), but I have come across `command`. So, I asked my friend to run “ls -l `which firefox`”. He replied with:

lrwxrwxrwx 1 root root 20 2008-02-09 17:16 /usr/bin/firefox -> /opt/firefox/firefox

Er.. that looks wrong to me. The packaged firefox binary for version 3 is in /usr/bin/firefox-3.0. Looks like the uninstall of ubuntuzilla didn’t go so well. I asked him to run:

"rm /usr/bin/firefox && ln -s /usr/bin/firefox-3.0 /usr/bin/firefox"

Which removed the old link, and added the correct one. (I should have asked him to run those commands through sudo thinking about it..)

That solved his issue and he’s now happily running firefox 3. Anyone have a better way to implement this fix, if we ever need it again?

Matthew kindly explained the difference between “$(command)” and “`command`” in earlier today. No difference πŸ™‚

$(command) is easier to send to people so they don’t have to find the backtick key. (UK keyboards, above the tab key)