Monday, 2 April 2012

Prying Dave's Folly

Hello Dave
So the UK government wants to monitor your emails, web usage, calls and texts. Let's all panic.


But, let's not. This government is akin to a racist on Twitter, expelling rubbish directly from their deep, dark fantasies, not allowing the inhibitions to take hold and reign them in. I doubt this one passed the Cabinet Reality Assessment Procedure (CRAP) test before going public. Fabulously they've gone public very prematurely on this one, not bothering to actually consult anyone who knows what they're talking about, or listening to the wrong people, and at the same time showing their hand. While you should worry about the intentions and the implications, you needn't worry about it actually happening. Here's why.


Let's start with web site visits. This is the easy one. There are a few stages involved in getting your computer to communicate with a server somewhere else in the world which serves you web content. The first part is a DNS lookup. You type in www.terroristdaily.com and your computer goes to your configured DNS server (usually your ISP) to translate the DNS address to a numeric IP address for direct access. This DNS request in plain text and transmitted in the clear and can be intercepted by your ISP. So it's relatively easy for the government to pressurise your ISP into syphoning off all DNS requests into their own systems to log and analyse. They would be supplied lists of web sites that you have requested in your browser, or indeed, anything that your computer has been instructed to access, either by you or by some nefarious bit of spyware / malware you've been afflicted by. This is also something to be mindful of, not everything your computer accesses is initiated by you.


The next bit is the actual transfer of data, and where it gets interesting.


Years ago, it became apparent that we needed to secure information exchanges across the Internet. Something called Secure Socket Layer (SSL) was invented, and then more recently, a enhanced version called Transport Layer Security (TLS) superseded it. This works by encrypting the data sent between the web site and your computer. For your specific session, it can only be decrypted at your end, or the on the web server serving the content; nowhere in between. 
By now, every web site should be SSL by default. It should be that every web site you visit should make your address bar turn green. Those sites that don't do this just need a little kick up the owners' / administrators' arses. (Conveniently, a good way of doing this is to introduce something which will make users much more likely to visit if they do, such as a government snooping on you...) Then, if web browsers start attempting to connect to web sites using SSL first, and then falling back to plain text with a warning if it can't, all web sites would very quickly be SSL only. 
So that's intercepting traffic in the middle taken care of, but what about the actual web sites? Well, Big Bad Dave can't get every single web site everywhere to log traffic for him, so there's no way they can monitor what you're actually doing on a web site that is secure. They can see where you're going from DNS lookups (and then only maybe, I'll elaborate later), but not what you're doing when you're there.


Now that we've seen how SSL and TLS secures conversations between users and web sites, it makes email security a bit easier to understand. There are 2 major ways people use email; webmail and remote mail servers. Communications with webmail servers happen through your browser and are subject to the exact same encrypted SSL traffic as visits to any other web sites. Take GMail and Hotmail for example, both enforce SSL by default, so sending someone with a GMail address an email from your own GMail address means that the mail never goes outside of Google, and neither your ISP, or anyone else can see anything to do with what's in the mail, who it's for etc. They would need Google to give them info for that...


It gets slightly more complicated when mail goes outside of webmail. If you send an email from your GMail to terrorism@letsblowthemup.com, and the mail server for letsblowthemup.com is a standard old SMTP server, then the info is likely to be sent in the clear and it can be intercepted. However, any aspiring terrorists (which these plans are made to catch, right?) will encrypt the mail before it gets sent. There is Pretty Good Privacy (PGP), and the later, better version, GNU Privacy Guard (GPG), both of which are personal level encryption standards where it's simple to encrypt a document, or mail etc. The use of these tools is widespread, and will become the default simple way of doing things in mail client programs such as Outlook and Thunderbird, with support in webmail coming soon after.


