Monday, June 25, 2012

Give me spaaaaace!

More on my Raspberry Pi experiences. 

On the default disk image of Debian recommended by the Raspberry foundation, after install the VNC server as described in my previous post, you're left with just shy of 300MB of disk space to play with. This seems measly when you're used to talking about how many GB free space a disk has.

So what can we do about it without plugging in more *stuff* to my lovely little minimalist Pi? The answer is ... mount a network drive from the PC that acts as a file server and first-stage backup server to the rest of the house!

I have a Projects folder on my desktop, where I keep any coding ... well... projects, funnily enough. The drive that contains that folder has plenty of free space (about 200GB as it happens), so this is just fine for my purposes today.
  1. First up, create a share in Windows, with Guest as the Co-owner (yes, i know I could create a Pi user on my box, but I'm feeling lazy at this stage)
  2. Now ssh or VNC and open a terminal session on the Pi.
  3. run "sudo mkdir /mnt/projects"
  4. run "sudo vi /etc/fstab" and add the lines as follows

Contents of /etc/fstab:

# these lines exist already
proc            /proc           proc    defaults        0       0
/dev/mmcblk0p1  /boot           vfat    defaults        0       0
#/dev/mmcblk0p3  none            swap    sw              0       0

# this is the new line:
//192.168.0.5/Projects /mnt/projects cifs user=guest%,uid=1000,gid=1000

Notes:

  1. "192.168.0.5" is the IP of my PC - I would use the named UNC path, but I have Virtual Box on the machine too, which is advertising another address under the same name, that just seems to confuse Samba on the Pi.
  2. "Projects" is the name of the Windows share
  3. "/mnt/projects" is the director where the files will appear on the Pi
  4. "cifs" is the type of file system
  5. "user=guest%" indicates we're logging into Windows as guest, with no password (I know, I know, even a private network needs security, I leave this as an exercise for you, the reader)
  6. "uid=1000,gid=1000" tells the file system to be owned by the "pi" user and group on the Pi, so we can read & write to the files without needing to "sudo" all the time.
Pretty simple really. And because I've used SyncToy on the windows folder to contribute any files from the Projects folder into my backup drive (external USB) and then into my DropBox account, anything I write from the Pi to /mnt/projects will automatically be double backed up every night. (Afterall, any data that you don't have at least two copies of is data that you don't care about, n'est pas?)

Addendum

I just added a similar line to "/etc/fstab" for an 8GB pendrive in the unused USB socket, to give me more, local, faster space:
#pendrive
/dev/sda1 /media/usbstick vfat rw,uid=1000,gid=1000
(remembering to create the "/media/usbstick" directory first)

Sunday, June 24, 2012

Running a Raspberry Pi in headless mode.

I have just bought a Raspberry Pi micro computer (and boy do they mean 'micro'). It's a neat little computer about the size of your credit card. However it is a bare-bones system with no keyboard, mouse, monitor or hard disk. So what do you need any of them for? Well, with the Pi, you can get away without any of them, except you do need an SD card to act as the hard disk.


My problem is that I don't have an HDMI monitor or a TV in my study, where I want to use my Pi. And I can't be bothered to wait for an adaptor to connect the Pi's HDMI socket to one of my VGA or DVI flat panels. So what am I going to do? Well, a mate of mine solved this problem by using VNC - a remote desktopping solution that I already use at work. The other problem is that I'd really rather like to reduce the cabling required for my Pi even further and do without the heavy-weight LAN cable ... I know, I have an Edimax EW-7711UN wireless dongle that I bought ages ago when my ethernet-over-power failed. I wonder if that will work with the Pi?


So, my aim is a full-screen Pi with no monitor, accessible from my desktop PC, via my domestic wireless network - so I can put the Pi anywhere with power and a wireless signal in the house, and use it as the company intended: X windows on a proper screen.


Here's how I did it.



