Friday, September 26, 2014

shell-shocked: Updaing bash on Linux Mint Olivia

shell-shocked: Updaing bash on Linux Mint Olivia

I've go some old laptops running Linux Mint, Olivia release, based on Ubuntu Raring Ringtail which is not a long term support, and so no ready fix is available.

The bug is shown with this test
rm -f echo ; env X='() { (a)=>\' bash -c "echo date"; cat echo
bash: X: line 1: syntax error near unexpected token `='
bash: X: line 1: `'
bash: error importing function definition for `X'
Fri Sep 26 09:37:44 BST 2014
which wrongly creates a file called echo holding the output of the date command.

Here is what is required to fix the bash shell-shocked bug.

1. Update the no-longer supported repositories to the new location:

(You should already have done this).

You first need to make sure you have src-deb repositories enabled:
cd /etc/apt/sources.list.d/ 
test -r official-source-repositories.list ||
cp official-package-repositories.list official-source-repositories.list &&
sed -i -e 's/raring/trusty/g;s/^deb /^deb-src/' official-source-repositories.list
And then update the server to old-releases:
sed -i -e 's/\|' official-package-repositories.list
apt-get update

2. Install all updates for your system anyway

apt-get update
apt-get upgrade

3. Build bash from the trusty sources

apt-get build-essential bash
apt-get -b source bash

4. Install bash

dpkg -i bash*deb

5. Test the fix

# rm -f echo ; env X='() { (a)=>\' bash -c "echo date"; cat echo
bash: X: line 1: syntax error near unexpected token `='
bash: X: line 1: `'
bash: error importing function definition for `X'
cat: echo: No such file or directory

Monday, September 1, 2014

Corollary to Hanlons Razor

Hanlon's razor is an eponymous adage that allows the elimination of unlikely explanations for a phenomenon. It reads:
Never attribute to malice that which is adequately explained by stupidity.

The corollary is: The malicious will hire stupid fools to do their bidding.

Which then leads to: The first rule of choosing a a good stooge is to find one who for reasons of his own already wanted to do whatever it is you were to ask.

And therefore: Watch out for those who appoint stupid fools without a sound justification

More obfuscated C

Who can work out what this is for:

//* */ 1

and in what language(s) would it be useful?

Tuesday, August 26, 2014

Obfuscated C

sizeof a++ does not modify a

Unless of course sizeof has been #define'd.

And don't forget that there is a difference between:
#define sizeof ...
#define sizeof(x) ...

Oh, the possibilities...

Google TV & Movies DRM on Mint/Ubuntu

Google Play Movies & TV works best under Chrome on Linux, but unless HTML5 is working for you, Flash is needed for playback and DRM Flash playback requires the long since deprecated HAL.

Fortunately an updated HAL is maintained for this purposes. The hal ppa is at:

Most of these details are thanks to Justin Watt at who says:

sudo apt-get install hal
cd ~/.adobe/Flash_Player
rm -rf NativeCache AssetCache APSPrivateData2

I wonder

I wonder

I wonder where I'm going
andI wonder where I've gone,

I wonder what I'm doing here
andwhen I'm moving on

I wonder when I'm going
asI think on where I've been

I wonder what I'm going for

whatever can it mean:

This coming and this going

from there and place to place

whatever do I do it for;

I know it's not a race

I wonder what I'm doing

what I'm here for anyhow

And does it really matter

If I don't do it now?

I know it has a reason

but what that is I don't know

I've tried to find out all my life

I have to find out so —

I'll remember where I'm going
andI'll know just where I've been

I'll know quite what I'm going for
andremember what I've seen

 (c) 1991 Sam Liddicott
I found this a bit sickly at the time and my view hasn't changed much in the last 23 years. verse 2 and 3 were scribbled through but I've included them here.

Inspired by mission transfers; and the first couple of minutes of this video:

The next wonder poem

The next wonder poem

Sometimes I'll wonder
&sometimes I'll won't,
&sometimes I'll wonder
why sometimes I don't

And when I sometimes wonder
Why I'm sometimes won't
I'm sometimesing wonder
how I still am.
nothing at all.

(c) 199x - 2014 Sam Liddicott