A final consideration is a Virtual Private Network (VPN). VPNs were invented to provide privacy and security between computers communicating over the Internet. They provide a layer of segregation where the data is being sent over public networks, but the data can only be read if you're part of the private network. In the late 90s and early 2000s, when the arab states started getting more western immigrants wanting the same unrestricted Internet access they'd become accustomed to, they attempted to control access at the ISP level. This caused the users to use VPNs to subvert any interception or security in place, and meant that the ISPs were unable to block specific types of traffic inside the VPNs. I personally supported someone who moved from the UK to Dubai and found that he was unable to use Skype out there as the local ISP had blocked Skype in favour of their own paid-for version. A simple VPN configuration later and he was using Skype and there was nothing the local ISP could do about it. This is also where it comes back to DNS lookups, because if they're done inside of a VPN, they're also encrypted and can't be intercepted. The Tor Project is a mass VPN which allows normal users to remain anonymous in much the same way.


So to summarise, yes, if the government want to snoop on which web sites you're visiting, then it's not difficult for them to do so, unless you use a different DNS server. It becomes almost impossible for them to see what you're actually doing on a web site, unless the site owner is willing to give them traffic logs (which is unrealistic, it places far too much overhead on the site owners). Most people use webmail now so that is already secure and works by the same rules as secure web sites.


What can you do to make sure the government can't snoop on you? Well, start by encouraging the use of web sites which are secure by default. Always type https:// at the start of an address to attempt to connect securely.
Then, use a different DNS server to your ISPs. Nice, reliable DNS servers are Google's which are 8.8.8.8 and 8.8.4.4. It won't stop your ISP from being able to intercept DNS lookup traffic, but they can't just hand over simple logs.
Then, if you're not using webmail, use GPG to encrypt your emails.


In the end, the logistics of the government being able to snoop and log everything everyone does are insurmountable. But they only want you to be worried that they could be looking at any time, the fact they actually can't doesn't enter into it. Even then, it's almost useless for them to do so. This is due to logistics on databases, but that's a whole other topic.


It's also important to distinguish between anyone being able to look at where you're going, and being able to look at what you're doing. The media would like you to believe it's the latter, but this is only in very few cases. So for now, don't worry about it. Just think about your privacy and look for encryption everywhere. The web is built on some pretty solid foundations and a massively right-wing, paranoid, temporary government can't change that.

Friday, 9 December 2011

Martin O'Neill Revisited

I've never posted Football related stuff to this blog before, but I need somewhere to respond to a post made about Aston Villa, and this is my main blog.


The post in question is this one on Aston Villa Underground. I've never visited the blog before so I don't know about the normal standard of content, but unfortunately it wasn't a great start. I'll reproduce in full and respond to each section at a time. The post is about Martin O'Neill and was centred around him not being the standard of Football manager he gets credit for.


Martin O’Neill: The Truth #avfc #safc
Poor old Sunderland.  First Aston Villa take Darren Bent off their hands and then they have the genuine misfortune of signing away a three year contract to Martin O’Neill.  Times must be very hard indeed up north, where money is tight, the logical step being to appoint a manager of MON’s calibre, famed for his ability to bring top 6 finishes on a shoestring.
Or rather not.
Sarcasm and banter aside, there is a purpose to this much pondered piece.  And that is to awaken Sunderland fans to the fact that they have not pulled off a coup.  Further, it should also serve to remind Villa fans that everything wasn’t all so rosy under O’Neill. 

Actually, it pretty much was. There was some discontent about the decision to prioritise chasing the Champions League spot over a Europa League game by playing a mostly reserve side in Moscow, one I and many others fully agreed with at the time, but aside from that I can't remember anything outside of exciting times chasing the big boys with the big money.

Indeed, his actions, inability to take the team forward, astonishing waste of vast sums of the clubs/Randy Lerners fortune, brought our historic and beloved club to its knees. 

Wow. Where to start with this one. Inability to take the team forward? So constantly improving season on season isn't taking the team forward? As for the astonishing waste of Lerners [sic] fortune, well to any reasonable person, there was no waste and thus it wasn't astonishing. The vast majority of players bought improved the team and helped Villa to climb the table, challenge for the Champions League spots and to challenge for cups. I can see that by this end of this rebuttal I'm going to have to make a list of players bought by O'Neill and their sale price. Taking that business into context with the overhaul required of the squad, I think it'll become apparent that it was mostly shrewd business.

 Need I mark one Emile Heskey as the principle evidence to those whom dissent?  Heskey, the purchase made to drive Villa’s Champions League ambitions?  The prosecution rests.