(Creating the hard disk image on an 2GB SD card I'll leave to other people, because they've done just fine.)
The image of Debian for use with the Pi comes with a an option to enable SSH (secure shell) access to the machine via the LAN cable, so that's where I started:

  1. mount the SD card with a PC card reader, rename "boot_enable_ssh.rc" to "boot.rc" to enable SSH
  2. plug the card into the Pi, connect the LAN cable and power, and boot without a monitor connection
  3. login with pi/raspberry
  4. use "passwd" to change to a real password
  5. run "sudo apt-get install tightvncserver" to install VNC server
  6. run "tightvncserver" and set a password
  7. run "tightvncserver -kill :1" to stop VNC server
  8. run "sudo bash" to elevate to root
  9. create "/etc/init.d/vnc" as below to start VNC server at boot time
  10. run "chmod +x vnc" to make the script runnable
  11. run "update-rc.d vnc defaults" to install the above script for boot
  12. run "aptitude install firmware-ralink wireless-tools" to get the wireless networking tools for Debian
  13. run "aptitude install wpasupplicant" to get the wireless security support for Debian
  14. attach the Edimax 7711 dongle to a usb socket
  15. run "lsusb" to ensure it's powered up and listed
  16. edit "/etc/network/interfaces" as below to boot the wireless card at boot
  17. run "ifup wlan0" to test your configuration - you should get an IP address - write it down.
  18. remove the LAN cable, and reboot 
  19. now you can login via the new IP address via VNC or SSH.
This is my Pi in action: notice the lack of spaghetti cabling so common in other configurations ;-)


I have got a powered USB hub on the way, so that will add another cable to the above, but actually, I'm not sure it'll be needed afterall.

/etc/init.d/vnc:

### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO


#! /bin/sh
# /etc/init.d/vnc


USER=pi
HOME=/home/pi
export USER HOME
case "$1" in
    start)
        echo "Starting VNC Server"
        #Insert your favoured settings for a VNC session
        su - $USER -c "/usr/bin/vncserver :1 -geometry 1280x1024 -depth 24 > /tmp/vncserver.log 2>&1 &" &
    ;;
    stop)
        echo "Stopping VNC Server"
        /usr/bin/vncserver -kill :1
    ;;
    *)
        echo "Usage: /etc/init.d/vncboot {start|stop}"
        exit 1
    ;;
esac
exit 0

/etc/network/interfaces:

# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo wlan0

iface lo inet loopback
iface eth0 inet dhcp
iface wlan0 inet dhcp
        wireless-essid YOUR SSID
        wpa-ssid YOUR SSID
        wpa-psk "YOUR NETWORK PASSWORD"
There are probably ways to encrypt the network password, but I've not figure them out yet.

Monday, May 14, 2012

A little time for Tesla

I know it's the Oatmeal, I know their comics are full of all sorts of nonsense and silly humour (okay, I like that kind of thing), but this comic by the Oatmeal is seriously good:

http://theoatmeal.com/comics/tesla

tl;dr? Nikola Tesla was the awesome genius that made the modern world possible, Edison just knew where the patent office was.

Friday, January 20, 2012

A proper apology!

It's a long time since anyone from Holywood actually impressed me, but today Mark Wahlberg gave an apology for some stupid remarks he made in a magazine interview (http://www.bbc.co.uk/newsbeat/16627609) and here's the important part: "I deeply apologise to the families of the victims that my answer came off as insensitive. It was certainly not my intention." (my emphasis).

Far too many people's apologies replace the work 'that' with 'if'. They just don't get it. If you've offended someone, you're the one at fault, you're the one apologising... so apologise. Don't imply that the offended party are at fault for being sensitive (as suggested by the use of 'if').

Re-read the above apology with 'if' and you'll see what I mean.

Thursday, January 27, 2011

Cancellation of Nimrod MRA4

Wow, a Tory government has actually cut something from the UK defence budget that it actually made sense to cut: http://www.theregister.co.uk/2011/01/27/nimrod_scrappage/ (not that that makes it any more likely that I'll ever vote for a Tory candidate at an election should I ever have the misfortune to live in the UK again).

Saturday, August 14, 2010

Property developers threaten globally important seed bank

