Tech

The New Look Tech Blog

Browsing Posts tagged How To

Colorful Bash Prompt

Custom Bash Prompt

As a sysadmin I spend a lot of time logged into other servers via SSH session. Often I have to log into systems I am not familiar with, and it is very easy to forget which one of the seven terminals that you are working in is actually logged into a remote machine.

I am certain I am not the only one that have accidentally shutdown a server while logged into it. Newby mistake, and never repeated due to this trick I learned.

continue reading…

Hey There.

This is a quickie update. It is Election Day for the Local Government Elections 2011 and results are just beginning to come in.

Real-time results are hard to come by, there is a twitter hashtag to follow namely #LGEResults, but that makes it hard to get an overview of what is going on, which party is in the overall lead.

Lucky for us the IEC has a results page at http://elections.org.za where you can search for the results you want to see and then download either a PDF or Excel spreadsheet to view the results. If you are not interested in the technical aspect of how I parsed the information from the IEC spreadsheet you can view the results HERE: http://g33q.co.za/parties

(Bear in mind that I am not affiliated with the IEC, and with none of the parties – I am just a computer guy who voted and want to see the election results)

The spreadsheet I use for input seems to be updated every 10 or 20 minutes at this stage.

If you want to find out how I actually did the scripting, read on:

It is a bit of a pain, so I wrote a bash script to automatically download the spreadsheet (the URL does not change between updates :-)) and then parse the information. You will need to install the package xls2csv that is relevant to your Linux distribution.

BEHOLD:

#!/bin/bash -x
rm National*
wget http://www.elections.org.za/content/LGEPublicReports/197/Detailed%20Results/National.xls
xls2csv National.xls > parties
awk -F"\"" '{ print $2 $7 $6}' parties | grep -f input > results

Predictably the output is ugly, but it at least gives me some information that I want.

Have fun playing with this one. I use: while sleep 5m; do ./scriptname; done to run it every five minutes, and in the script above I added a simple scp command to upload it to my server where you can view the results at http://g33q.co.za/parties if you want.

Cheers for now!

Look, this is a quick and nasty, but at the end of this one you will have a cool angry birds quicklauncher in your Unity sidebar and clicking it will launch Angry Birds Beta in a Chromium App window.

continue reading…

Ubuntu Natty Narwhal is here, yep, 11.04 has landed. (Is it just me or is there less Internet fanfare than before?) Along with Natty came the much discussed, loved-hated, maligned-adored, yet universally greatly expected Unity Interface.

Love it or hate it, I believe that most on-line opninionistas that has followed the roll-out of Unity to date has missed something that Unity might make possible in the near future – an application-rich environment.

continue reading…

Learn To Breast Feed Your Blog

4 comments

Chadwin SolomonGuest author Chadwin Solomon brings us this entry about getting a blog started. I think it is a pretty good read. More info on Chadwin in the Author Widget to the right, and more reading of his work over at techcrunch.co.za and mobileoswars.co.za

So you’ve decided to come over to the wild side and by wild side i mean blogging. Well to be honest blogging ain’t that wild unless you are Seth Rotherham.

I find that most newbie bloggers are tempted to just setup a WordPress blog, choose a theme and start writing blog posts in the hope that millions will visit. Not to put you off blogging, if you genuinely talented and hardworking you could achieve millions of hits, but there are certain crucial things you should do to prepare for the visitors.
continue reading…

Ubuntu has one irritating issue that has been a pain in my side for YEARS. When you set a system-wide proxy to let all your programs use a proxy on the network and set a DIFFERENT proxy, or select the “No Proxy” or “Default” option, the first system-wide proxy will persist.

One evening after a Lets Talk Geek podcast I complained about this along with Tim Haak. Stew Allen, another of the members from the podcast suggested we look at Privoxy as an option, setting one system proxy and then changing the forwarding rules as you move between proxies.

Being a lazy geek, I searched for a way to automate this… continue reading…

Conky is  a great desktop information utility. Almost all Linux users have played with it at some time or another. Many build awe inspiring custom configurations for Conky that displays not only system information, but currently playing song, current weather and a plethora of other information using custom colors and images.

I have one problem with Conky and other desktop widgets – they are hidden behind your open programs. If you have followed my blog you will know that I have noted this many times before, arguing that notifications and widgets that are thus hidden are practically useless.

This weekend, while fooling around with bash I might just have stumbled upon a possible solution to my issue with notifications being hidden behind open windows. Say hello to ‘notify-send’…

continue reading…

Today is 8 Sept 2010 – 08/09/10 for everybody except you guys in the USA – and I bring you our weekly roundup!

Today the topic is TWITTER, and how to get a lot of twitter followers quickly, and why I think doing that is a bad idea.

continue reading…

A commenter (Kerberos) gave me a link regarding a FLOSS evangelist having trouble to connect to a CUPS printer in Linux. That link was from 2004, and he claimed that it was still relevant.

Naturally I wanted to see what he was on about, and decided to connect to a CUPS printer already set up here at the office.

Here is what happened… continue reading…

I happened on a book “Hacking Windows XP” the other day. Browsing through it I found useful tips on customizing XP, from boot splash, to Login Screen, to how it behaves and so on.

I thought it quite a cool idea to present a series of how-to’s over the next few weeks on customising various aspects of Ubuntu. continue reading…