Need I mark any of Ashley Young, Stewart Downing, James Milner as principle evidence to the contrary? I'm not even sure what the point is here, but Emile Heskey was bought for £3.5m from Wigan while still playing as England's no.9. John Carew had become interested in other parts of life outside of Football and was regularly injured and there's nothing to suggest that Lerner would allow any more than £3.5m at the time. In fact, a quote I remember a quote from the time (but which I'm unable to find now) about that January transfer window was along the lines of "The chairman would like to run the club a little more within its means" when he was asked about the January kitty. We'd also spent quite a bit of money in the summer on Carlos Cuellar (SFW player of the year), James Milner (now plying his trade at the richest club in the world), Luke Young (Middlesbrough fans' favourite and aptly named 'Mr Reliable'), Brad Friedel, Curtis Davies, Steve Sidwell and Nicky Shorey. The latter 3 were less successful than the others in the long run, but each had a pedigree which made them good buys at the time. Curtis Davies performed so well for Villa so as to receive an England call-up and was being talked about as a realistic replacement for Rio Ferdinand, Steve Sidwell was the best player at Reading a few seasons previous which led to Chelsea buying him, and Nicky Shorey has had England call-ups and is now playing well for West Bromwich Albion.

I have the utmost respect for Sunderland fans.  But beware of Martin O’Neill.  He possesses a rhetoric that is deceptive, has built a faux brand of trustworthiness, impassioned loyalty and every other sentence will remind you how “delighted” he is.  Did I mention how humble he is?  He’ll be sure to mention that as well.
But nothing that ever goes wrong will ever be his fault.  Ever.

So he's slightly eccentric? Is that what we're accusing him of here? As for the suggestion that he shifts blame away from himself, I can honestly say I've never thought he was anything other than honest and respectful. 

Man motivator?  Rejuvenater of players?  Quite the opposite - O’Neill will ostracise and overlook the very players he has bought if they don’t immediately buy into the philosophy and pray at the O’Neill altar.  And whilst erratic dressing room harmony is less than desirable to any team wanting to progress, it is also detrimental to the balance sheet to harbour numerous expensive “misfits” along the way.  

More subterfuge. Surely it's in his best interest to make players he has bought a success at the club he manages? Why would he ostracise or overlook them without good reason? There are always reports of managers losing the dressing room, and with O'Neill coming from the Clough school of Football, I wouldn't doubt he would demand respect from his players. Having a massive interest in Criminology probably helps with the psychology, too. 

Nigel Reo-Coker, Luke Moore, Stephen Warnock, Stephen Ireland, Steve Sidwell, Gary Cahill, Thomas Sorenson, Moustapha Salifou, Shaun Maloney…but this is not a game of lists.

A list looks an impressive way to back up a theory, but let's examine them, shall we?
  • Reo-Coker - Got into a 'contretemps' with the manager. Allegedly rolling around the floor. A player challenged the manager and the manager responded. After this the player was sent to the reserves for a few weeks. I'm not sure what was wrong with that. Any show of weakness would have the players exerting more authority, not a good situation.
  • Luke Moore - Err, what? Not a very good player who was sold on very early because he wasn't good enough.
  • Stephen Warnock - A dip in form resulted in him being dropped. Again not sure on the problem here.
  • Stephen Ireland - Really? The author must be really angry to blame Martin O'Neill for shutting out a player who was at Manchester City at the time.
  • Steve Sidwell - Did a job, not the most expensive buy. When we had better options, he was on the bench. That's how Football works. Simple enough for most people to grasp, but to some people, anything can be used to criticise. 
  • Gary Cahill - Was behind the excellent (at the time) pairing of Curtis Davies and Martin Laursen. Was too impatient to wait for his chance so went to Bolton. Had he stayed I'm very confident he would be England's first choice centre back by now, rather than getting bit parts.
  • Thomas Sorensen - To be replaced with Brad Friedel. Or isn't the manager allowed to improve the team?
  • Moustapha Salifou - This is getting to the point where I'm not sure what the author is actually complaining about. If a player costs little, shows promise and is worth a punt, then when they aren't in the first team when they don't perform. Then when they aren't in the first team, apparently the manager is at fault for leaving them out? How does that work?
  • Shaun Maloney - Got homesick.



