[1+1=2]

OneAndOneIs2

Mon, Jun 10, 2013

[Icon][Icon]Nothing to hide?

• Post categories: Omni, Rant, In The News, Technology

It's been hard to *not* hear the news that it's been confirmed that the US government has been spying on Internet traffic; obtaining data from such heavyweights as Google, Apple, and Facebook; and doing so under a massive cloak of secrecy.

Naturally, a whole bunch of people, all over the world, have responded with "Why should I care? I have nothing to hide."

And I have a lot of sympathy with that viewpoint, if I'm honest. Do I care if anyone, be they government or corporation or basement-dwelling hacker, can see everything I've put into Facebook?

No.

I've always maintained that only a total idiot considers Facebook anything other than public domain, so nothing I've put there is anything I'd cry about being made know to people I haven't Friended.

So I can put my hand on heart and say I have nothing to hide. But that doesn't mean I don't think we should care about the privacy invasion. Because the "nothing to hide" attitude hides a problem, and that is that it's an answer to the wrong question.

The "nothing to hide" contingent make a very bad assumption: That privacy consists of nothing but the option to hide things. And that you only need to hide bad things. You can highlight why "I have nothing to hide" doesn't equate to "I don't need privacy" with some simple questions: "Why do you have curtains?" or "So can I install a video camera in your bathroom?" or "Great, so I can put copies of your credit card statements online?"

But hey, we're not talking about petty criminals or the unwashed public having that kind of access to you. We're talking trusted government officials with Top Secret clearance. So those questions don't count, right?

Sadly not: For starters, I've lost count of how many stories there've been in the last few years about government servers getting cracked; unsecured laptops left on trains; passwords published... you really can't assume that any governement *can* keep your secrets, let alone that they *will*

But it's the *attitude* behind this massive invasion of privacy that's the danger. It shows that the people in power are only thinking of privacy in terms of "something to hide", and this attitude is becoming pervasive in the population as well: Only people with something to hide can possibly be wanting to maintain privacy, and only bad people have something to hide.

So first let's debunk that privacy is only needed by "the bad guys" and then think about whether or not the people in charge should be given an exception to a "right to privacy"

Let's imagine today's world with all right to privacy removed. Not just the usual "Facebook and Google know all about your Internet habits" but a genuine, absolute abolishment of privacy. And let's assume that you're someone who honestly has nothing to hide.

Let's imagine a dating site. Here's two interesting facts about dating sites: Nearly half of single Americans have signed up to a dating site; most of them wouldn't admit to it when asked in public.

So there's our first "I want privacy" moment already - even being *on* a dating website is something most people don't want everyone to know.

But now let's go further. Usually, dating websites have a certain amount on anonymity. Your real name, your address, your email, your phone number - you're advised not to give any of these out until you've gotten to know someone reasonably well first.

But privacy has been abolished. So now all dating websites give out all that data and more besides. To everyone. So everyone on that dating site knows who you are. They know where you live. They know how much you earn. They know your Facebook profile. And they can access all of it. So instead of looking at that flattering photo you carefully chose to put on your dating site profile, they can go look at all the photos of you on those wild parties. They can see the photos of you with your exes. They can see everything.

But that's not all. They can take a look at your medical history, too - that's no longer private. Every medication you've ever taken, every illness you've ever had. Ever suffered from depression? An STD? Do you have an inheritable genetic disease? They'll know about it if so.

They can see your google account too. And they can use it to review your search history. Every search you've ever made. Ever searched for porn? Erotic fiction? They can see all that.

Hey, they can check your browser history too - so if you've been watching kinky stuff on Redtube or reading exotic slash fiction lately, they can read all about it.

They can check your bank balance. They can review your credit history. In a world without privacy, no matter how clean-living you are, anyone, anywhere, can see EVERYTHING about you.

That's what loss of privacy really means. Everything in that description is completely feasible and could be implemented with today's technology - the only reason people can't read all about you is that it would be an invasion of privacy, and that's still considered a bad thing.

That's what people are fighting to protect when they argue for a right to privacy - not for an ability to hide bad things that they're doing; but for the right not to have every detail of our lives be available to anyone who wants to look.

Imagine a world without privacy. Can you honestly say you want to live in that world?

I don't.

So let's say that we should have some expectation of privacy. And let's imagine that the government really is able to keep data secure from the rest of the world. And let's imagine that they have carefully-vetted agents who only ever invade our privacy when they have legitimate reason, for the greater good.

Should they be able to grant themselves that ability?

I'm going to argue that they shouldn't, and I'm going to justify it with a slightly unusual approach for an Englishman.

I'm going to use the American Constitution.