This could be a very bad sign for our future as a species when even the highest authorities in a major country (in this case, Russia), with all the information we currently have on climate change and decreasing global bio-diversity, to put the interests of a property development company (the-scientist.com) above those of a globally significant seed bank outside St Petersburg (BBC).

(Summary: the Pavlovsk experimental station is a seed bank of thousands of unique plant varieties that grows on a 70 hectare plot outside the city of St Petersburg, and Russia's Supreme Arbitration Court has given rights to build on the land to the Russian Housing Development Foundation, which will destroy nearly 100 years of work to preserve this globally significant resource to build houses)

Pass this on, and pass it up ... to your MP, your senator, your governor, to whatever representative you have available at a political level that can apply pressure to the St Petersburg authorities to save the seed bank.

Wednesday, August 11, 2010

Scottish Crannog Centre

A crannog is a round-house on an artificial island constructed on wooden pilings or stone in a loch or lake. They are almost exclusive to Scotland and Ireland, where there are significant networks of interconnected waterways. There is only one known in England. European lake dwellings tend to be multiple buildings on square platforms.

Last week, I visited the Scottish Crannog Centre at Kenmore (Loch Tay), near Pitlochry, with my family (wife and two teenage daughters), and I would thoroughly recommend the place to anyone with an interest in pre-Roman civilisation in the Celtic parts of Europe. The reconstructed crannog at the Centre is based on the Oakbank Crannog which is just along the loch-side from the Centre. Oakbank was occupied for around 200 years around 2,500 years ago (over 500 years before the Romans darkened British doors). Crannogs were in use from around that time right up until the 16th or 17th Century A.D.!

There's a good exhibition of materials about the distribution of crannogs around Scotland, and about the relatively new field of underwater archaeology. This is followed by a guided visit to the reconstructed 10m diameter crannog on the lake (reached via a wooden walkway). I would have liked to have been able to spend more time on the crannog itself, but the next group of visitors was waiting with their guide. Once back on the lake-side, our guide gave us demonstrations of some of the technologies and crafts available to the crannog-dwellers. (Including hypothesized lathes, techniques for making holes in stones, drop-spinning, the use of a saddle quern for grinding wheat, and fire-starting) - we could have a go at all of these too.

Being as this is a tourist site, there is a shop - but it's a good one, with no kilt towels nor the excessive bagpipe music you usually find in Scottish tourist-trap shops.

The staff were excellent - knowledgeable, engaging, and genuinely interested in talking to the punters. Our excellent guide was Rachel, and we also chatted with Dirk for a while after our tour.

The roads around this part of Scotland are a bit narrow and twisty - even compared to home on the Isle of Man, so be aware it takes time to get places. However, it is well worth the effort of going to the Scottish Crannog Centre. It's open 10am - 5.30pm between April and October (off-season visits by appointment).

We intend to return in a couple of years to see what else they've discovered and developed on the site. Yes, even my teenage daughters agree.

Update: here are the photos.

Friday, July 16, 2010

Bionic Legs now an achievable reality

My great uncle Ken was an inventor. Not one you've heard of, like Edison or Dyson, but one of the little guys who invents practical aids for people with disabilities. Unfortunately he died suddenly on the operating table in 2005. That was a shock and a shame at the time, for all the obvious reasons.

Today I discovered something I'm sure uncle Ken would have been very impressed to see: http://www.gizmag.com/rex-robotic-exoskeleton/15736/. And there's a video of the device in use too:

Robert Irving and Richard Little deserve every success with this device. It may not be fast, but it is clearly a device that has enormous potential, and I'm sure REX 2, when they build it, will be stronger, faster and lighter.

Well done guys.

Wednesday, July 07, 2010

How good a photographer are you really?

For my 40th birthday last October, I received sufficient cash to finally indulge one of my minor ambitions of the last 10 years: to go from film SLR to digital SLR photography. So I bought myself a cheap Sony dSLR, an α200K. Then at Christmas, I added a Sigma 70-300 lens. Nothing showy or pricey, just enough to learn the ropes. I already had my tripod so I don't count that as new expenditure, but even so, I've spent over £400 on kit!

I joined flickr.com, as you can see from the left side-bar. I even paid for a 'pro' account (primarily so that I can upload my photos fullsize), and I don't regret it.

Then I found the Sony α group and started reading their forum. Guess what, about 60% of the posts appear to be 'what new kit should I buy to shoot X' (where X is some broad category of work, like sports, or nature, or sunsets), and most of the answers are: spend £hundreds (at least) to get some specialist lens, filter system, tripod, or even a new camera body, like the α900, at around £2,000 for the body alone - no lens!

Now comes the complete antidote:
Firstly, of course, they're using amazing pro lights (most of the time - except for two $50 floods from Lowes), a studio space, a great model and so on, but at the center of it all is an iPhone 3GS, and an excellent photographer.

You really, really, really don't need all that fancy kit the 'pros' and the shops tell you (sounds like the audio-extremophile stuff I was writing about a few years ago). Yes, you need great conditions, and in a studio, that means loads of light, but it seems that the old adage: "cameras don't take photos, people do" is as accurate as ever, if not more so.

Sunday, May 23, 2010

Sense About Science

Bear with me... I'll get to the title of this posting in a moment.

I was reading my RSS feeds on Bloglines.com as I do every day and I came upon feed item that pointed me to a Slashdot.org posting about the death of Martin Gardner (a great writer about science and maths - I had one of his excellent books when I was 16, but seem to have lost it now). This lead me, as many interesting things do, to James Randi's post on the same subject - they were close friends apparently. And finally we get to the subject of this post: there was a small link at the bottom of James Randi's blog for a site called 'Sense About Science'.


I must admit, I'd never heard of these folks before, but just had to link to them from here because I completely agree that scientific debate must be free of 'he-said, she-said' argument and the chilling effect of the threat of libel action being taken when two scientists disagree. Just think what would have happened if British Chiropractic Association had won their case for libel against Simon Singh (what a coincidence: the Sense about Science guys were also supporting Simon Singh). Would you want to try to de-bunk bad science if the supporters of the bunkum could silence you with a libel suit? Can you afford to get caught out like that? Of course, this works both ways. If we want to be able to de-bunk poor science, we have to allow what we think of as poor scientists to question the science we judge good. However, the key difference between good and bad science is that good science is supported by independently, objectively reproducible proof, where poor science tries to hide behind waffle and important sounding names.

So there you have it, a trail of internet wanderings: from RSS feeds to a rant about the importance of free science. And there ends the lesson for today. ;-)