The myth of working to a budget was the biggest fallacy blown out of the water by O’Neill’s Aston Villa project.  Whilst developing an exciting counter attacking team, there was never a move to add the personalities or personas that would take the squad to the next level.  This was not about achieving success; O’Neill didn’t want to have the limelight shifted to a bigger star.  In short, he must be the big fish.  This is the same man that swapped Gary Cahill for Zat Knight afterall - he probably can’t wait to work with Titus Bramble.

I've never seen it claimed that Martin O'Neill was supposed to be working on a budget. O'Neill made quite a public move for Wesley Sneijder at one point, but the player decided to stay at Real. The claims above are blatantly false due to the big money deals for Downing and Milner, and the lack of a £20-30m next-level player surely should be the fault of the chairman, if someone decides it's a criticism at all.

Now, there can be the argument that the Alex Ferguson’s of this world have consistently maintained this ruthless approach - as in instances where Beckham’s influence extended beyond that of the managers he was shipped out.  But in reality Ferguson has managed the worlds best players, to great and repeated successes.  Rooney, Giggs, Stam, Keane, Yorke, Ronaldo and co.  The difference is that Ferguson is a winner and O’Neill wants to give the perception that he is on the same par.

Everyone wants to be successful as a manager. O'Neill has never claimed more success than he has earned. What's the point being made?

And thus O’Neill is a victim of his own hype - because quite simply he isn’t that good.  A procurer of success?  Or more accurately a perennial failure and nearly man?  He won’t be bringing up the effort of qualifying for the Europa League beforefielding a team of kids in Moscow having already beaten Ajax.  Tricky thing reality checking on you like that.  But in all seriousness, such failure was and is inexcusable for a man who holds himself in such high esteem.  He did all he has promised Sunderland with Villa, before abandoning it, along with all sense and reason.

Ad nauseam.. 

And under the notion of “value for money” Villa fans were under the impression for his entire tenure that we could only attract/afford the Heskey’s of this world; that we must focus and develop the Ashley Young’s and feel hard done to when they just missed out - or were sold on to our rivals.  The belief still holds true for some that they had their heads turned by bigger things - well of course they did, with no reasonable prospect of O’Neill being capable of managing the team to anything higher or willing to add the faces who could make it happen.  
The very idea we were operating to a limited “budget”.  This was utter rubbish - there were ample funds, it was just that Martin casually overlooked that he had personally frittered it away on utter dross (Curtis Davies, Nicky Shorey, Habib Beye, James Collins…but less of these lists, facts don’t sit well afterall).

Those players were not dross, as shown above. And he didn't personally fritter it away, players were bought and sold with the chairman's consent. As shown time and again, if a 'next-level' player is to be tempted to Birmingham to a current mid-table club like Villa, they will only come for massive wages. So to get these players we need to pay them a lot in wages. But it's O'Neill's fault for paying too much in wages. He really couldn't win, could he?

Which is why Villa’s purchase of Darren Bent in January 2011 underlines O’Neill’s failure.  And it’s glaring.  Yes, it was a vital £24m purchase as Villa lurched in the 2010/11 campaign - but it evidenced that the funds were there - and either he couldn’t be trusted (think Heskey) or he was a coward.  Either notion will suffice.

Really no. Bent was purely purchased to save Villa from being relegated. The chairman correctly realised it was better to spend £18m on Bent, being able to mostly recoup it later, rather than being relegated. Under normal circumstances, those funds wouldn't have been released. It wasn't simply that the manager wouldn't spend the money (although if he had, it would have been another stick to beat him with).