I don't believe that there will ever be a British or even English Constitution. But I do believe that there should be. Because the US Constitution was a remarkable document, for a reason that gets downplayed and forgotten more every day.

That reason is simple: In a world that had previously always considered rights to be something given to people by their all-powerful government, the constitution instead framed rights as something that all people had, that could not be taken away by the government that they allowed to rule them.

The purpose of the Constitution was not to grant the government power, it was to limit it. People had rights that nobody could take away. That's an amazing thing.

Of course, it's very inconvenient if you ARE the government, this annoying document that says you can't do things that you want to do. If you can't remove or reword a document, then what you maybe CAN do is change the meaning of the words it uses.

When you read the Constitution, you get the impression that the authors considered "freedom" and "liberty" to be pretty much synonymous. In fact, "liberty" seemed to actually be the more important - the preamble doesn't mention freedom, it says the purpose is to "secure the Blessings of Liberty". It goes on to one of the most-quoted passages: "We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness."

"Liberty". Not "Freedom".

Funny, that - you hardly ever heard an American use the word "liberty" these days unless talking about the statue. "Freedom" is everywhere. Land of the Free. Freedom of speech.

Why the shift? What's the difference between these two words?

What's the dictionary say?

lib·er·ty - The state of being free within society from oppressive restrictions imposed by authority on one's way of life.
free·dom - The power or right to act, speak, or think as one wants without hindrance or restraint.

Isn't that interesting? "Freedom" means "doing what you want. "Liberty" is more specific, it's about freedom *within society", freedom *from authority*

Being at liberty means being free from the government. And liberty is a word that really is fading from common use. And so is the concept it defines.

The American Constitution, a remarkable document that takes power away from the authorities and puts it into the populace, talks about liberty a lot. The average American does not. The average American would be surprised if you were to point out that the Constitution exists not to define, but to limit, the powers of their government.

Liberty is important. Privacy is important. If you don't have privacy from the governement, you don't have liberty. By definition.

You think that you can have liberty even if the government can know everything about you?

I suppose, strictly speaking, you can. But the trouble with theory is, it only works in theory.

No government goes to all the time, effort, and expense of gathering all that data if they aren't going to do anything with it. The whole point of gaining knowledge is to use it.

You don't think that's bad?

What if the threat of terrorism worries you enough to do some research about bombs? What if the goverment sees that you're been reading about bombs and decides that that makes you a terror threat? What if you get put on a no-fly list because you're a terror threat? Banned from leaving the country?

What if you happen to go the the garden center and buy some fertilizer the day after after going to a history museum? Today, nothing. Tomorrow.. maybe a computer program will put two and two together, realise that the formula for gunpowder was on display in the museum (Sulphur, carbon, and saltpeter (nitrates), FWIW) and that the fertiliser you just bought is a huge stack of nitrates that can be readily combined with the charcoal you have stacked up for the next barbeque in order to make a very effective bomb?

Even more likely and harder to prevent: What if they simply make a mistake, and data that isn't yours makes it into your records? As somebody who writes software for a living, I can tell you that there's no system on the planet that I'd trust to be so infallible with its data that I'd trust it with decisions that could ruin a person's life.

How do you fight a decision that was made behind closed doors, based on data gathered about you that you know nothing about? How do you challenge data that you don't access?

And don't go thinking "That would never happen, I trust our government and/or legal system more than that" - These are problems that people are struggling with even today - charged with crimes on the basis of evidence they aren't allowed to see. How much worse do you think it will be when the data is top-secret, and generated by fitting together hundreds of tiny pieces of data via some algorithm so complex that a PhD would be puzzled by it?

How would you even begin to get your life fixed when a computer somewhere decides you're a threat?

I don't know how I would. And I'm a lot more computer-savvy than the average person.

Governments can talk about "nothing to hide" and "need to know" and "only the guilty" as much as they like.

But privacy is important. And given its ability to completely ruin your entire life, your right to keep things private from the government is not some tiresome necessity enshrined in an annoying bit of paperwork that we'd be better off without. It's one of the most important rights you have, and you must not be misled into thinking that it's just an argument about what you have to hide.

 

Thu, Jun 06, 2013

[Icon][Icon]Learning, interrupted

The trouble with the human brain is, like Haskell, it makes a virtue out of laziness.

It doesn't want to put any effort into remembering boring, unnecessary things. So if something seems unimportant, it gets lost. And if it's easier to remember where to look something up than it is to just remember it, then that's what your brain will do.

Seriously - look up "memory offloading"

I'll bet there's loads of things people could ask you that you'd answer "I don't remember, but I know it's in this book/wiki page/google search"

