Copy Files to Pogoplug Without The Pogo Software (using scp)

I recently picked up a Pogoplug on sale from John Lewis and thought I’d give it a whirl with my media.

Although it is a neat little device, one of it’s biggest benefits is also it’s biggest flaw in terms of design – and that is how it requires you to sign into and maintain an account there. It also requires you to mount the pogoplug with their software for transferring and viewing files, rather than acting as a NAS.

Whilst it’s nice to have easy access to media outside of home (without having to fiddle with setting up port forwarding on your firewall and whatnot) it’s a bit of a drag when you’re on your own network. I noticed a severe performance¬†degradation¬†copying media to my pogoplug device using pogoplugfs rather than through a standard means. So I learned that Pogoplug does appear to have a Busybox install and along with that SSH access. In order to enable SSH access, Cloud Engines have been gracious enough to allow this through your portal. You simply go to Security options and enable SSH, and change the password. From there it’s just a simple,

ssh root@<pogoplugIpAddress>

The problem is that there doesn’t seem to be any support for sftp and therefore I couldn’t use ssh in a file manager. Thankfully however ssh provides scp protocol and from there it was just as short script in order to zap files across over local lan without worrying about signing in.

When you attach an external harddrive to the Pogoplug, your files will be installed in a directory similar to ‘/tmp/.cemnt/mnt_sda2/’ where ‘mnt_sda2’ will be the mount point of your media device.

Be aware this script utilises “expect”, but you could use private keys instead.
#set -x
# Provide a list of media extensions to send to pogoplug
extensions=("mp4" "avi" "mkv" "jpg");
ppip="" # The local ip address of your pogoplug
echo ""
echo "Sending video files to PogoPlug ($ppip) for the following extensions..."
for ext in "${extensions[@]}"; do
echo ${ext}
echo ""
for ext in "${extensions[@]}"; do
 expect -c "spawn bash -c \"scp -p *.$ext root@$ppip:/tmp/.cemnt/mnt_sda2/\"
 expect assword ; send \"mysshpassword\r\"; interact"

I think the next step for this is to translate it to another language and wrap it up in a GUI for easy access. So watch this space perhaps.

Things I Can Do in Linux that I Can’t Do in Windows

I’m an evangelist. Whenever I discover something new and great that’s improved my life, I try to spread the message. Occasionally I’ll get someone to try out Linux. They’re always impressed at first, but inevitably the question always comes in some form or other: “Why can’t it do this like it does it in Windows?”

There are many answers to that question depending on the task at hand, in some cases Linux does it differently and better, in others Linux just doesn’t do it (just like Windows doesn’t support ext3).

But this post is not going to be one of those posts, this post is going to be about what I can do in Linux that I find myself asking in Windows “Why can’t it do this?”

I’m purposely leaving out the obvious bullet points – including modify it any way I like because it’s open source – I want to focus on a user perspective, especially for those thinking of making the switch.

1. Always On Top

This is such a simple and useful feature, to select a window and tell it to stay on top of the others. I mainly find it useful for Tomboy notes or when I’m using a combination of the terminal and file manager.

This would be incredibly useful when I’m using Windows based work computers, where as many as 15 application windows could be open at once.

2. Virtual Desktop

Of course what do you do when you have several application windows crowding your taskbar and only one screen. Shift to the next workspace of course!

Before Linux, when I was just a Windows guy I used to look at these default 4 workspaces and wonder why you would need more than one. I guess I got incredibly more busy since then and since moving to Linux. Now I wonder how those with just one desktop cope!

3. Change the Background

Yeah this is just another dig at Windows 7 Starter Trial edition. Sorry it’s just an easy target!

4. Boot Live CD/USB

There’s times when it would be so convenient to say, boot up a virtual environment in order to analyse or recover your hard disk without actually loading the OS.

Other times you want to try out a new flavour of the OS, or have a portable working environment to switch from PC to PC. Being able to install a USB live distro with minimal fuss and no licensing restrictions is bliss.

5. Install Applications Effortlessly