It underlines how close Villa were - and how O’Neill’s stubbornness and inability to produce results at the very highest level, where key decisions matter, were the root cause and obstacle.  Villa needed the Bent goals to elevate the squad in 2009 - but O’Neill’s refusal to make the big call, take on the potential ego of a star player and risk his own reputation should tell anyone all they need to know.  We needed Bent - what O’Neill chose was Heskey.  And he didn’t join Sunderland for £24m I recall (£15m).

This whole premise of O'Neill choosing to buy Heskey over Bent falls down when the evidence shows that funds weren't available. 

Sympathisers will refer to how the cheque book was taken from him at the point he needed backing - we will never know 

But the whole argument above relies on that. Now the author is revising the theory. It was apparently definitely, absolutely, positively, that we had the money, but O'Neill wouldn't spend it, because he was afraid of a bigger star than him, but now it's changed to we will never know. So I've read all of this for nothing?

And with that, I can't be bothered to refute any more. The rest is just more of the same diatribe, same tired, bigoted, contradictory arguments banded around by Villa fans who are still bitter about O'Neill walking out on the club 5 days before the season starts. No-one outside of the group involved and the tribunal knows what actually happened, but interestingly O'Neill won the tribunal..

Welcome back Martin; we’ll look forward to seeing you on the 21st April 2012.

I don't doubt that he'll leave the happier.

Monday, 26 September 2011

Returning to Windows: Part I

This series will run through how I've moved from being a full-time Linux desktop user to using Windows full-time. First up, a little about me.

I've been in the IT industry professionally for about 15 years, but I've always had something to do with computers. I started at around 7 learning BASIC and writing a few programs on my Sony Hit-Bit MSX.

