So you decide you need a more robust server for your WordPress site.
You sign up for Amazon Web Services (AWS). After realising you need to select ‘EC2’ to set up a new server you decide to ‘investigate’ the several billion different images available in the ‘Marketplace’. None the wiser you pick the one on page 1 because it must be there for a reason right?
If you have a PHP based website you can’t go too far wrong with the ‘Bitnami‘ produced images. Just remember, Bitnami puts everything into the /opt/bitnami folders on a linux unbuntu installation.
Anyway, after you finally remember why you needed a proper server instead of a slither of junk on dreamhost, you begin the long, frustrating journey to caching. Except you discover APC and APCu are now different and apparently Zenddesk OpCode is all the rage because it’s an opcode cacher and APCu is a user data cacher and then you make a coffee and remembered how things used to be so much easier 20 years ago armed with Ada and CGI. Anyway, I digress. Again.
So here’s what to do to get APCu working on the Bitnami server (assuming it’s not there already):
Step 1
Make a test.php file in ~/htdocs with the standard
<?php phpinfo(); ?>
You will need this if you don’t already have one
Step 2
On the terminal you want to:
sudo apt-get update
and wait whilst the repositories list update.
Step 3
Once that finishes, do a:
sudo apt-get install php-apcu
and let that finish. If it fails just give up and pretend your site doesn’t need APCu anyway.
Then save the file and finally restart everything:
sudo /opt/bitnami/ctlscript.sh restart php-fpm
.... does its thing ...
sudo /opt/bitnami/ctlscript.sh restart apache
... does its thing ...
Step 7
Now go and load up the test.php file and search for the glorious APCu.
Apparently there’s an APCu snazzy dashboard which is also accessible via your web server. Grab the php script file from here and it should look something like this:
At some point, as a Rockstar Ninja Web-developer, you will be required to create an input form. This is not a task normally carried out by Rockstar Ninja Rails developers because there’s no need to integrate 6 different APIs into a mashup here. But unfortunately, all useful websites have a form or two. Umbraco CMS websites are no different, and if your form needs to allow every mama and script kiddie to upload a few angled brackets and choice quotes then soon you will bump into this infamous YSOD:
“A potentially dangerous Request.Form value was detected…”
So as you’re adding gradiented backgrounds to the “Tell us why you are amazing” input box for your secret MVP bootstrap investor-bait inside your .NET 4.0 UserControl, you will need to do the one or all of the following:
1. Possibly add:
<umbraco:DisableRequestValidation ID=”DisableRequestValidation1″ runat=”server”/> to the actual Umbraco Template that this UserControl will site inside.
2. If things still aren’t working then adjust web.config:
<httpRuntime requestValidationMode=”2.0″ …. />
<pages validateRequest=”false” … />
Result!
And that should now allow anyone to upload malicious XSS Javacript code, funky SQL Injection attacks and general misdemeanour into your beautifully UXed forms.
Make sure to always encode the input before outputting or saving to the database by using a library such as AntiXss:
The mills no longer turn. Schools struggling, ghettos of unemployed youth divided by colour, language and money. A fleeing middle-class in a town desperately trying to find its place in time, again. A history that predates the nation it belongs to. A champion oval-shaped ball chasing team giving the citizens some much needed pride. Drugs. Crime. Destroyed unions and a local newspaper reducing its pages by the day. This isn’t Baltimore, this is Leicester.
Leicester and Baltimore, not often in the same sentence.
David Simon’s epic “The Wire” can’t be mentioned without an obligatory accompanying superlative: “The Greatest TV Show Ever Created“; “Barack Obama’s favourite show“; “A modern day Greek Tragedy“. The Guardian has a dedicated online section devoted to exploring every facet of the drama, which deconstructs the murky and confusing inner-workings of Baltimore city from the ground up – the drugs trade on the streets, the declining union on the docks, the statistics chasing inner-city school system, the morally-deprived police service and even the local newspaper’s struggle for relevance. Countless blogs and articles have been written reconstructing every scene and story. Various universities including Harvard have courses dedicated to dismantling and dissecting every nuanced social commentary lurking in Omar Little’s famous diatribes. In short, The Wire is not just another TV cop drama.
The Wire never gained mass appeal like The Sopranos did but instead quietly developed a fervent zealous following dividing the world into those that knew, and those who had yet to be educated. What makes The Wire such compelling viewing isn’t the astute observations of Lestor Freamon or the moral uprightness of Cedric Daniels‘ lower back, but the infinite cyclical nature of Baltimore, its institutions and by extension, urban America itself.
So here’s an idea – take any densely populated city and then “apply” The Wire to it like a recipe in an illustrated cookery book. It doesn’t take long to identify characters, institutions, industries, locations and stories that mimic its TV counterpart. The Wire is the dramatic mirror which reflects back the ugly truth about de-industrialisation and the urban decay that can follow. I’m from Leicester. I applied The Wire to it, and this is what happened:
Senator Clay Davis
Politics is just another Game played with the briefcase instead of a shotgun according to Omar. Clay Davis is the grandmaster – positioning mayors, commissioners, gangsters and lawyers on his chess board to ensure he always wins whichever colour makes its move.
His silver tongued smooth delivery, opportune media appearances, championing of minority causes and cemented support amongst the black-minority ethnic (BME) population makes him a formidable character in the courtroom. Being a former lawyer helps Keith Vaz, of course.
The controversial and polarising Leicester East MP enjoys fanatical support in the city’s mostly Indian Belgrave and Rushy Mead areas polling over 50% of the vote at the 2010 general election. The Vaz dynasty has established itself as a powerful ruling family – mother Merlyn was the city’s first Asian female councillor and sister Valerie is also an MP for nearby Walsall South. Keith Vaz could eventually become a Lord ensuring his name forever lives on in Leicester infamy.
Vaz’s Wikipedia page describing his “Political Life” reads like a list of “How not to be a public leader”, including illustrious highlights such as:
Of course, there’s only one real question worth asking about Keith Vaz – what would an informal drink at the Strangers Bar between Keith and Clay sound like? Possibly something like this:
Keith Vaz: Hey, Senator, the Daily Mail is running that story about helping my friend again. Clay Davis: Shieeeeeet Keith, you know them stupid muthafuckas at the met police ain’t gonna touch yo shit with one of your 10 foot barge pole muthafucka got enough dirt on that muthafucking Dizaei to have his ass put away for straight 10 years muthafucka. I know what they bury in those Hillsborough files. Shieet. Keith Vaz: But Senator, what about the properties and the money Even Hinduja’s backed away. Clay Davis: Keith, lemme tell ya. This fella, think his name was Bell or some shit like that. Brutha, I tell ya, we bled that muthafucka! So don’t worry bout them downtown niggas, once you get pass the lawyers, they all game! Keith Vaz: Shieeeeeeeeet.
Mayor Carcetti vs Nerese Campbell
In 2011 55% of the Leicester electorate agreed to have an elected city Mayor superseding the powers given to the former council cabinet. By 2012 a fascinating and destructive power struggle broke out between new mayor (and former MP) Sir Peter Soulsby and former leader of the council Ross Wilmott.
Wilmott lost letting Soulsby race forward implementing his vision for the future of Leicester, starting with a new public “Jubilee Square” to complement the city’s heritage. But old problems can’t be repaired with a new sketchy-pencil picture. The city’s decades long problem with failing schools has been grasped by incumbent Tory leader Michael Gove as a stick to beat the state-school system.
As with the fictional Carcetti, Soulsby came to office with noble aims. His well advertised 100-day action plan was generally well received and promised a new brighter future. But just like the fictional Carcetti, Soulsby too finds himself embroiled in internal manoeuvring preventing him from committing fully to the city that needs him so badly.
The Greeks
Season 2 introduced David Simon’s face of unfettered capitalism – Spiros “Vondas” Vondopoulos and his geriatric but ruthless money obsessed boss, The Greek. Lurking peripherally around Baltimore’s street gangs, these guys played an entirely different but crucial Game to the one reluctantly enjoyed by Avon Barksdale, Marlo Stansfield and friends – supplying drugs and women to Baltimore.
Step forward Albanian Hysni Sokolaj, almost Greek by virtue of geography. He briefly made the Metropolitan Police’s “most wanted” foreign nationals list in early February 2013. Sokolaj and his organisation are still being hunted by the Met for crimes including murder, robbery, drug trafficking and most likely human trafficking too.
No information has been released about whether or not Sokolaj’s victims keep their faces and hands.
The Baltimore Sun and Gus Haynes versus James Whiting
The Leicester Mercury is the city’s last remaining local newspaper. Cuts from the owning group in recent years has seen the outlet reduce staff and even stop printing its own daily. In 2011 respected editor Keith Perch unexpectedly resigned from his position. News on the grapevine suggested a poisonous friction existed between Perch and “The Publisher” – reminiscent of the increasingly destructive duels between Gus Haynes and James Whiting at The Baltimore Sun.
Bubbles
If Baltimore had a face, it would look like Reginald “Bubbles” Cousins – a stoic character whose struggles mirror those of the city he sleeps rough in. The Wire tackles homelessness thoroughly in Season 5 as part of an absurd story-line that revolves around a depraved serial killer. Leicester hasn’t suffered a serial killer who leaves motifs, but it does have a growing homelessness problem exacerbated by the city’s rising population, high property prices and the lack of jobs – by 2011 at least 50 people were sleeping rough and 200 families living in hostels. Continuing austerity and housing benefit caps will most likely have made this figure even worse.
Lestor Freamon
He has Leicester in his name.
So what?
Applying The Wire as a template for modern urban societies is an interesting exercise for identifying recurring patterns in the structure of our cities. Decline is never terminal but cyclical. Understanding this cycle can give mayors and decision-makers a chance of breaking it – perhaps explaining why the new mayor of Reykjavik has made it obligatory viewing for his coalition partners.
The Wire characters such as Omar Little and Jimmy McNulty are fictional exaggerations to tell the story of an old American city. They are hard if not impossible to find real-life counterparts for – however, the fabric into which these stories are woven into can be readily found in most urban settings allowing localised imitations to be weaved into our own surroundings. Find enough similarities and for a brief moment, we too can become just another character playing The Game.
Two seasons ago, Paulo Sousa was Leicester City manager. The good times were just moments away. Note the optimism:
Being a northerner trapped in a South Londoner’s body has its perks. The Leicester City Juggernaut rolled into town today with Paulo Sousa’s hair in tow. Whilst City continue flirting with Thai investors Palace have been given a new lease of life after last season’s near demise. An intriguing tie which seemed like the perfect occasion to introduce the Woman to the joys of following the famous Foxes. Of course since then Leicester City have single-handedly increased Leicester’s GDP by several million, caused a mini house-price bubble around the King Power Stadium and we’ve all been led to believe “In Sven we Trust“.
Of course Paulo was quickly disposed of and so began a highly anticipated 2011 campaign with Sven. After an unremarkable victory over Coventry and 2 home defeats it was the first half performance at rivals Forest that gave a glimpse of what this team could do if they decided to follow the bald one’s tactical plans. However, even Sven could not prevent Leicester City from being, well Leicester City as the club ensured the self-destruct button was pressed fairly quickly. A nervous first home victory over a confidently rampant Saints followed by a season that promised so much eventually fizzled into mediocrity.
Fast forward to the 2012/13 campaign and true to Thai Buddhist philosophy the wheel of life continues with the unjustly discarded Nigel Pearson entrusted once again with the now drenched-in-poison chalice. How apt then the first home defeat of the season for the high flying Foxes came against manager-less Crystal Palace and just like 2010 with Paulo Sousa, the defeat has done nothing to dampen the optimism and expectation of promotion. The circularity of events has continued on to the pitch with Nigel Pearson eschewing his trademark “efficient” football and replacing it with a flamboyant, marauding, tenacious and attacking style witnessed in glimpses under both Paulo and Sven but never employed consistently. The combination of defensive astuteness and attacking expansiveness results in very impressive stats:
If you’re a bit dense like me and you’ve been tasked to install TFS then you can do 1 of 3 things:
Run like a big girls blouse to your command line rubbish Git, or
Use a real source control system like Visual Source Safe, or
Curse someone at Microsoft whilst you attempt to install Team Foundation Server for the 17th time in the last 3 days and dream of all the fun you could be having branching, merging and blaming with Mercurial instead.
At every possible opportunity (usually a “Next” button) you will have to navigate an error message. Sooner rather than later when installing Sharepoint Services for Windows or whatever is called you will come across this lovely error:
“create database permission denied in database ‘master’ “
What this means in even more plain English is this. The username you entered in the previous screen AS WELL AS THE CURRENT LOGGED IN USER (if you followed proper TFS install instructions then this should be TFSSetup) must have the “dbcreator” role assigned in MS SQL . LOoK:
You have to make sure the user you set to use the database in those Sharepoint Configuration screens also has access to the master database:
This is all probably incredibly insecure, but it will get the damned thing installed. Consult your local security advisor as for what to do with all those permissions (i.e. not me).
Good luck with the rest of your install. Post your nightmare installation stories below, feel free to pepper them with half truths to make the subject matter slightly more interesting.
Like everyone else, I too struggle to comprehend the meaning of life and my place in the “Grand Scheme of Things”.
As the years pass and experiences accumulate into a collection of blurry images all strangely framed by Polaroid paper, I can’t help but come to the conclusion that it’s all a bit pointless. Religion that is.
Now I could blame Richard Dawkins and his zealously anti-religious campaign or maybe it’s the hilarious muppet show put on my al-Mouhajiroun/Islam4Uk.
But however much vocal media personalities may sway your opinion, ultimately the question of “who am I” can only be answered by ourselves. As a dashingly handsome young Muslim man living in one of the greatest cities on Earth it is not hard to have your resolutely held beliefs smashed to pieces one by one.
Look around your office – can you honestly say they are all going to hell? And if so just what did they do to warrant such condemnation? Do you as a Muslim have the confidence in your belief to walk up to any one of your non-Muslim co-workers and tell them they are destined for eternal condemnation because they showed too much skin? Or rather do you, like the majority of the billion plus Muslims on Earth put your head down, splutter under your breath and proceed to collect your pay packet on Friday.
The question is – have you made a mockery of your faith or has your faith made a mockery of you?
I admit I’m not the first to suffer from development crawlitis. You start the project faster than Usain Bolt out of the blocks and you know for sure your schedule is over-estimated.
A week later and you’ve already slipped behind schedule by half a day. “No worries” you say because you know you and/or your team will make up that half day with coffee and enthusiasm alone.
Several months later your 30 day schedule is now a piece of paper nobody wants to take owenership of. The poor orphan in all your majestically titled Project Documents folder.
So where did it all go so awfully wrong?
I don’t think one brief blog post will enlighten anyone but from my own anecdotal evidence, the sins go something like this:
Thou shall not covet thy neighbours wife.
People like building things. But they like coming up with ideas more. Once the project starts its become “old hat” and new, sexier projects start catching your eye. Your imagination drifts and you wonder how great it would be to be the architect coming up with that cool new spec. It’s 5 o’clock and you realise you’ve just spent 4 hours imagining how you would architect wordpress if you were given the opportunity.
Thou shall not commit adultery
Once you start a project your project manager comes along and says “Hey, the man, we’re trying to get these funky new clients into bed with us, we need you to come up with a quick demo in your spare time”. Being the good boy or girl you are you say “Yes”. You’ve still only ever got past the first few pages of “How to say no without feeling guilty“. You know your schedule is tight and you know you don’t have any of this mythical spare time. But there seems to be a chasm and a disconnect between your brain and your mouth. The numskulls aren’t doing their jobs properly. Faster than you can say “productivity suffers when context switching” you’re now heavily involved in more projects than P Diddy. Next time you won’t make the same mistake you promise yourself.
Thou shall not make wrongful use of the name of thy God
You’re already behind schedule and your team cry salty tears over their latest sprint. The false prophet that was agile has revealed his true colours. Rapid Development was but a cruel prank by the devil. The fabled waterfall was just an illusion. Your architecture in hindsight turns out to be a contradicting piece of convoluted pipework that ends up dumping raw sewage straight into the sea. It all seemed stunningly obvious when you were drawing out the squares in MS Word. It looked even more solid when you applied that shadow effect underneath the yellow barrel that was supposed to represent what turned out to be several master-slave databases. It’s been written about for decades but it still doesn’t seep into our collectively thick skulls. Without gathering requirements and taking time to develop a prototype or carry out proper in depth research your project is doomed.
Thou shalt remember the Sabbath and keep it holy
Everybody needs a break. DHH reckons we can only program effectively for 5 hours a day. Once projects start slipping panic mode sets in. You try and hack your day to contain 48 hours but it just doesn’t seem to work no matter how many redbull-coffee-sugar concoctions you invent. Your body gives up and your brain seems to have seeped out with that 8th trip to the loo. Sometimes you have to admit you’re just a human. Ain’t no red cape gonna change that.
So then?
I don’t have any answers – but maybe realising that software development and systems building is a human endeavour that is prone to all the weaknesses of being human – will help us leave our pride at the door and stop believing in our own super-human abilities.
Islamikah (apparently, you can find your perfect muslim partner there) is back on the agenda after a slight lull in the development schedule. Ok completely ignored it is a better description.
Having decided to use the seemingly very useful and bordering on lovely Community Engine in place of a custom solution, the next step was testing it out in a live site. You can of course use your shell to install the plugins or you can cheat like me and ftp them on. It all depends how many cups of coffee you want to get through.
Right, so everything running like clockwork that is until you decide to break into the virgin home page and give the commnity aspect of the engine a good workout. Kabooom! Oh dear “image_science” caused the kind of mischief only a rails app can. Proudly crowning the top of my page was the following statement of error:
Define INLINEDIR or HOME in your environment and try again
After a bit of digging and coming across this post I made the following changes to my setup:
In my hosting user area created a new folder “islamikah.inlinedir” with permission 755
In config/production.rb added the line ENV[‘INLINEDIR’] = ‘/path/to/islamikah.inlinedir/’
Restart your server, or with fcgi kill any dispatch.fcgi processes (on hosting rails do $ killall -u user_name dispatch.fcgi). Your host may have different arrangements for restarting fcgi.
Ok, so finally the medixbox menus are coming together, they slide up, slide down, show the right state and all the other nitty gritty associated with prettiness. Quick launch IE tester. KAbbooom!!! “(‘background-position’) is undefined” or some other useful crap is spouted forth.
Now I am in love with JQuery, like everyone else. I’ve had my fair share of JavaScript woes over the years and using JQuery is like putting lipstick on a pig and actually looking nice.
Several coffees and expletives later it turns out Internet Explorer in all its reincarnations doesn’t seem to know what “background-position” is and instead retrieves its own “background-position-x” and “background-position-y” css rule. That’s all very nice and good but it means my code now has to have this:
function determine_x_pos(obj){
//parameter obj is something like $('#my-div')
var pos = $(obj).css("background-position");
if (pos == 'undefined' || pos == null) {
pos = $(obj).css("background-position-x"); //die in hell
} else {
pos = pos.split(" ")[0];
}
return pos || 0; //yes returning a 0 on fail is bad but its for demo!
}
In true NastyHabit fashion, the code is shit. Nevertheless, it works a treat!
The paranoid guy in me believes this cursed issue only afflicts me. Please check if you too have been burdened by the beast of redmond and help a fellow man feel less picked on by the curse of IE.