Monthly Archives: July 2008

Linux command line tips & Stuff

I’ve been taught a couple of command line tips at work, and thought it wouldn’t be fair if I didn’t pass them on. So, we begin.

CTRL-R

This insanely useful trick, in a terminal or a console, will allow you to search your bash history for any command you’ve previously run and re-run it. For example, quite often on my laptop, type “CTRL-R upg” in a terminal window, which runs the following command:

sudo apt-get update && sudo apt-get upgrade -y

If you don’t know, that command updates your package repository listing (what programs have been updated), and then goes and upgrades all of the packages that have been upgraded, with the only exception of the more significant upgrades, like to the kernel. (A human has to activate those particular upgrades – and the -y tag doesn’t signify human, as that command can be cron jobbed very easily…)

CTRL-O

This one I was taught in my interview for Positive Internet. (So, I’d better not get this wrong! ;))

If you have run a series of commands in a terminal or console repeatedly, say editing a file, doing a config check and then restarting apache (as I have done whilst I’ve been playing with my Apache2 config file for this blog), then this little switch is priceless. Basically, once you hit the up arrow to find the command you wish to use, hitting CTRL-O instead of Enter, will execute the command, and then once you’re back at the shell prompt list the next command in the series. So for the first set of commands:

vi /etc/apache2/sites-available/kirrus  [ENTER and edit the config]
apache2ctl configtest [ENTER]
apache2ctl graceful [ENTER]

Ooops, I’ve just killed my blog by way of a looping redirect! Quick, undo!

[UP ARROW, UP ARROW, UP ARROW]
vi /etc/apache2/sites-available/kirrus [CTRL-O and fix the config]
apache2ctl configtest [CTRL-O]
apache2ctl graceful [ENTER]

The benefit? The second time round, once I found and initiated the series of commands, I didn’t need to type anything, other than the changes to the config file, and the initiating control sequences. Annoyingly, you can’t just hit CTRL-O once, and then expect to be in the chain next time you hit enter – hitting enter won’t provide you with the next command in the chain once you’re finished. Although, this of course can be a good thing, if you want to return to a clean command prompt.

Hopefully one of those will be useful to you.

Ubuntu-UK Planet, Caffeine and Rambling.

For some strange reason, the Ubuntu UK planet didn’t pick up my last post as a new post. Possibly because it got a little confused with the server move and IP address change? Anyway, for those of you reading this on the planet, I have a post about a couple of the tools that come with apache2 on my blog. Not much, but hopefully interesting.

Caffeine: I’ve pretty much overdosed this evening. Head’s swimming right now, and the screen appears to be filling my vision (hence the more than normal ramblingness [yes I invented a word :)] going on in this post). Stayed on at work for an hour and a half, pushing me closer to the tiredness limit. So, on the way home I drank a bottle of Coca Cola, (the tube section) and a small americano coffee (the train section). It kept me awake (yay!) at the cost of me being a little… jumpy at the moment. Still, it’ll wear down shortly, especially since I finished my food about 20 minutes ago. That always helps clear the caffeine effect. So, shortly I’m going to crash from my caffeine high, and be a Zombie. Hopefully won’t be that way tomorrow morning, but at least I can sleep on the train in and if I’m lucky and get a next-to-the-door seat on the tube quickly, on the tube in. (The glass to your left or right acts as a good, if a little hard, pillow. The glass behind you, unfortunately, moves too much, and gets painful quite quickly.)

Right. I can feel myself starting to slow down, so I’d better sign off before the Zombieness (Yay for creating random useless words!) comes into play.

Stay safe 🙂

Moved & a couple of Apache2 tools/tricks

If you can can see this post, then my server move is complete. I have moved this blog across to a dedicated server, provided by my employers, Positive Internet.

So far, I’ve not done too much playing with it, but in case you need to know, adding this in your apache2.conf file will allow it to read .htaccess files in any /home/<username>/public_html/ document roots – handy if you don’t want to use /var/www/ to store all your websites.