(MSX is a whole other topic for another post, so I won't go into detail here.) 

After that I worked in Technical Support for a UK computer manufacturer before moving into R&D and finally into Linux system administration. During my time in R&D I had a lot to do with Microsoft and Windows in particular, developing PC builds and configurations around Windows from ME to Media Centre. I got to know them very well and didn't like the way either Microsoft, or Windows, worked.

So I changed my home desktop computers to Linux. Mandrake Linux at first as it was extremely user-friendly and attractive. It may look a little dated now, but against Windows 98 it was amazing.


I then moved onto Ubuntu as of Breezy Badger (5.10, released April 2005) and continued to make my protest against the Microsoft wheel corruption racket that I'd experienced when dealing with them.

So fast forward until now. Ubuntu was fantastic at the start, it promised so much, but as of Natty Narwhal (11.04) it's delivered so little. When I first started I always needed a decent video editor for my family videos. KDEnlive, Cinellera and later PiTiVi were video editors which were always halfway there, threatening to become the all-purpose easy editing suite that Windows Movie Maker had become. But 5 years later, it hasn't happened for one reason or another. A few weeks ago I simply couldn't hold out any longer, I installed Windows 7 on my main computer, stopped being a martyr and took the easy life again. My experiences since then have been mixed, but now I'm in the position where I can provide the fairly rare insight of an experienced Linux user discovering the pitfalls of being a newbie Windows user. In all honesty, I know what to expect, it's not that different to where I left it, but I still have a fresh view on most of it.

The next part of this series will be how the installation differed to what I'm used to. How easy is Windows 7 to set up and get ready to use compared to Ubuntu?

Monday, 1 August 2011

On the Origin of Cars and Human Beings

From my moderately recent uptake of running to attempt a Marathon in October it's struck me just how incredibly close the mechanics of motor vehicle engines are to the mechanics of Humans. A Heart Surgeon recently described to me that opening up the chest cavity and looking inside as "it's just mechanics". That got me thinking about just how right he is. Perhaps it's no accident that the two are so close in the way they work either; we've now had just over 100 years' of enhancement and refinement of car engines, so the natural process should follow the best formula for working with physics, proving that evolution is the ultimately the best judge. I'll try and explain how I think the two things match each other, and how they differ. By comparing them we can actually have a good guess about how cars will 'evolve' in the future, by looking at how the Human Body is better than an internal combustion engine.

Combustion
When exercising, you draw air into your lungs to react with food in your stomach, to be carried around the blood stream to your muscles. To help this process work, you need water. Without water you effectively dry up and grind to a halt. It's very easy to perceive this happening when you're dehydrating while exercising; you feel muscles tighten, your blood thickens and saliva turns very thick. This is very similar to how an engine will draw air in to the combustion chambers (lungs), combine the air with fuel (food) and use the chemical reaction to create energy. Also very similar is how lubrication is required. The engine requires oil to lubricate the workings otherwise it will dry up in the same way as your muscles and joints will dry up without water.

So the way the car engine produces energy is very similar to how we produce energy. What else is similar?

Tuning
When trying to get more performance out of your engine, it's a simple principle. More air and fuel in equals more energy generated. It's also remarkably similar with the human body. You exercise to increase your aerobic and anaerobic threshold by increasing the size of the energy pathways to your muscles. You exercise to make your heart and lungs more efficient to be able to make better use of the oxygen you can draw in and more efficient at using the energy. This is the equivalent of boring out your engine by making the cylinders bigger and holding more air, and increasing your engine's volumetric efficiency by allowing as much air to be drawn in on every stroke (breath) as possible by porting, polishing and general head work.
You can increase the fuel pump size, the fuel line size, the fuel regulator and the injectors / carburettor. This is the same principle as the size of your veins increasing to allow more fuel for your muscles to be carried. Most tuners will be familiar with the term 'Italian Tune-up' where giving an engine a blast will remove old deposits and scale and effectively allow your engine to perform better. The exact same thing happens with your body.

The Future
I firmly believe that any advances in the technology of the internal combustion engine have so closely imitated the mechanics of the human body that it's a fairly easy conclusion to come to that future advances will go down the same route. Where can we expect to see engine technology go next, if it does mimic human biology?

Well, the body's ability to self-heal and adapt to load is a great advantage. It makes it able to last, literally, a lifetime. As you ask your body to do more and more demanding things, your physique and attributes change to allow greater abilities at these tasks. Some modern cars have the ability to change the air and fuelling pattern depending on how it learns your driving style, so we can see some of that already. Even some technologies such as variable valve timing are also evidence that this is starting to happen, so I think we'll see engines able to adapt better to different driving conditions, demands and styles in future. We may also see more advancements in the way that engines are able to heal themselves by making use of modern materials.

It's no surprise that engines and the human body closely model each other, as both are intended to do the same thing; convert chemical energy into kinetic energy and deal with any associated wear and tear in the course of things. The human body has had quite a head start, but we're pushing transportation devices forward faster than evolution could manage, to the point where we could very well merge.

Can you see this trend continuing? Where will it go?

Wednesday, 9 February 2011

Making BASH Scripts HA Compatible - Daemonising BASH

Quite a few times on our clusters we've needed to make a cron job, or a shell script HA compatible. We'd like the cluster to be able to start and stop it, so it can failover with other resources if required.


It's actually a lot easier than it seems. The easiest way is making a while true loop with a sleep in the middle, then in each iteration check the current time against the run time of the script. It's kind of replacing cron, but needs must.


This is how I did it.

Stage 1 - Make a standard LSB compatible init script carcass


#!/bin/sh                                                
# description: Start or stop your res name
#                                                        
### BEGIN INIT INFO                                      
# Provides: your_res_name                     
# Required-Start: $network $syslog                       
# Required-Stop: $network                                
# Default-Start: 3                                       
# Default-Stop: 0                                        
# Description: Start or stop your res name      
### END INIT INFO    

RUNFILE="/var/run/your_res_name"


NAME="YourResName"
case "$1" in
'start')
        CHECKSTATUS
        [ "$RUNNING" ] && echo "$0 is already running" && exit 0
        echo $"Starting $0"
        touch $RUNFILE
        MAINLOOP &
        ;;
'stop')
        [ -f "$RUNFILE" ] && rm $RUNFILE
        pkill -f "$NAME "
        echo "$NAME"
        ;;
'restart')
        $0 stop
        sleep 5
        $0 start
        ;;
'status')
        CHECKSTATUS
        [ "$RUNNING" ] && echo "$NAME is running" && exit 0 || echo "$NAME is stopped" && exit 3;;
