pssh is a godsend when you're working with a number of servers. Pssh lets you run the same command on many different computers via ssh, collating the results for you.

The man page says pssh is "most useful for operating on clusters of homogenously-configured hosts.".

But to my mind, where it really shines is doing diagnostics over a number of machines.

I was recently called in to fix up a problem like this. A website had gone down, the sysadmin was missing, and nobody really new which of seventy-odd machines was responsible. So I was flailing around in the dark. All I had was the shared root password, and a client very keen for things to start working Real Soon Now.

My first tool out of the box was nmap. This lets me figure out which servers we have around::

Here I'm telling nmap to ping every machine with an IP address (internal to the data centre) of 10.10.22.XXX -- that is, which shares the first 24 bits of its IP address with 10.10.22. [why 10.10.22? because ifconfig showed me the IP for the firewall server I was first logged in to, and it began with 10.10.22.

Now, let's pull a list of IPs out of there. I couldn't find an option in nmap to just print the IP address, so let's do it with perl:

It's slightly irritating not to have the output matched up with the results, but it's already tellig us something useufl. 10.10.22.101 has an immense load, and has been recently rebooted. That's probably somewhere to concentrate our attention

We can also gather some information about what operating systems we're dealing with.

Much more can be done along these lines, but I'll leave it there for now

]]>http://ohuiginn.net/mt/2011/09/parallel_ssh.html
http://ohuiginn.net/mt/2011/09/parallel_ssh.htmlThu, 29 Sep 2011 23:15:42 +0000If at first you don't succeed: make a wordle and call it a day.Every data project goes through an embryonic Wordle stage. There's a point where you've spent a few hours futzing with code, are many more hours away from whatever you were trying to build, and feel aw, screw it, let's make some pictures.

In that spirit: headlines from the Guardian and the Mail, these past couple of days:

Guardian

Mail

The somewhat less pointless use of the data will come When I Get Round To It™ -- which, given current circumstances, might not be for quite some time.

]]>http://ohuiginn.net/mt/2011/07/if_at_first_you_dont_succeed_m.html
http://ohuiginn.net/mt/2011/07/if_at_first_you_dont_succeed_m.htmlThu, 28 Jul 2011 16:08:03 +0000Just how insignificant are BP and ExxonMobil?Multinational oil companies really have been eclipsed by their state-owned counterparts:

That's ExxonMobil coming in at number 17, as the first private company. It's 30 times smaller than Saudi Aramco by reserves, 20 times by production.

]]>http://ohuiginn.net/mt/2011/07/just_how_insignificant_are_bp.html
http://ohuiginn.net/mt/2011/07/just_how_insignificant_are_bp.htmlMon, 11 Jul 2011 21:49:07 +0000Dum-dum bullets and shoot to killThe Metropolitan Police are armed with bullets that the army wouldn't be allowed to use.

Hollow-tipped bullets are designed to expand inside the body on impact, making them much more likely to kill whoever they hit. The generals of the 19th century decided that they were too lethal for war, despite British arguments that they were needed to stop 'fanatical barbarian[s]'.

So they were banned under the 1899 Hague Convention**, along with chemical weapons and bombs thrown from airships. NATO still keeps to that, though perhaps few other armies do.

The police, through, are unaffected. So the Met used these these bullets to kill Jean Charles de Menezes, and this year they started using them more generally.

Now, there's a decent argument that this isn't as bad as it sounds. If a bullet is busy mashing your victim's organs, it's less likely to pass through and hit whoever is behind them. I thoroughly approve of not killing bystanders, but a little confused how that works alongside the policy of giving machine guns to the transport police

[disclaimer: I know nothing about guns, would be happy to never see one again in my life, and wish the police agreed]

]]>http://ohuiginn.net/mt/2011/07/dum-dum_bullets_and_shoot_to_k.html
http://ohuiginn.net/mt/2011/07/dum-dum_bullets_and_shoot_to_k.htmlSat, 09 Jul 2011 23:25:58 +0000frobbing marketsMarket volality provides information about a market. In just the same way as you learn what a gizmo does by applying different input to it, so you piece together the shape of a market by watching what happens under different circumstances. A market could seem utterly stable, until a little volatility reveals that it had always been at the edge of a precipice.

Tyler Cowen sees this in the fate of USian symphony orchestras after the financial crisis. The financial crisis pulled out much of their institutional support, thus showing how shallow was their backing. This caused secondary effects:

The initial negative shock of the crisis, among its other effects, caused donors and potential donors to see that support for these projects was weaker than they thought. Many of these donors are now less than keen to keep pouring money into losing endeavors. An unraveling process has set in. It's not just the negative wealth effect, but new information has been revealed about popularity and sustainability of the underlying venture. Neither monetary nor fiscal stimulus will prove any kind of easy cure for these institutions or, potentially, for these jobs.

