Fixing the Nook app for OSX

Although I usually read books on paper on the iPad, I downloaded the Nook app for OSX this evening.  Downloaded just fine, opened fine, but never made it past the splash screen. The animated “Nook” logo flashed across, froze, and sat there. For a long time.

Restarted several times with the same result, even downloaded it again and reinstalled with the same results.  As of right now, the latest version is 3.0.0 which was released in March 2012, so not a lot of recent work has gone into it.  Some google searches resulted in quite a few other people having the same problem with no real answer or updates from the B&N folks.

The solution as it turns out, is a very easy fix.  In your /applications/ folder (where the Nook app is installed) create a new folder, call it “NookforMac” and drag the app in there. Make sure the app is closed, re-open it, and viola. Should work just fine.

Credit to kateB over at openkase for the workaround.

Update:  Well, this solution worked for about a week, then the problem returned.  The solution for that was to wait until the app launched, and froze on the nook animation. Right clicking in the grey-space around the logo and selecting ‘reload’ got the app to load the rest of the way (although it took a couple of times).


OSX – Imaging an SD card for use on a Raspberry Pi

My new Pi and it’s memory card arrived at the house yesterday afternoon. I got everything unboxed, downloaded the latest image from the Pi website and fired up Disk Utility on my Mac and was ready to start imaging. But it’s not quite that simple, the Disk Utility can’t verify the image as being valid, so we have to do this from the command line. But relax, it’s not hard to do.

First insert the SD card into the card reader, open a command prompt and run this command:

elmo:~ jgs$ df -h
Filesystem Size Used Avail Capacity iused ifree %iused Mounted on
/dev/disk1s1 29Gi 2.1Mi 29Gi 1% 0 0 100% /Volumes/NO NAME

You’ll end up with a lot more that what I’m showing you above, but in the interests of keeping it simple, I cropped out the extra disks and drives attached.  You’ll want to locate the SD card you plan on using either by the size of the disk or the name. Mine was new out of the box and was actually called “NO NAME” so it was easy to find.

Next fire up Disk Utility, and under the name of the SD card “unmount” any partitions that are listed, but don’t eject the media.

So we’ve identified the drive as /dev/disk1. It’s very important to make sure you have the correct disk, running the command we’re about to run has the potential to erase your entire hard disk if not used carefully. Always triple check the destination.

Once you’ve done that, go back to your terminal window and run this command – but alter it first to fit your system!!  The if (input file) parameter should point to the .img file and the of (output file) should point to the SD card.

sudo dd bs=1m if=/path/to/file/2012-12-16-wheezy-raspbian.img of=/dev/disk1

From the command line there won’t be any output while the program executes, which is slightly annoying, but there’s a way to force it to show us the progress. There are several ways to do this, depending on the OS you’re running, and sometimes these commands are not interchangeable and can kill the process. For OSX you’ll want to open a new terminal window and run this command:

sudo pkill -INFO -x dd

This will instruct the process running in the original terminal window to pause for a moment, report it’s status, and resume. You can gauge the completion percentage based on the size of the image you’re copying (mine was about 1.9 GB and took around a half hour to copy). The output will look like this:

392+0 records in
391+0 records out
409993216 bytes transferred in 335.052687 secs (1223668 bytes/sec)

And that’s pretty much it. Once it completes, eject the SD card, plug it into the Pi and have at it!

Raspberry Pi Model B on the way…

It’s been a good long while since I’ve written anything techie (or otherwise) here, been busy and lacked motivation.  Today I ordered my  Raspberry Pi Model B along with a Adafruit Pi Cobbler Breakout Kit and some other assorted goodies.  I’m pretty excited to get my hands on it, unfortunately the estimated delivery date is towards the end of January.

The possibilities seem relatively endless, there’s a myriad of forum posts in their official forums from members of the community that have done some pretty amazing things with them. Yeah, I know, they’ve been on the market for a while now, this is really tie first time I’ve taken the time to do any research on them. More to come on this, guaranteed.

If you’re still scratching your head wondering what it’s all about, check out this Google Tech Talk by Rob Bishop, he’s one of the engineers that has been dedicating their free time developing this product.

It’s a great cause, with a nice side effect of empowering techies to create some cool stuff.

Running pogoplug behind a squid proxy (ipcop)

So I’ve done a couple of articles about my new filesharing appliance the PogoPlug over the last year. Absolutely fantastic device, use it often remotely.

One thing that I’ve been unable to get working so far was the native OS application. The application allows you to map a drive directly to the drives connected to the appliance, hence the last article about installing a samba server on it. This issue probably won’t apply to most folks, my home network is a little unique compared to the average person buying a commercial router from Linksys, Belkin or the like. Skip to the bottom for the commands if you’re not interested in my reasons for splitting the networks.