This is all well and good for many things, but it's a PITA when you actually do want things to stay in your brain instead of just filing a reference to it.

I find this to be a big problem with learning new programming languages. I can get so far into a book, but then life interferes and it's a while before I can get back to it, and in the meantime I've forgotten damn near everything other than "It's explained in that book"

Haskell, C, Perl, Zsh, Javascript.. I have books on all of them. I've lost count of how many times I've started reading LYAH, I have to restart it every time I come back to it because the syntax just doesn't stay in my head. What does foo . bar . baz $ boo mean? When I come back after a month away, I have no more idea than my cat.

This makes it very hard to make progress - life means interruptions, and interruptions means forgetting.

I needed to find a way to stop forgetting if I wanted to get anywhere.

I tried taking copious notes. But if you don't keep reviewing the notes, you forget them - your brain just remembers "Oh yeah, I made a note about that". And if you DO review them, you get bored of them and stop bothering. And then you forget them.

I tried mind maps, coding exercises, code examples.. nothing worked.

And then I tried a flashcard program.

Win!

It's exactly the same process as making notes, only instead of writing them on paper, you write them on your computer in Q&A format.

And then every day, you run through them.

Still sounds like notes, right?

The advantage is, you only get prompted with the questions you're likely to need reminding of - each time you get a question, you get to say how easy to remember it was. And the better you remember, the longer you go without a prompt. So instead of pages and pages of notes where you have to wade through all the stuff you know to find the nuggets of useful stuff you've forgotten, you just get a few questions to refresh your memory each day.

And if you miss a day, you just catch up the next day.

Simple.

I went with Anki - runs on Linux, and has a free app for Android. Which meant I could read my ebooks on my PC and make the new cards with a decent keyboard, then sync to the cloud and review on my phone or tablet.

And it works really well. I didn't realize how well until I skipped ahead on my book about C to read about threads, and realized a few days later that I couldn't remember a single thing about it. And then remembered that I had skim-read instead of doing it properly, and had not made any cards yet. I could remember everything else in the book - signals, forking, sockets, pointers - without issue. But threads? Nothing. Not one single fact could I tell you about threads, other than "They're covered at the end of the book."

Flashcards make it so quick & easy to learn that I almost fail to notice I'm using them; but the difference between stuff I've read and stuff I've made cards about is night & day.

Even though I haven't had a chance to look at LYAH in a fortnight, courtesy of the prompts from Anki I can easily tell you that the . does function composition and the $ does function application with the lowest precedence. Which means when I next get time to read some more pages, I don't have to revisit the stuff I've already read to relearn it - I can just get on and learn the new stuff.

If (like me) you've suffered too many times from the pain of "I used to know this.. but I can't remember it any more" or "I wrote this down somewhere, let me drop the task whilst I go hunting through my notes for the vital clue" then I thoroughly recommend giving something like Anki a try.

It's free, and it makes your brain infinitely better at handling interrupts.

 

Mon, May 27, 2013

[Icon][Icon]The helpful thing about Linux..

• Post categories: Omni, FOSS, Technology, My Life, Helpful

There I was, sitting down and browsing Hacker News via my tablet from the sofa at the end of a long day. And then my housemate asks me to play a video on my PC.

A common occurrence - a bit of background noise is nice in our otherwise-very-quiet house, and my PC seems to have wound up with the largest repository of videos on it.

Thing is, my PC was locked and I was comfy on the sofa...

Well, I did have a tablet..

I don't actually remember my PC's IP address though.

...but I *do* have a permanent reverse tunnel set up from my virtual server so I can access my home PC from work.

Hrm...

So I SSH to my server, and hunt through my history to find the port that'll take me to my home PC. Find it, connect to it, bam! I'm logged into my PC.

First problem: Screensaver is running. Can't remember offhand if it's gnome-screensaver or xscreensaver

$ ps aux | grep screen
dominic  17958  0.0  0.3  39980  8204 ?        Sl   20:14   0:00 /usr/bin/gnome-screensaver --no-daemon

Okay, it's gnome-screensaver. I wonder if it can be as simple to get around as..?

$ kill -HUP 17958

Oh look, my blank screens have just woken up.

Okay, I need to launch an application that'll output to my X session. I think the syntax for that is:

$ export DISPLAY=:0.0

But I'm not certain. Let's try something simple:

$ xterm

Ooo.. I have a new xterm!

Awesome!

So now I just have to find the video file I want and

$ vlc Series_18_Episode_2.avi

and the video starts playing!

And all without having to install any PC-controlling app, RTFM or get my arse off the sofa.

Let's see you do THAT with Windows :P

 

Thu, May 16, 2013