There is a well-known literature in finance about how trading, combined with the possibility of sudden price dips, causes market participants to learn the shape of the market demand curve and thus revalue the appropriate overall level of prices. The mere act of trading can generate market volatility. This kind of insight is not yet sufficiently appreciated in macroeconomics. The financial crisis caused us to see that many market institutions were on shakier ground than we had thought.

This is analogous to the 'tipping-point' understanding of political protest. Marches aren't themselves important. But they show the strength of support, and so can win you the support of actors hedging their bets. So the time to march (leaving aside movement-building reasons) is when you believe that your support is greater than generally understood

]]>http://ohuiginn.net/mt/2011/06/frobbing_markets.html
http://ohuiginn.net/mt/2011/06/frobbing_markets.htmlSun, 19 Jun 2011 10:42:20 +0000UK parliamentary constituencies, with party currently in power there[mainly for the benefit of google]

Something I was surprised not to be able to find online: a list of UK parliamentary constituencies, and the party currently in power there. Something I needed, and I imagine a lot of people have put together for themselves over the years.

code will go up on github soonish, along with a bunch of related things.

]]>http://ohuiginn.net/mt/2011/06/uk_parliamentary_constituencie.html
http://ohuiginn.net/mt/2011/06/uk_parliamentary_constituencie.htmlSat, 18 Jun 2011 16:17:34 +0000sorry, nobody believes you any moreGovernments have got into the habit of offering massive amounts of foreign aid, then quietly abandoning their promises once public attention has moved on. It's nice to see them being called on it:

The Group of Eight (G8) countries will pledge $20bn in aid to post-autocratic Arab countries that have toppled heads of state and moved towards democracy, according to European officials.
...
While the $20bn would add a strong boost to the countries' economies, Al Jazeera's Jackie Rowland pointed out that the G8 had failed in the past to fulfill aid commitments.
She said that by the end of the conference, leaders were expected to publicly admit that neglect.
"We're expecting them to admit that there's been a shortfall in the aid that was promised... and the aid that was actually delivered," our correspondent said.

This is months after many of his counterparts in other countries, and at the UN quit. It was the defecting Libyan ambassador who persuaded the UN to meet on Libya, and to pass UN Resolution 1970 to impose an arms embargo. The Security Council at the time wanted to postpone meeting on Libya, but the diplomatic defections forced their hand.

Meanwhile, in Berlin, the Libyan diplomats remained loyal. I remember one occasion where our protest at the embassy was even greeted by a counter-protest inside its gates, the staff feverishly waving pictures of their Brother Leader -- and, presumably trying to ignore the loathing of their countrymen opposite.

Anyway, better late than never. The ambassador, Jamal al-Barag, defends the delay:

Spiegel how could you have remained in your position?Barag Because Schalgham [the Libyan UN ambassador, some kind of mentor/boss to the German ambassador] advised it. Since the UN passed Resolution 1973 [the no-fly zone resolution, on 17 March], I have done no more political work. I only come sporadically into the office. But we have more than 700 Libyan students in Germany. I ensure that they receive their €1800 each month, that their health insurance and tuition fees are paid.

Barag, who comes from Misrata, reports that he receives news of friends and acquaintances being killed on a daily basis. That he's spent 2 months watching this without criticising it is, to put it in the best line, testimony to the power of blind loyalty.

]]>http://ohuiginn.net/mt/2011/05/the_libyan_ambassador_in_berli.html
http://ohuiginn.net/mt/2011/05/the_libyan_ambassador_in_berli.htmlFri, 20 May 2011 10:08:13 +0000How do you describe a face?How do you describe a face? Given my ability to forget almost everybody I meet, it's a question that bothers me on an almost daily basis. I'm always trying to figure out some procedure by which I can break a face down into its component parts, remember them methodically, and so be able to recognize somebody the next time I see them.

Oddly, I've not yet been able to find any systematic method for doing so. There are tantalizing hints that such systems exist, but they're never spelt out simply on the internet.

In Snow Crash, Stephenson imagines the value of a reliable synthetic face for living in a virtual world:

He was working on bodies, she was working on faces. She was the face department, because nobody thought that faces were all that important - they were just flesh-toned busts on top of the avatars. She was just in the process of proving them all desperately wrong.
...
The Black Sun really took off. And once they got done counting their money, marketing the spinoffs, soaking up the adulation of others in the hacker community, they all came to the realization that what made this place a success was not the collision-avoidance algorithms or the bouncer daemons or any of that other stuff. It was Juanita's faces. Just ask the businessmen in the Nipponese Quadrant. They come here to talk turkey with suits from around the world, and they consider it just as good as a face-to-face. They more or less ignore what is being saida lot gets lost in translation, after all. They pay attention to the facial expressions and body language of the people they are talking to. And that's how they know what's going on inside a person's head - by condensing fact from the vapor of nuance.