*)
        echo
        echo $"Usage: $0 {start|stop}"
        echo
        exit 1;;
esac

There's no CHECKSTATUS or MAINLOOP functions yet, we need to add those next.

MAINLOOP


You need a while true ; do ; done loop to sit there running through the stuff you want to check and then to do stuff at the appropriate times.


RUNTIME="000300" # 00:30:00
MAINLOOP() {


LOG="/var/log/$NAME.log"


while true
do
# Check for permission to run.
[ ! -f "$RUNFILE" ] && exit 0


# Check if we've already run today
if [ ! -f "$OUTPUTFILE" ]
then
# Or if we're still running
NUMPROCS=`pgrep -f "$NAME " | wc -l`
                if [ $NUMPROCS -lt 1 ]
                then
THETIME=`date +%H%M%S` # Get a numerically comparable time. 
if [ $THETIME -gt $RUNTIME ]
then
echo -e "\nApparently $THETIME is greater than $RUNTIME so it's time to do our thang" >> $LOG
echo -e "------------------------" >> $LOG
echo -e "\n*** Starting process.***\nThe time : $THETIME" >> $LOG
echo -e "\nNumber of existing processes : $NUMPROCS" >> $LOG
echo -e "\nLet's GO!\n" >> $LOG
RUN_OUTPUT
fi
fi
fi
sleep 1m
done
}


CHECKSTATUS


You can just use something simple like check for the run file and the background process running on this



CHECKSTATUS () {


if [ -f "$RUNFILE" ]
then
if [ `pgrep -f "mi_data_extract start" | wc -l` -gt 0 ]
then
RUNNING="yes"
else
unset $RUNNING
fi
fi


}


That's pretty much it. Check each operation of the init script with echoing out the return code from every state. e.g.


/etc/init.d/your_res start ; echo $? # from stopped, should be 0
/etc/init.d/your_res start ; echo $? # from started, should be 0
/etc/init.d/your_res stop ; echo $? # from started, should be 0
/etc/init.d/your_res stop ; echo $? # from stopped, should be 0
/etc/init.d/your_res status ; echo $? # from started, should be 0
/etc/init.d/your_res status ; echo $? # from stopped, should be 3


Once this is done, you can just add it to the cluster as a primitive LSB resource, add a monitor on it and let the cluster take care of your script.

Thursday, 11 March 2010

Time For Ubuntu to Fork Evolution

No one can deny the current face of Linux to the masses is Ubuntu. It’s massively more popular than any other distro which makes it the flagship for breaking existing market strangleholds.

Take the Enterprise server OS market for instance, a traditionally strong area for Linux anyway, Canonical (the controlling company of Ubuntu) have rightly seen where they need to position themselves to gain the advantage with Server OS’s and have gone down the Cloud route with Ubuntu Enterprise Cloud. Also - beefing up the support options and the packaging to at least align themselves with the normal market leaders Suse and Red Hat helps to gain further server adoption by to using the momentum of all the other Ubuntu areas and user allegiances.

The personal desktop / netbook area is the next to be tackled. Obviously Ubuntu has been trundling along as the best choice for the tiny personal Linux desktop market for a while but it has needed to really stand-out to do battle with Windows and the latest player (rising on the back of the i[Pod|Phone] wave) Mac OS. Again Canonical have pulled the rabbit out of the hat and pointed Ubuntu desktop in exactly the right direction – Social Networking. With Ubuntu Lucid having fully integrated Social Networking and chat they’ve shown they know how people actually use their computers. 9 times out of 10 someone is turning their computer on to participate in Facebook or make Tweets on Twitter, or for the Old-Skoolers chat on MSN. To make the desktop OS actually part of this is exactly the best way to position it and ensures it’s already ahead of the opposition when they realise they need to do the same thing.