[Icon][Icon]Quicksort golf

• Post categories: Omni, FOSS, Programming

I was going back over LYAH recently, and I came across the bit about Quicksort and how it's something of a poster child for Haskell because most other languages need 10+ lines of code to write it, whereas in Haskell you can do it in just a couple.

It didn't look like something that should need all that much code in Perl either, but a quick Google showed only some fairly enormous examples.

So I had a quick try, basically just re-writing the Haskell example into Perl. Which has no list comprehensions. But it does have map and grep, which accomplish much the same thing.

Here it is:

sub quicksort {
    my $array = shift;
    return [] unless (@$array);
    my $head = shift @$array;
    return [    @{ quicksort([grep { $_ <= $head } @$array])},
                $head,
                @{ quicksort([grep { $_ > $head } @$array])}
                ];  
    }   

And an example usage:

my $result = quicksort [10,2,5,3,1,6,7,4,2,3,4,8,9];
$, = ',';print @$result,"\n";

$ ./qs.pl 
1,2,2,3,3,4,4,5,6,7,8,9,10,

So, four lines of perl. You could get it down to three if you just used $_[0] instead of assigning it to $array, but I suppose some might say that the greps should be counted as a line of code each. Still only half a dozen lines tho.

I don't see what all the fuss is about :)

 

Mon, May 13, 2013

[Icon][Icon]Git prompt: Tell me more

• Post categories: Omni, FOSS, My Life, Programming, Helpful

tl;dr - The Bash __git_ps1 git prompt does more if you set a few environment variables

If you're a command-line devotee, you'll be aware of tab-completion.

And if you're a git user, I really hope you're aware that it comes with its own tab completion files, which allows it to auto-complete not just commands, but branch names and other such helpful things.

If you're not, you'll find it in git's contrib/completion/ directory. If you're a bash user, copy the git-completion.bash script to /etc/bash_completion.d/git

The nice thing about this script is that it also comes with a helpful functionality that you can insert into your PS1 - the environment variable that defines what your command prompt should look like.

To add this, add the string \$(__git_ps1 \"(%s)\") to your $PS1:

djh@devel $ echo $PS1
\u@\h $
djh@devel $ export PS1="\u@\h \$(__git_ps1 \"(%s)\")$ "
djh@devel (develop)$ echo $PS1
\u@\h $(__git_ps1 "(%s)")$
djh@devel (develop)$ 

And yay, I now have the current branch on display in my command prompt!

There's more to it than that - the prompt also tells you when you're in the middle of a rebase, or a merge; it shows you when you're in a detached head state.. all kinds of things.

All this is pretty well known, and most git-and-bash users know about and use this stuff. (Zsh users typically seem to have their own bewildering variety of all-singing, all-dancing, multi-coloured git PS1 functionality)

But what I didn't know until this weekend, when I trawled through the source code (don't ask) is that the humble Bash git prompt actually offers a little more functionality than you might think - functionality which wasn't mentioned in any of the guides I used to set up the PS1 prompt.

Because there's a few environment variables that you can define which will add to the amount of info displayed by the prompt:

  • GIT_PS1_SHOWDIRTYSTATE
  • GIT_PS1_SHOWSTASHSTATE
  • GIT_PS1_SHOWUNTRACKEDFILES

If you set these vars to a non-empty value, you'll get (respectively):

  • a * when there are unstaged changes, and a + when there are staged changes
  • a $ when there are stashed changes
  • a % when there are untracked files present

Thusly:

djh@devel (develop)$ export GIT_PS1_SHOWDIRTYSTATE=1
djh@devel (develop *+)$ export GIT_PS1_SHOWSTASHSTATE=1
djh@devel (develop *+$)$ export GIT_PS1_SHOWUNTRACKEDFILES=1
djh@devel (develop *+$%)$ 

(Yes, I had a rather dirty checkout at the time of writing :)

I'm giving serious thought to writing my own Git prompt in C, that'll show me other such useful things as the number of staged/unstaged/untracked files - more as a learning exercise than out of any belief that someone else hasn't already done so.

But in the meantime, this is a surprisingly helpful addition to what I always thought of as a brilliant, but somewhat bare-bones, bash function.

 

:: Next >>

[Links][icon] My links

[Icon][Icon]About Me

[Icon][Icon]About this blog

[Icon][Icon]My /. profile

[Icon][Icon]My Wishlist

[Icon]MyCommerce

[FSF Associate Member]


June 2013
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search

User tools

XML Feeds

eXTReMe Tracker

Valid XHTML 1.0 Transitional

Valid CSS!

[Valid RSS feed]

powered by b2evolution free blog software