Friday, March 26, 2010

Moving (backwards) with The Times

The Times and the Sunday Times are about to make a seriously retrograde step. They are about to throw up a paywall around their news services. Now the BBC report only says 'charging to access their websites', so there's no direct indication whether News International intend all their content to be behind the wall, or just the articles (as opposed to the headlines), but either way, this is an idiotic decision.

If, and boy is that a big if these days, the Times and the Sunday Times were the only sources of (reasonably) trustworthy news (and thereby hangs a much more complex tale!) on the internet, then moving their content behind a paywall might entice people to spend money getting access to that news, but the reality is significantly different from that. I can state, with a pretty high level of confidence, that I've not needed to go to the Time nor the Sunday Times in many years. I've not wanted to go there either, for just as long. In fact, I don't think I've even bothered going there in at least 12 months, and even if I did, it was only because I found the news somewhere else, and happened to click through to their sites. (So much for the 'aggregators are stealing our content' argument - I'd never have gone to their sites in the first place if it weren't for said aggregators!)

Now, I'm not suggesting that my pattern of usage (or lack thereof) of the News International sites is normal, but I bet there are many, many, many thousands of regular users of the internet in the British Isles that somehow manage to avoid using the Times and the Sunday Times with very little effort, and very little loss to their understanding of the world. In fact, given the nature of some of the other titles in the NI stable (the Sun and the News of the World - two rags that push a particularly atrocious example of the UK equivalent of a red-neck world view), I'm sure many people are better off getting their news elsewhere.