Finally, there’s an area that Ubuntu is very weak on and it’s where efforts need to be concentrated next - The Enterprise Desktop.
Novell have previously tried to leverage that market but did it all wrong. They didn’t understand that there is just one killer feature (just as with integrated desktop social networking) that needs to be in there which is Exchange support. Outlook and to a lesser extent Office keeps Windows XP / 7 firmly planted on the Enterprise desktop purely because of its ability to work perfectly with Exchange. Businesses now (rightly or wrongly) revolve around shared mail, contacts, calendaring and scheduling, and Exchange shows no signs of being supplanted yet as the default choice for this functionaility.

With all this in mind I present my recommendation for Ubuntu: Fork Evolution.

Evolution has some good MAPI functionality but for every step forward, it takes 2 steps back. The functionality is very buggy but at the same time is almost there and some real concerted structured development would see it work very nicely and be a drop in replacement for Outlook.
Also, Evolution needs all of this Social Networking goodness that is present in the me menu in Lucid to be integrated into Evolution too. One place for all messaging/contacts/calendaring with Social Networking in there too and we’re getting very close to a framework that supports the multitude of communication mediums we use today.

So in my mind, Ubuntu and Canonical can move one major step forward by leveraging Evolution. Make it fit the new Ubuntu desktop ethos better and make it work properly with Exchange. Once you do that, world domination for FOSS will follow.

Tuesday, 9 March 2010

The Future of Web Services / The Plight of the Infrastructure Techie

The landscape for Internet Infrastructure is changing, and it may be quite scary for techies..

Currently, we have quite a supply-chain in web service hosting. We do everything ourselves and that means lots of skill-sets in various places such as:

Linux/Windows SysAdmin
Networking SysAdmin
HA/Load-Balancing Specialists
DBAs
Developers
Management

Typically, management instruct developers to do something and this something needs to be consulted on from conception to delivery. The developer needs to make it in such a way that the DBA and SysAdmins are happy that it will scale and perform. If it’s business critical the HA people get involved and ensure development is geared around being resilient too. The whole thing creates an infrastructure ecosystem of staff because it’s all very DIY so lots of diverse skills are required.

What happens when all of that is someone elses problem, without the disadvantage of outsourcing costs?

Using Cloud Computing you can build web applications to be self-aware. All of the nasty stuff that you used to have to worry about is gone:

Scaling – Amazon Elastic Compute lets you boot loads of instances of your pre-configured application OS images (read-only) manually or automatically. Because the booting of extra instances is web service controlled your app can decide if it needs more power or not.

Load-balancing – Single IP endpoints now control this. No more multiple servers with non-ARPing interfaces and virtual IPs. Amazon Elastic Load Balancing distributes load depending on instance issues, load metrics etc. OR you can plug it into Amazon Cloudwatch which monitors certain metrics and load-balance depending on that.

Hardware – It’s all virtual innit? It’s no longer our problem.

Database Scaling and Capacity – Apps just abstract DB API’s these days anyway. All apps ever do is ask the connector to pull data out into an object or insert data in, or do stuff with the data that’s there. If all you ever see is an interface into a limitless space of data then all you have to worry about is what you do with the data. Amazon SimpleDB does this for you.

Shared data storage – Amazon Elastic Block Storage behave like a SAN where you can have data sat on a filesystem to be accessed by apps on multiple instances. Again, any problems with this are someone else’s. All I care about is accessing my data.

Data mining – If you have lots of data to interrogate you can use Amazon MapReduce to process it.

There are lots of other ways you can use elastic cloud computing to remove a LOT of current infrastructure costs and concerns, eventually leading you to just have to worry about the application. Once you get to that stage you can just concentrate on making it work and doing it right. For a business, it’s a non-decision – or at least it should be. Without all the associated costs of infrastructure and infrastructure people a business can save obscene amounts of money and be a lot more efficient to boot. So why aren’t they?

Well, businesses are just scared of anything new. Elastic computing has to continue to innovate and provide something all-in-one and pre-packaged that it makes a lot more sense (not just a bit more sense) to migrate. Also business don’t like the idea of their data being somewhere they can’t control. That mindset just has to change, and it will as more and more large enterprises get on the cloud application bandwagon and start using tools such as Google Calendar / Mail / Contacts for company business. SLA’s give some peace of mind to directors but not quite yet enough.

But once the scales start tipping, the only people safe are developers.