So, I have two completely separate networks at the house. One is wired, and the other is wireless, they interconnect through some various switches but ultimately demarc on an IPCop firewall. The wired network is where my home servers and toys connect (SlingBox, ssh server, pogoplug) whereas the wireless is mostly computers or smartdevices.

With this setup, I don’t have any want or need to proxy traffic from the wired network as they’re essentially all services. From the wireless where we actually surf however, I like to run URLFiler and Advanced Proxy on the IPCop box to get filter out ad servers and malicious and adult websites. The problem with doing this is that the clients need an UNFILTERED direct connection to both the PogoPlug device and the main PogoPlug server out in internet land. Until today I mostly used the samba share to get around this, but it started bothering me and after some poking around I came up with a very easy solution.

You may be asking, why not just add an exception in squid? Well, it doesn’t seem to work through the IPCop interface. And modifying the actual config files would do the job, but the next time IPCop restarts or I add something in the web interface, it would wipe out the manual changes I made. So, lets fall back to good old iptables and prerouting!

By adding these two rules, we save a whole lot of headaches, and the software works perfectly:

/sbin/iptables -t nat -A CUSTOMPREROUTING -p tcp --dport 80 -d -j ACCEPT
/sbin/iptables -t nat -A CUSTOMPREROUTING -p tcp --dport 80 -d [POGOPLUG_IP] -j ACCEPT

The first line allows an unfiltered connection to which is the authentication server, the second line allows an unfiltered connection to the pogoplug device itself. Like I said, this probably won’t really impact too many people, since my traffic leaves the BLUE network and hits the GREEN network it gets filtered, and in this application that’s a bad thing.

Hope this helps someone else who’s been banging their head on the wall like I was.

Munin plugins and system configuration..

Munin is a great open-source monitoring solution for servers. I’ve used it in the past and was really happy with the results, but when I was using it my server was just a little VPS and running the server and node on the same box caused some system resource issues. But now having colo equipment in the rack at DimeNOC I decided to give it another go.
Continue reading Munin plugins and system configuration..

Installing Samba on your pogoplug

I know there are a bunch of articles online about installing samba on Pogoplug (or openpogo enabled) devices. I read quite a few of them and still ran into trouble installing it on my appliance so I though I’d do a quick write-up of how I got things rolling.

First, you need to install the OpenPogo base package. Very detailed and effective directions are available here.  A couple of notes about OpenPogo before you go running off though. First, it requires an external USB drive to install on, and run from. Second, if you remove the USB drive (perhaps mistakenly thinking you were done with it) the filesystem that was on there is dismounted and everything running from it stops. And finally, the USB stick will have to be reformatted into a linux ext2 or ext3 format which means you’ll lose any existing data on it. Best to find an older 1GB stick and use that for this as the packages seem rather small.

Ok, so once you’ve installed the OpenPogo software onto your external USB drive, rebooted, mounted, etc, what you’ll need to do is run ipkg to install Samba. You should be able to execute this command to kick it off:

-bash-3.2# ipkg install samba2

This kicks off the download and installation process which I imagine under ideal circumstances should take care of the whole thing for you. If it did, skip this section and see the configuration part below. I’ll warn you though, the downloads were very slow for me, took about twenty minutes to download the seven meg file even though I was able to wget it to my linux box much faster.

The problem I had was an invalid MD5 checksum when using the automatic installer, so I resorted to manually downloading the file, then installing it.

-bash-3.2# cd /root
-bash-3.2# mount -o rw,remount /
-bash-3.2# ipkg download samba2
-bash-3.2# ipkg install samba2_2.2.12-2_arm.ipk

Once the install has completed successfully, you should turn on the server by running this command:

-bash-3.2# /opt/etc/init.d/S80samba start

After which you can verify that the server is running by checking the output of netstat

-bash-3.2# netstat -an | grep ":13[7-9]"
tcp 0 0* LISTEN
udp 0 0*
udp 0 0*
udp 0 0*
udp 0 0*
udp 0 0*
udp 0 0*

Now to verify that samba is working properly, execute this smbclient command:

-bash-3.2# smbclient -L localhost -N
added interface ip= bcast= nmask=
added interface ip= bcast= nmask=
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 2.2.12]

The output is a bit more verbose if you have shares active, and other active workgroups, so I snipped them out of this example. Now we need users! Execute these commands to create a user account on the system:

-bash-3.2# adduser -H User1
-bash-3.2# adduser -H User2

Now run these commands to setup a samba user:

-bash-3.2# smbpasswd -a User1
-bash-3.2# smbpasswd -a User2

Now comes the part of defining the drive mappings. There are a couple of ways to map things out, you can separate each physical disk into a share, or share all disks under one. Just depends on what your requirements are.

For the first method, separating each disk into it’s own share, this is what you need to know:

By default, the external USB drives are mounted in /tmp/.cemnt/sdX1 where X is usually ‘a’ for the first disk, ‘b’ for the second disk, etc. You can look to see how yours are mounted by running the df command:

-bash-3.2# df -h
Filesystem Size Used Available Use% Mounted on
/dev/mtdblock2 32.0M 18.6M 13.4M 58% /
none 125.0M 8.0k 125.0M 0% /tmp
/dev/sdd1 944.6M 57.8M 838.8M 6% /tmp/mnt_opt
/tmp/.cemnt/sda1 465.6G 365.0G 100.7G 78% /tmp/.cemnt/mnt_sda1
/tmp/.cemnt/sdb1 74.5G 53.5G 21.1G 72% /tmp/.cemnt/mnt_sdb1
/tmp/.cemnt/sdc1 149.0G 75.3G 73.7G 51% /tmp/.cemnt/mnt_sdc1
/tmp/.cemnt/sdd1 944.6M 57.8M 838.8M 6% /tmp/.cemnt/mnt_sdd1

As you can see above, we have four external USB drives mounted. /dev/sdd1 is the external USB thumb drive that OpenPogo is installed on, and mounted to the /opt directory. sda1, sdb1 and sdc1 are all external USB drives with user data on them. Make a note of which disk is which, you should be able to tell by the disk size, or at least content.

Next we need to modify the samba configuration file. It should be located in /opt/etc/samba/smb.conf. Using a text editor such as vi or nano, edit this file and add the following text — this part is the global configuration:

#smb.conf begin
# Global Parameters
workgroup = WORKGROUP
netbios name = Samba
log file = /opt/var/log/samba/log.%m
null passwords = yes
guest account = root
security = share
max log size = 50
encrypt passwords = yes

NOTE: If you’re connecting to these shares from a Windows machine, you may need to set encrypt passwords = no in the above example. I’ve seen mixed results for that.

Now, if you chose to define each drive as it’s own share, you could add something like this to the config file. The text within the [] brackets is the name of the share:

path = /tmp/.cemnt/mnt_sda1/
browseable = yes
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

The path - /tmp/.cemnt/mnt_sda1/ is the path to the first external drive. Keep in mind that this configuration has NO SECURITY other than that of your local area network. If you need per user security you will need to modify these directives.

Now, your other option is to share out ALL external disks under on mapping. To do this, use this configuration:

comment = Pogoplug USB disks
path = /tmp/.cemnt
available = yes
public = yes
writable = yes
printable = no
create mask = 0777
guest ok = yes
browseable = yes

Keep in mind that this configuration has NO SECURITY other than that of your local area network. If you need per user security you will need to modify these directives.

Anytime that the samba configuration file has been modified, you must restart the service for the changes to take effect. Do that with a restart command:

-bash-3.2# /opt/etc/init.d/S80samba restart
Stopping smbd:
Stopping nmbd:
Starting smbd:
Starting nmbd:

Now that you’ve completed the configuration and restarted the service you should be able to connect to your pogoplug device directly, upload, download, delete and modify files. I must stress again that this is a very OPEN configuration for samba. If you require additional security for the shares (like on a corporate network) then you should really know more about samba configuration. If anyone wants to post some examples of securing the directories/disks using the accounts created in the beginning please do — I’m no samba expert.

Happy Networking!

New gadget: Pogoplug

After reading some reviews on Engadget and Gizmodo I broke down and purchased a PogoPlug from (they were on special for $47.99 at the time, $79 at the time of this writing).

Pogoplug is an appliance that you can connect to your home network which runs a custom version of linux. The device has a gigabit ethernet port, three USB 2.0 ports on the back and one on the front. Basically, you plug your external USB hard-drives into this thing and it makes your files available to you no matter where you roam.

Best part (for home users) is that there are no firewall rules that need to be put on your home router or custom firewall. The device heartbeats out to their servers in the cloud and make the whole thing possible without a lick of configuration being required. Caveat: UDP has to be unfiltered outbound for this to work, so “real” firewalls may have to have allow statements put in them.

So, with your purchase of the hardware, you get lifetime support and access to your personal “storage in the cloud”. This can be accomplished remotely (or locally) via the web client or samba/windows shares. You also have the option to share files and folders with the world, individual users, etc. There’s even a client that runs on the Mac, PC and iPhone to access files directly and see them as locally mounted drives. If you happen to be on the same network your connections go directly to the device and not through the Pogoplug servers.

From my iPhone, I’ve been able to stream movies over WiFI and 3G with great quality. The Pogoplug device will convert audio and video files on the fly to allow streaming to the iPhone/iPod/iPad/PC/Mac, etc. Sweet little deal, if you happen to have a bunch of movies or music on your external drive(s).

Through the use of OpenPogo you can even install custom software on the appliance like samba, squid, bittorrent, a webserver, etc! Since this little guy runs on linux, the possibilities are endless really.

Been using this for a couple of weeks now, and I’m really impressed. The company announced just a few days ago that a new firmware update would allow for printing through the device, and is being rolled out now to customers. This thing is becoming very versatile!

More later.