A lot of people make a big deal out of installing from source on a command line in the terminal, but I think this ceased being an issue a long time ago. It’s mostly used as FUD now. – unless you’re making the switch to Gentoo.

I think there may have been a couple of rare occasions in the last 3 years where I had to install something from source – usually a fairly new alpha or beta application.

Most of the time, I just go to Applications menu and click on the package manager, search for what I need and find multiple choices to try. No DVDs, no drivers, no license codes to enter, no crashing another application and all upgrades managed semi-automatically. Clean install and clean removal if necessary.

6. Partition Management

Want to install a second OS, need to extend your home directory? Just fire up a live disk/usb and run your free partition editor of choice.

This was a major seller of Linux for me. Before Linux I didn’t even realise that partition editors were so ubiquitous and free! That’s right partition your hard drive easily and for free!

Oh… and remember that thing about rebooting into a command line that you need to do in Windows in order to repartion? No need for that here, repartion on the fly in your live desktop environment. It’s so easy!

7. Command Line Fu

OK so this may be slightly technical for the average Windows user but since embracing Linux I’ve learned to embrace and love the command line.. sometimes it’s just easier and faster to fire up an terminal and type

egrep -i "Date: \d+/03/2010" | cut -f1 -d: | sort | uniq | while read line; do mv $line /home/user/March_2010/ ; done

Rather than sift through numerous files looking for those containing dates from March 2010 and endless click and drag.

8. Mimic An Apple Mac

There are specific themes created by the community and tutorials on how to do it, however you don’t even have to go that far. There are several app docks in the repository, as well as widgets (but I can’t stand widgets personally). Currently I use Cairo-dock on my desktop Ubuntu setup.

9. Bulk Rename

This can be done from the command line itself but I have to give credit to this utility from the Thunar file manager. It really is one of the most practical and easiest applications I use.

10. Recover from Crashes

Yes the Linux desktop does crash occasionally, a lot less than Windows. But there are a number of ways out beyond Ctrl-Alt-Del or the power button. Crtl-Alt-F1 will switch you to a command line login that allows you to identify problem processes and kill them, whilst raising a skinny elephant (Alt-Sys Rq- RSEIUB) will secure your system before rebooting, minimising data loss and hard drive borking.


Of course there are things that Windows will do that Linux won’t. For example Linux won’t reboot after every update like Windows does. It won’t run malware and spyware downloaded passively from fraudulent websites. It won’t bug you to purchase a license after 30 days, or check whether your copy of your OS is genuine. It won’t slow down after a certain amount of time. It won’t require a defrag or disk error scanning.

I guess one thing I really miss about windows is all that time I spent searching for performance tweaks, registry hacks and beefing up security. Unfortunately I spend less time messing about with the OS and more getting things done.

Beyond Photorec… Gloobus Helps Discover What The Heck is in These Files?!

Last week I posted on my wife’s emergency situation upon losing hundreds of important work documents after a fatal delete. Photorec is a phenomenal tool in this situation. The problem with using Photorec to restore lost data or a corrupt partition however, is that it spits out files with a generic id for the filename – consequently you could find yourself spending hours opening, closing and renaming restored files.

Thankfully I have just discovered Gloobus, which is an open source alternative to Apple’s Quicklook, and what’s more it’s for Linux! This takes away the headache of launching hundreds of times and makes file previews a doddle. If only we’d found this last week!

Instructions for installing for Ubuntu are here, other distros will need to install from source.

Headless Recovery with Persistent Ubuntu Live USB

As some of you know, recently my Samsung NC10 netbook screen was smashed in an unfortunate accident. I have since replaced this with the excellent Sammy N210 but was at a loss where to begin recovering data from the NC10.

Of course, the obvious solution was unscrew and take out the hard drive, however these Netbooks are tightly built, and since I’m still considering the possibility of replacing the screen, I don’t want to create any superficial damage to the case.

So I googled for options, initially hoping to snag a Linux liveCD that would automatically boot with sshd in order for me to log in remotely.

Aside from some vague forum references to Knoppix and editing configuration files, I got nowhere. However what did occur to me was that Ubuntu LiveCD on a usb flash drive can be set to be persistent so it saves any changes including packages and settings.

