Category Archives: Linux

Help firefox wget and ssh shell script

I’m trying to create a script to allow me to command a remote server to download a file from firefox.

There are various reasons for this, mainly todo with connection speed.

What I have at the moment is:
#/bin/sh
terminator -x ssh user@site.com wget -qc -t 3 -o ~/wget_testlog ftp://anothersite.com/file.ext \\& \& &

I want it to kick off, ask for a password to login via ssh and then go away…
I would like to be able to set the location for the download to ~/www/files/

I was planning to place this script in /usr/bin and install it in firefox using the code/link provided on this blog: Wget from firefox

Can anyone complete my solution with the correct syntax, or provide a better solution (preferably KISS)?
I’m more of hacker than an expert IMO and I know when I’m out of my depth!

Cheers,
Garreth

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!

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

Dear web

Dear web-connected people. A friend asked me recently, do you know of an opensource wiki software that can intergrate with ldap. Any one know of one, or have any ideas? Please comment if you do!

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

Dear Apache

Dear Apache. My idea of fun is not to find out about a missing log directory, when I test a website after a restart. My idea of fun would be for apache2ctrl configtest to actually, you know, work. Or, even better, don’t utterly die when you’re missing a log directory.

GRRRRR

Dear Customer. Please make sure you remove apache configuration, when you delete your users. I don’t enjoy being woken at 6am because logrotate restarted apache. Athough, on the upside, at least I get paid for it.

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’!

Book Meme – popey isn’t the only one with a dry book on his desk

I noticed this meme last night, but I was just about hit the sack. Haven’t had a chance to put it up till now πŸ™‚

“Update systems can no longer assume that hosts are alive but must either chase after them until they reappear or be initiated by the host itself on a schedule, as well as any time it discovers that it has rejoined its home network.”

-The Practice of System and Network Administration (second edition) by Thomas Limoncelli, Christina Hogan and Strata Chalup.

To join in just follow the instructions below:

1. Grab the nearest book.
2. Open it to page 56.
3. Find the fifth sentence.
4. Post the text of the sentence in your journal along with these instructions.
5. Don’t dig for your favorite book, the cool book, or the intellectual one: pick the CLOSEST.

Day 4 – Falling back to the meta-referance

Last night I posted on twitter that I was struggling to find stuff to post about. jkblacker (Not bassets, sorry Josh!) suggested that I post about how I’m finding it hard to find stuff to post about… so here it is πŸ˜‰

Not exactly the most spectacular day 4, especially since I’ve got 26 left to go, but we’ll see what happens.

Parts for my new computer started arriving today. I’d hoped that it would all arrive, but unfortunately not. So, right now I’ve got RAM, the PSU, Motherboard, CPU cooler and a copy of Windows. (Yes, I know, horrible, but I’m building a gaming machine, wine isn’t there yet, and Linux hasn’t reached critical mass πŸ™ )

Sporadically over the past week or so, I’ve been trying to use search and replace in vi/vim. Finally got it drummed into my head! Here’s the syntax for single item search and replace:

:%s/OLDSTRING/NEWSTRING/

If you want to replace every item in a document, then add “g” to the very end. “g” in this context means “greedy” – i.e. replace everything. (Thanks JPE – I did learn it after all!)

This is the same sort of syntax as usable in the command line tool “sed”. For example, if you wanted to replace a space in a file with a comma, then you’d do:

sed 's/ /,/g' oldfile > newfile

I’m sure there’s a better way to specify that syntax… please feel free to comment πŸ™‚