That's the dream, then. As for the reality: there's probably something of that ilk in Second Life, but I've not yet hunted it down. The real action on the digital side is in computerised face recognition, which is alas of little use for people wanting themselves to describe faces. Early work was based, like old-fashioned anthropometry, on measuring the distance between 'anchor points' found in all faces. But as it's moved towards more statistical methods, which get results but can't be imitated by humans.
Meanwhile the police have procedures to help witnesses identify the characteristics of a face:

most composites are put together by asking a witness to describe the parts of a face -- the eyes, nose, mouth or chin -- and then assembling those pieces to create a likeness.
The popular FACES computer composite system, for instance, offers witnesses 63 head shapes, 361 types of hair, 514 eyes, 593 noses and 561 lips to choose from.

What are these part of the face? This paper contains a list, extracted from the Farkas System of facial recognition. The full list is apparently present in full only in Leslie Farkas' textboook Anthropometry of the head and face

The Visage Project seems to be an attempted online classification of faces through identifying features. The demonstration is hampered by too-small images, but the descriptions of characteristics are useful.

Another branch of work looks at the face in terms of emotions. This area was spearheaded by Paul Ekman, an anthropologist trying (with some success) to demonstrate the similarity of emotions across human cultures. His Facial Action Coding System is a means of describing facial emotion, muscle by muscle. He's spent the past decade training police, writing popular books, and even inspiring a TV series -- but nonettheless seems to be a serious and broadly respected academic. The effort required to use FACS, though, is considerable -- and it's concerned with changes in exprerssion, not with the permanent structure of the face.

Finally, there's a certain degree of scepticism about the idea of learning faces section by section. It isn't normal, you see:

Several brain studies have shown that we tend to see a face as a whole, and we pay more attention to the relationship among the parts of a face than we do to the parts themselves.
"Every cognitive scientist who has studied faces has concluded that faces are processed holistically. In fact, we now know that at least as early as six months of age, babies are engaged in the holistic processing of faces, not individual features," Dr. Wells said.
"You can take people who've been married 15 or 20 years and the husband or wife can be quite incapable of describing a single feature of the spouse's face accurately," added Christopher Solomon, technical director for a British composite company called VisionMetric Ltd.

Still, for now I'll take the facial-component approach over the alternative of recognizing friends by their hair and shoes, and becoming confused whenever anybody has a haircut.

]]>http://ohuiginn.net/mt/2011/05/how_do_you_describe_a_face.html
http://ohuiginn.net/mt/2011/05/how_do_you_describe_a_face.htmlWed, 18 May 2011 12:36:50 +0000python mode functionOddly, there seems to be no mode function in the python standard library. It feels like something that should have an optimized C version squirreled away somewhere. 'Mode' is too ambiguous to be easily searchable, alas. Anyway, here's a will-have-to-do-for-now version:

There's a strange way in which today's capitalism is repeating in reverse the early capitalism in which although workers are, in reality, wholly dependent on capitalism, they are formally - legally and ideologically - treated as independent contractors. This spurious reconfiguration of the worker as entrepreneur unites informal workers in the third world and precarious workers in the first

The peasants came with their cloth, often (in the case of linen) principally or entirely made from raw material which the peasant himself had produced, to the town in which the putter-out lived, and after a careful, often official, appraisal of the quality, received the customary price for it. The putter-out's customers, for markets any appreciable distance away, were middlemen, who also came to him, generally not yet following samples, but seeking traditional qualities, and bought from his warehouse, or, long before delivery, placed orders which were probably in turn passed on to the peasants.

This is the system which was gradually absorbed into factory-based textile production -- and with it the destruction of previous social life, and the structuring of life around the working day.

Now, as with so much else, we've taken a loop around from centralised production, and are replaying the pre-industrial system at an octave's difference. That means opportunities to recreate social life, to escape the homogenous regimentation of the factory -- but also a return to the forms of exploitation most present just on the cusp of the industrial revolution.

Hence there's plenty of reason for politicised microserfs to turn back to history, explore how the peasants of the 18th century were -- and weren't -- able to assert themselves against the putters-out.

]]>http://ohuiginn.net/mt/2011/05/still_putting_out.html
http://ohuiginn.net/mt/2011/05/still_putting_out.htmlSat, 14 May 2011 12:50:21 +0000ad-hoc webserver from the shellHere is a neat trick to make the current directory hierarchy available online:
$ cd /tmp
$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...
]]>http://ohuiginn.net/mt/2011/05/ad-hoc_webserver_from_the_shel.html
http://ohuiginn.net/mt/2011/05/ad-hoc_webserver_from_the_shel.htmlTechnologyTue, 10 May 2011 07:14:56 +0000Tatu and the IWWTatu are secretly Wobblies, aren't they? All About Us hinges on a personalization of the great IWW slogan An injury to one is an injury to all, transmuted into obsessive romance:

If. They. Hurt. You. They. Hurt. Me. Too
So we'll rise up won't stop
And it's all about
It's all about
It's all about us

It's not just me feeling the solidarity. This group review returns to the theme time and time again, albeit with a point-missing tendency to link it to the USSR:

You can imagine those pounding war drums soundtracking the Bolshevik revolution - there's certainly a similar sense of collective running through the lyrics, drawing strength from standing shoulder to shoulder with fellow revolutionaries. "If. They. Hurt. You. They. Hurt. ME. TOO.": spine-tinglingly magnificent pop moment of the year.

And more generally, you can make a case that the value of TATU is fitting their various high-pitched emotional states into a grand narrative of love and rebellion:

If you listen across their 'Best Of' album, you can see it unfold: forbidden love and ensuing confusion as the girls, through their transgression, are thrust beyond the bounds of the normative ("All The Things She Said"'); the forging of a new revolutionary ethics ("All About Us", "They're Not Gonna Get Us"); yet more confusion as one of the girls falls for a boy ("Loves Me Not"); a Thermidorian inquest into the motives and consequences of the betrayal ("Friend Or Foe"); then finally, the realisation that the only place this utopian society can exist is in space ("Cosmos")

At least nine Middle Eastern and North African state censors use Western-built technologies to impede access to online content. ISPs in Bahrain, UAE, Qatar, Oman, Saudi Arabia, Kuwait, Yemen, Sudan, and Tunisia use the Western-built automated filtering solutions to block mass content, such as websites that provide skeptical views of Islam, secular and atheist discourse, sex, GLBT, dating services, and proxy and anonymity tools. These lists of sites are maintained by the Western company vendors. The ISPs also use these tools to add their own selected URLs to the companies' black lists.

I'm interested here that no Chinese technology is mentioned as being used. This was something I'd been expecting -- as had Naomi Klein (kind of) -- but which hasn't come to pass.

]]>http://ohuiginn.net/mt/2011/04/exporting_surveillance_1.html
http://ohuiginn.net/mt/2011/04/exporting_surveillance_1.htmlMon, 04 Apr 2011 15:59:50 +0000Saudi day of rage: some quick readingIt's entirely possible nothing will happen in Saudi Arabia today. A few hundred protesters on the streets, the ringleaders arrested, and the country will continue as before.

Until this afternoon, though, nobody knows. Demonstrations have been called, and now is as auspicious a time for them as we're likely to see. But one downside of banning political expression is that you can never tell how large demonstrations will be. That, in fact, is why they matter more than under democracy -- they're about the closest you get to a vox pop.

Both Sunni and Shia Saudi opposition groups say they are under intense pressure to make a move before 11 March, but are trying to hold the line so as to garner as much media exposure as possible and secure a large turnout. 'We didn't want to go quickly, but the people took the initiative and issued a date,' one of the organisers told me. 'Now the momentum is there and there is an avalanche of calls for revolt. The speed with which things are happening is beyond our ability to keep up.'

One reason to expect a noticeable protest is because of how strongly the Saudi authorities have reacted to the prospect. After all, they presumably know more than anybody about public opinion. Then again, a strong reaction could just mark paranoia or deliberate overkill. According to Mohammad Taqi in the Daily Times (Pakistan):

The Saudi state machinery has subsequently gone into overdrive to prevent any prominent demonstrations. The regime has resorted to both appeasement through a $ 37 billion 'aid package' to the Saudi people and a series of stern warnings. The Saudi interior ministry said last week that the "laws and regulations in the kingdom totally prohibit all kinds of demonstrations

There's also much more global attention than there has been previously:

The brutal crackdown by the security forces on the Saudi Shia pilgrims in Madinah in February 2009 had largely gone unnoticed by the world. Subsequently, when a Shia cleric Nimr al-Nimr in his March 13, 2009 Friday sermon in Awwamiyya called for the Shia to consider secession from Saudi Arabia if their rights were not respected, the state suppression was swift but did not make the headlines. But now, with the full glare of media turned on to the Middle East, the last thing the regime wants is an uprising that it may have to put down brutally.

And, as this article points out, there's a certain irony to protests in a major oil-exporting country:

the more violent the unrest, and the closer it is to the oil wells, the higher that it sends prices. As prices rise, so do the contested autocrats' paychecks. Meanwhile, their bank accounts swell and they are enabled to pacify their citizens by loosening the strings on public spending. It is like brainwashing citizens into oblivion by keeping their stomachs full and their minds numb.