The following steps are what I did to get access to my netbook data despite having a smashed screen, without needing to take out the hard drive, hook up an external monitor or building my own distro. Hopefully it may be useful for anyone finding themselves in a similar situation.

This is by no means a silver bullet. You will require the following setup for this to work:

  • The system with the broken screen must be capable of booting from USB.
  • The Bios must already be set to boot from USB (unless you have some way to set it without a screen).
  • A second ‘puter with sshd installed and running.

This will not work with a LiveCD, it needs to be a USB pen drive so that changes can be easily saved on the drive.

  1. Download an ISO of Ubuntu or Netbook Remix, which is what I used, and then use the Startup Disk Creator to create a live USB pen drive – check the box for persistent mode (“Stored in reserved extra space”).
  2. Run the LiveUSB and when it boots to desktop open a terminal and type:

    sudo apt-get update
    sudo apt-get install openssh-server

  3. When installing openssh on a LiveCD/USB you need a password to log in remotely. This can be done 1 of 2 ways, either by setting ‘passwd’ for the default ubuntu user or creating a new user. offers a nice and easy tutorial. In practice I found that when I rebooted the liveUSB for some reason the default ubuntu user ‘lost’ the password so I had to create a new user instead.
  4. If you have created a new user, be sure to add the username to the admin group, giving root privileges:
  5. sudo adduser <username> admin

  6. Test the ssh daemon by logging in remotely to the machine you will use for recovery. If you are prompted for a key then type ‘yes’ and hit enter:
  7. ssh username@hostname

  8. Then make sure you can ssh back to your ubuntu LiveUSB. You may also want to do a quick reboot and test run to see if you can ssh without problems and without touching the LiveUSB keyboard.
  9. Now shutdown the LiveUSB and plug it into your headless netbook/laptop, switch it on and let it boot up, it should take about 30 seconds to boot automatically after the menu and then another 30-45 seconds before you can ssh in.
  10. Create a directory you are going to use to copy all your files from your netbook.
  11. wafitz@ $ mkdir /media/bkup

  12. Once you can ssh to the LiveUSB, you want to mount your hard disk partition.
  13. wafitz@ubuntu$ sudo fdisk -l

    Device Boot      Start         End      Blocks   Id  System
    /dev/sda1               1         182    160101883+  82  Linux swap / Solaris
    /dev/sda2   *       53782       60802    69389632    7  HPFS/NTFS

    wafitz@ubuntu$ sudo mount /dev/sda1 /mnt

  14. It should now be easy after this to grab your files and scp them back to your curent system, whether you previously had Windows or Ubuntu (or other distro) Linux installed. However if like me, you had an encrypted home partition, then keep following the steps:
    I got the original instructions for this from Dustin Kirklands blog – nb: I needed to use ecryptfs-add-passphrase in order to record my passphrase manually before mounting the encrypted directory.
  15. wafitz@ubuntu$ sudo mount -o bind /dev /mnt/dev
    wafitz@ubuntu$ sudo mount -o bind /dev/shm /mnt/dev/shm
    wafitz@ubuntu$ sudo mount -o bind /proc /mnt/proc
    wafitz@ubuntu$ sudo mount -o bind /sys /mnt/sys
    wafitz@ubuntu$ sudo chroot /mnt
    root@ubuntu$ su - wafitz
    wafitz@ubuntu$ ecryptfs-add-passphrase --fnek
    wafitz@ubuntu$ ecryptfs-mount-private
    Enter your login passphrase:

    Warning: Using default salt value (undefined in ~/.ecryptfsrc)
    Inserted auth tok with sig [xxx] into the user session keyring

    wafitz@ubuntu$ cd $HOME
    wafitz@ubuntu$ ls -a

  16. Finally you can do a secure copy from your netbook back to your host pc:
  17. wafitz@ubuntu$ scp -pr * wafitz@:/media/bkup

If you have found this post whilst searching for a solution and this helps you, please let me know. Even more so, if this method can be refined or improved then I’d also like to read your comments!