There are so many free alternatives to NI sites, that they are simply wasting their time.

Goodbye, the Times and the Sunday Times, you won't be missed.

Friday, January 29, 2010

Freedom to mis-represent the truth?

If ever we needed proof of the scant regard for the truth as exhibited by British newspapers, here is an excellent example from that bastion of press honour, The Times.

Chew on that, Mr Murdoch!

Monday, January 25, 2010

Are you going to the wedding?

I don't normally do this, but I though this video was so excellent I had to include it:

Saturday, January 23, 2010

Hopefully this is a better looking stitching together of the previous panorama. However, it's quite dark at the left end, and a a bit over-exposed at the right end as a result of trying to even out the colour throughout.

Douglas Bay, Isle of Man

Saturday, January 02, 2010

Panorama of Douglas Bay

This is a panorama of Douglas Bay, Isle of Man. I took it from the end of the Victoria Pier, and the Tower of Refuge just nicely fell into the center of the image.

The original image is some 24,800 by 2,300 pixels, but neither blogger nor flickr seem to be happy with such an enormous image, even though it's only 8MB. Oh well.

Update: Thanks to a good friend, you can now look at the real photo, by clicking on the preview above.

Update 2: My friend's site appears to have been terminated, here's a link to the same shot at Flickr.

Wednesday, December 30, 2009

Security Theatre

Before I get started, this post is likely to come across as a bit of a rant. If you don't want to read my half-formed, lefty crap, at least read the article by Bruce Schneier on CNN that inspired it. It's much better written, and far more important that it gets wide coverage than my version. ;-)

Having said that, if you're still with me, here goes: wasting money bugs me, especially when it's a government that's doing it for the purposes of appeasing the 'voice of the people' (see the end of this for more on that meme!). When governments spend enormous sums of money on visible security activity at airports this gets me particularly riled because it's pointless. I quote from Bruce Schneier's opinion article on CNN:
Often, this "something" is directly related to the details of a recent event. We confiscate liquids, screen shoes, and ban box cutters on airplanes. We tell people they can't use an airplane restroom in the last 90 minutes of an international flight. But it's not the target and tactics of the last attack that are important, but the next attack. These measures are only effective if we happen to guess what the next terrorists are planning.
If we spend billions defending our rail systems, and the terrorists bomb a shopping mall instead, we've wasted our money. If we concentrate airport security on screening shoes and confiscating liquids, and the terrorists hide explosives in their brassieres and use solids, we've wasted our money. Terrorists don't care what they blow up and it shouldn't be our goal merely to force the terrorists to make a minor change in their tactics or targets.
Our current response to terrorism is a form of "magical thinking." It relies on the idea that we can somehow make ourselves safer by protecting against what the terrorists happened to do last time.
Of course, the result of this 'magical thinking' is also the terrible changes that are taking place to the due process of criminal proceedings at law. The introduction of arbitrary periods of detention without charge, the holding of terrorism-related trials in camera, the rhetoric of hatred of any other political or cultural outlook than our own... this is dangerous stuff that just serves to increase the threat from those opposed to our way of life. Back to Bruce:
Despite fearful rhetoric to the contrary, terrorism is not a transcendent threat. A terrorist attack cannot possibly destroy a country's way of life; it's only our reaction to that attack that can do that kind of damage. The more we undermine our own laws, the more we convert our buildings into fortresses, the more we reduce the freedoms and liberties at the foundation of our societies, the more we're doing the terrorists' job for them.
So, when you're thinking about who to vote for in future (in the UK general election, for example), why not challenge them to stop the damage that's being done to our relatively free way of life, pull back from culturally aggressive stance in international politics, and stop stoking the flames of the conflicts that spawn terrorist acts.

p.s. on the 'voice of the people', it appears the ‘newspapers’ are being deemed to be the ‘voice of the people’ in that mad country, the (dis-)United Kingdom, so a populist, theatrical, approach to security is the inevitable outcome. Of course, it is the broadcast & newsprint media that treat said ‘newspapers’ as ‘the voice’, in addition to their weak lackeys in Westminster. It’s a vicious circle of bullying and subservience maintained by those with the loudest voices, the deepest pockets and the least integrity.