<Directory /home/*/public_html>
        AllowOverride All
</Directory>

There are a couple of useful apache2 tools which don’t get a lot of publicity.

a2enmod – enable a mod in apache. You’ll need to reload apache after running it. If you run it without specifying a mod, it will list all available ones.

a2dismod – disable a mod. Again, if you run it without specifying a mod it will list all enabled ones, before giving you a prompt asking which one to disable.

Along similar lines, if you’re using sites-available/sites-enabled to quickly enable/disable vhosts, you can use:

a2ensite – enable a website.

a2dissite – disable a website.

Of course, you can then use apache2ctl graceful to restart the webserver nicely – so the changes take effect, but you don’t close all the connections currently talking to apache.

Have fun!

Time, privacy and its lack thereof

Over the weekend I watched “V for Vendetta”. Its come up recently in a forum I frequent, specifically the quote at the beginning – about ideas being impossible to kill.

Its wrong.

Ideas can be killed. Eventually. It takes time, patience, and willingness on the part of those whose minds you are changing.

I wonder, do you ever worry about this country? (I’m talking to the Brits here. Sorry everyone else, this post is aimed at the UK, our laws and situation though you may find parallels about where you live.) We have a government that (almost) no-one likes. We have a leader, who at best could be termed ignorant. At worst a devious schemer.

Not worked out what I’m talking about yet? This is what I’m talking about. I’m talking about the erosion of our privacy. I’m talking about the surveillance state we are in. Do you even know what powers our oh so wonderful government has over us now? Read some of the above links. Heck even the Information Commissioner, the guy supposed to be looking after our privacy as relating to computers is saying its here!

I’ve been reading all these news items one by one, slowly, over a period of the three or so years that I’ve been watching and reading all articles that come up in BBC News’s tech section. As I’ve read them one by one, and not put them together, I haven’t worried too much. Till now. Apart, each are only merely slightly worrying. Together, we’ve got a problem. If you’ve not already, I recommend you now go and watch “V for Vendetta“, and then read “The Traveller“. Then continue reading below the line.

———————————————————————————-

You think the technologies to create this don’t exist? As someone who sits on the edge (or maybe inside) of geek-dom, I can say with knowledge and certainty, they do. We could be living in George Orwell’s 1984’s level of observation in a simple matter of 6 months. Heck, if you’re in London, you’re probably already carrying at least one unique ID tracker, most of which can be read remotely at 30 feet (or more). Your RFID Oyster card. Your mobile phone. Your RFID chipped passport. Your RFID credit/debit card.

Don’t believe me? Read up on RFID and RFID skimming.

Literally, all we have to do now is wait, as our last safeguards are removed or bypassed, and before too long all it will take to bring us to the societies depicted in “1984”, “V for Vendetta” and “The Traveller” is one crack pot power maniac in government. Need I mention, I don’t have a high opinion of Gordon Brown?

Its not as if it hasn’t happened before in history, one man taking over a democratic country and turning it into a dictatorship. But much worse, as in our country is all the tools needed to *keep* our country in a dictatorship and aid its passage to one.

Now, I can say all this, as we’re not there yet. However, I see the day fast approaching when I would be arrested for what I have written here, and asked to relinquish my encryption key’s pass phrase. (You’ll have to torture me before that happens.)

Someone once told me, that we’d never get to the point where the EU constitution comes into play. The treaty that was ratified by the UK merely a few weeks ago, was basically the EU constitution.

I have heard many times, “I’ve got nothing to hide”. No, not yet. Until you have to hide your sexuality. Your Race. Your religious beliefs. Your musical preferences. Your secrets.

I leave you with a link and this old, poem. How long before it becomes relevant once more?

=======================

When the Nazis came for the communists,
I remained silent;
I was not a communist.

When they locked up the social democrats,
I remained silent;
I was not a social democrat.

When they came for the trade unionists,
I did not speak out;
I was not a trade unionist.

When they came for the Jews,
I remained silent;
I wasn’t a Jew.

When they came for me,

there was no one left to speak out.

=======================

Click Here to talk to others worried about this

Want to know more? Click the image.

Want to fight? Click the image.

Will you remain silent?

Hancock, Books and photographs

Hancock

I went and saw this film with my brother and a couple of mates today. Was good, up to a point. Certainly, Will Smith is getting better – he appeared to play the part flawlessly, at a level I’ve not seen him act at before.

My one, slight moan, is that they included a brief, guarded and pointless sex scene. I guess, it *may* have been included to make a point, but it felt more like a box-tick exercise than anything else. Apart from that, an enjoyable way to while away a bit of time.

Books

Stack of booksBooks, I finished a Colin Forbes book this week. Awful. I had to put it down mid-way, and read a completely different book as a break before I picked up again. It felt so rough! And to think, I used to like his books. Fit his usual formula to a T, felt contrived, with a few instances of what PBEM RPG players call “SuperHero Syndrome“. In a Matthew Reily book, I can forgive SuperHero syndrome: he does it with such flair! However, it is not forgiveable in a Colin Forbes book. Which is a shame.

I started to read a Clive Cussler book “Dark Watch” a few weeks back. I got half way through, an OK book, till I got to a line of pure placement advertisement, which put me off completely and utterly. Here’s an extract. (For the copyright fiends out there, this is fair use!)

“Juan found a parking spot a few blocks from the court and spent the next two hours walking the neighborhood, sipping black coffee from a Starbucks. He felt he should have bought his coffee from a local vendor instead of an international franchise, but it had been months since he’d had a taste of his favourite brew. He made a mental note to contact the company’s Seattle headquarters and see if it was possible to buy their special equipment for the Oregon.” [Oregon is the wet-merc ship he captains.]

Oh dear. What an abysmal excuse for an advert. At the very least, it could have been subtle! Stopping at “it had been months..” would have been fine. I have stopped reading the book. I’ll finish it sometime, but not yet. When I’m not so irritated at that advert. At least on the web, it is generally fairly easy to spot, and ignore, them. A bit harder to when you’re engrossed in a story.

Photographs

I’ve been trying to use F-Spot on my laptop to manage photos. Unfortionately, it has a nasty habit of freezing my laptop totally, when I click “OK” on certain dialog boxes. Quite frustrating. So, another question for those reading, what image management software would you recommend ? It has to run nativly on Ubuntu Hardy, but apart from that, pick whatever you like (including web-software). I have a large collection of photos (my camera’s counter recently went over the 1,000 mark), which I want to tag and organise. An effective search function is a must, so that I can add relevant photos to my blogs from my collections.