Monday, December 28, 2009

Camera Update

Christmas gifts have come, and I now have a Sigma 70-300mm zoom lens for my camera. I've tried to photograph the moon with it, but it's amazing how difficult a subject it is. It took 16 shots before I even got something remotely better that a white blob in a black sky. The best I could do in 24 shots is in my photostream, but believe me, I'll be trying that again once I get my cable release!

I also tried to shoot the constellation of Orion - a nice easy constellation to recognise in our northern night sky. Last time I tried, I accidentally left my camera in noise reduction mode, which gave photos that consist of a dozen seriously blurred stars. This time I tried without NR... and instead got a dozen faint blobs with trails that indicated the camera had moved somehow during the 6-8 second exposures. Not quite sure how this happened, but all I can put it down to is that a) my house is old and I was on the top floor, where the floor-boards are not the smoothest and most solid in the world, b) I was manually pressing the button, and c) maybe I breathed on the camera on it's tripod just a little too loudly? So, next time, I'll go to our back yard, so the tripod will be on brick, and I'll use my new cable release... expected from Amazon any day now.

Learning, learning, learning...

Sunday, December 27, 2009

Copenhagen Summit on Climate Change

It's taken me a while to figure out my reaction to the train-wreck that was the Copenhagen Summit on Climate Change, but what finally got me to the point where I can write something was this story (via Chris Samuel's blog in Oz) about China being the force behind the failure of Copenhagen.

Now I'm caught between "I can't believe China could act so terribly" and "Huh, now they've found their scapegoat." This does make we wonder why the 'western powers' didn't make it clearer at the time that China was the source of the problems and either shame them into proper action (a strategy unlikely to succeed due to the lack of the need for the Chinese leadership to respond to any kind of democratic process), or simply to exclude China and set the world on a path to economic exclusion of the country too - I'm sure there are other countries that would be very willing to take up the manufacturer industries currently supplied by China.

There is an interesting kicker in Chris's blog post, and that's from his wife - Donna, who commented on the post thus:
If China railroaded Copenhagen then isn’t it time those of us in Western nations stopped filling our Christmas stockings with cheap Chinese goodies whilst ignoring its those very actions that drive China to want to exhaust its ‘fair share’ of the ‘Industrial Revolution’. We may not have power over our leaders or Copenhagen, but Western buyers do have pocket power without which they can let China know what they think about ethics. Think about that next time you reach for your credit card for that latest gadget. Which regime are you supporting.
I guess this is the small-scale, personal approach to implementing the strategy I suggested above.

Monday, November 23, 2009

Photos

Recently I replaced my aging Canon completely manual SLR with a whizzy new digital SLR. Okay, so it's only a Sony alpha 200K, but it's new to me and fun not having to consider how many shots I can take before I run out of film.

I went for a wander this afternoon - first real opportunity since getting the camera with decent weather, and the best of the results are here.

Tuesday, September 01, 2009

Obligatory 9/11 post

There's been a lot of talk of gross government sponsored conspiracy theories surrounding the events of 9/11, and I'm still to be convinced that any government is truly that competent (why assume a massive, all-encompasing, conspiracy when there are much simpler explanations - the principle of Occam's Razor).

However, this article was sent to me by my Dad, who is rather more convinced of the sheer evil of the US government under George Bush (jnr).

I'm waiting with interest to see if the report is taken up by any more news sites than just a local California newsletter, but if taken at face value, this does seem a reasonably un-rabid, professional, and worrying report. (Not so, many of the readers' comments at the bottom of the article!)

Of course, if other media sites ignore this, it could be that they simply don't give the organisation credence, but conspiracy theorists will say that the report will be suppressed by the uber-powerful US government, and they'll tell the global media to ignore it too, and the global media will obey them... for some obscure reason. Pretty much a no-win situation there then. ;-)