Showing posts with label Pogo. Show all posts
Showing posts with label Pogo. Show all posts

Monday, October 21, 2013

1st gen G4 Mac mini vs PogoPlug Classic

I took out a G4 Mac mini out of the storage and thought about junking it. It has been in storage for over 5 years now. I googled, "What to do with an old G4 Mac mini" and found some surprising results. People are retiring them into low-powered servers.

Before throwing it out, I figure I find a way to recycle it into my current tech lifestyle.
I have the very first gen G4 with 1GB DDR RAM, 100 GB PATA drive. I also have a GPower USB/Firewire external matching enclosure hub.

The original 1.25 GHz PowerPC G4 first generation Mac mini consumes about 32-85W (Max). At idle, 32W is decent but not what I call low-power.

I found some people debating whether or not an ARM based lightweight device like a PogoPlug would compare. PogoPlugs run at 4-5W and can be hacked into full Linux servers running mySQL, web,FTP,rsync, miniDLNA, torrent boxes, Squeezebox music server,  you name it.
They are often discounted at $15-20.

I personally have 8 of these Pogos running various things. However, I also have a whole closet full of Firewire drives that could be put to good use and shared over the network. Hence, I thought of re-using the Mac Mini.



Tuesday, October 8, 2013

My Airport Music Streaming set-up



I finally set-up my Airport streaming set-up and I like to share it with my readers. Overall, I am pleased how it turned out.

Apple Airport allows you to stream wirelessly from iOS or Macs to a variety of wireless speakers and sound systems. I have various speakers in different parts of the house and this now changes the way I listen to music. Using Wi-Fi, you don't have to worry about range issues and the sound quality far exceeds bluetooth.


By default, iOS devices can only stream to one devices. When you play a song, you can pick which remote speaker to listen to. This by itself is cool but the cool part comes with multiple, simultaneous streams.



Desktop Macs and PC's running iTunes can stream to multiple speakers simultaneously all at the same time. If you have a dedicated iTunes server running, you can make up for iOS's single speaker deficiency by using the iOS devices as a remote control. As a remote, you can stream to multiple speakers in multiple rooms.


Here, I have the computer, the speakers in the basement, dining room, and master bedroom all playing at different volumes. This is simply brilliant!



This is why I love the Airplay protocol. I can walk from floor to floor, room to room, and all hear the same music in my 3 story house. I can initiate a stream in my Master bedroom and walk across multiple rooms and hear all the same track. 




The first speaker I have is the Klipsch Gallery G17 Air. I use this in my bedroom because it covers a decent size area. I originally had this in the living room but decided I want speakers with more "stereo" soundstage separation in the living room. A majority of these portable speakers suffer one thing: lack of sound stage and most of them sound mono to me. When you are up close, they sound great but the farther you get, you realize you lose stereo separation. The Klipsch uses a bass reflex enclosure so the sound is very "punchy" for being a small set of speakers. Don't get me wrong, they do sound very good. These once retailed closed to $500 and have been compared to the Bowers and Wilkins Air Zeppelin. I would say these are one of the better small wireless speakers you can get on the market.
For the bedroom, they work fine. I also alternate between airplay mode and direct line mode to my iPod classic.





The next system is the Sony DLNA compatible SA-NS500 portable wireless speaker. This is a unique cylinder cone design. The top acts as a handle and it is great for lugging around because it has one trump card - batteries for 5-6 hours of portable sound. I normally leave it in the Dining room but I often take it outside to keep me company when I am washing and waxing the car on the weekend.

The shape is designed to punch sounds indifferent direction. It has 4 30mm two way speakers and a small 110mm sub woofer.



Again, the Sony is a good sound speaker but you won't get any soundstage. Early reviews were mixed on this but with later firmware revisions, Sony worked out most of the kinks. This also supports DLNA.





My next set-up is a not really a speaker system. Rather, a converted PogoPlug running ArchLinux and shairport. I had a spare PogoPlug and a few older 2.1 computer speakers. I figure I throw it in my basement and it works pretty great. Open source hackable solution. All you need is a USB sound card, some speakers, and ArchLinux running on these PogoPlug. I will probably build some more PogoPlug "Airplay" receivers that will expand my speaker lineup. You can read about it here.

I also have an AppleTV connected to my  TV and sound system but I really don't use it for audio Airplay streaming chores.

Lastly, the living room. I thought long and hard on this. I shopped around and looked at a few options. I really didn't want to put a stereo system in the living room because I wanted it to be minimalist as much as possible. However, I spend a lot of time in there relaxing and lounging. I seriously considered the Bowers and Wilkins A5 and A7. Price wasn't really an issue as I spent quite a bit of money furnishing the living room already. The problem withe the Bowers and Wilkins' A7 is the same with the Klipsch, Sony and myriad of other "Airplay" enable speakers. They all lack soundstage and stereo imaging. Your left and right speakers should ideally be a few feet apart (say 6 feet) to have any stereophonic effect. Most of the music I listen to, 80s and 90s music, are heavily mixed with stereo effects. I also listen to a lot of live concert recordings.




The solution I came up was an Apple Airplay Express plus the well reviewed and acclaimed AudioEngine A5+ speakers. The AudioEngine is a good midrange $400 studio monitor quality speakers. This is a popular home-brew Airplay set-up and I now know why it is popular. They sound amazing.



For now,I don't have the DAC (Digital to Analog Converter) but I plan to add that in a few weeks. This is by far, one of the better solutions out there even without an added DAC. I wanted clear, accurate sound. For the price, the A5+ are amazing. They don't have that artificial bassy, hyped sound. Just go on Google and read up on the AudioEngines, they are amazing powered speakers for the price. This is what I ended up and I'm very satisfied. 

So there you have it. This one geek's streaming audio home set-up.






Links:













Monday, March 18, 2013

Practical UNIX style backups using an ArchLinux PogoPlug

If there was ever a reason to get a $15 pogoplug hacked to run Arch Linux, this article may sway you.




I'm going to show you how I turn an ordinary $15 linux gadget into a useful "rsync" backup client.

The tasks which I will share with my readers is the typical things I would do administering *NIX based servers. We set up redundancy and failover using some simple and tried and true methods. There really is no rocket science involved. After doing it a few times, it becomes second nature. And because of the simplicity, it becomes apparent why I love small gadgets running Linux.

The articles and methods are pretty much simplified but they illustrate the simple and powerful nature of the powerful command line.

Today, I decided to turn one of my Pogos into a remote robo-copying slave. Its only job is to do remote backups of my GIT server. Then I realize, it should be running independently as a working droid (thinking Star Wars) to find,scan my network and backup any *NIX computers running in my household. I have a few spare older 250-320GB drives that needed to put to good use, so I pared them to a Pogo.

Normally, you would initiate the copy and backup from your desktop/laptop to the PogoPlug running some form of Linux/NAS. Here, I do the reverse. I have my pogoplug go out and do all the work.

So if I turn on my NetBSD G4 mac from 5 years ago, or come home with my Thinkpad, or turn on my iMac, it would automatically back them up without my intervention. I wouldn't have to think about it. If I was working on some code on my Thinkpad. I could go out to the back-yard to my patio and from my Macbook, I can pull source code that was already synced 5 minutes earlier off the Thinkpad.

Think of it as a reverse time machine. The concept is not new. We have dedicated backup servers that do nothing else but do remote backups off-site. Here, I am using a low powered PogoPlug running ArchLinux.

In fact, it took me 30 minutes to implement it. This is the power of *NIX. So I will share it with my readers today. Everything is meant to be done on the Pogo itself.

First, I logged into my Pogo and copy my SSH keys from my Pogo to all my target computers. So if I change my passwords, it would still authenticate against it. As I write this, I am thinking R2-D2 talking to the main-frame of the Death Star. If you don't know what SSH keys are, take a detour and google it before proceeding further. In short, keys allow machines to talk to one another without using passwords.

In arch, it is pretty easy.

ssh-copy-id username@remote_server

It will simply copy your keys over to the remote machine.




Next, I wrote a small bash script that pings the remote machine. If the machine pings, it means it is online and it will then attempt to rsync with it. Rsync is the tried and true industry standard for remote file synchronization/file copies.

Feel free to use this bash script. Simply, change the variable of the "remote_machine" to the IP or hostname of the computer you want it to ping and rsync. Since my network employs Avahi/Bonjour, it pretty much works by hostname. EG. My Thinkpad is accessible via ThinkpadT420.local
In this example, my remoteserver.local is my intended target.

I do a simple IF THEN conditional check in my bash script. If the machine doesn't ping, alert us with a message. Otherwise, proceed to rsync.


 #!/bin/bash  
 remote_machine="remoteserver.local"  
 PINGCOUNT=2  
 PING=$(ping -c $PINGCOUNT $remote_machine | grep received | cut -d ',' -f2 | cut -d ' ' -f2)  
 if [ $PING -eq 0 ]; then  
           echo "Something wrong! server: $remote_machine down"  
 else  
           echo "All good: $remote_machine"  
           echo "We will rsync now"  
           rsync -au --progress --stats root@remoteserver.local:/var/www/ /media/passport/rsync/vps/www/  
 fi  


My rsync command is pretty straightforward here. Archive and update. I added progress and stats for my own reference.


rsync -au --progress --stats root@remoteserver.local:/var/www/ /media/passport/rsync/vps/www/ 


Basically, my rsync logs into the remote server, copying the /var/ww/ into my destination of my 1TB Western Digital USB drive labelled, passport. The copies go into a folder, /media/passport/rsync/vps/www


After writing it, I tested it. I named my script vps_backup.sh

I then change the permissions to executable and did a dry run.



As you can see, the files and folders populate from my remote machine. The below screenshot shows two web directories. One from my iMac and another from a remote VPS.





Lastly, I would use a cron job to run every few minutes. You can even do cron job schedules in Webmin. I would recommend installing webmin so you can have a web based administratie interface of your Pogo. It simplify things quite a bit.

When you log into webmin, head over to System . Scheduled Cron Jobs.


Cron Jobs under webmin is pretty much a point and click.

I specified the user running as "root" to have full system rights and pointed to the script I wrote earlier in /root/vps_backup.sh. For this example, I specified a daily midnight schedule but I could change to hourly or every 5-10 minutes.




And there you have it. A simple (well, at least for me) way to do interval backups from a Pogo.



Thursday, March 7, 2013

PogoPlug ArchLinux Speed Testing and Notes



If you've been reading this blog, you know I'm a big fan of the $15-20 Pogoplugs. They're really popular with people who want to run a low-powered embedded ARM Linux server. Depending on drive, they consume a mere 4 to 15 watts of power. The platform of choice and most popular is ArchLinux.

This post is tailored for those who are want to run ArchLinux ARM on their pogo and use it as a NAS/File Server. I also assume you have already ventured into the PogoLand with your unlocked Pogo with Arch installed.

I'm going to go over my findings and offer my recommendations.

First of all, before you do anything, make a full backup of your bootable Arch USB. There are a few ways to do it: DD, rsync, and tar gzipping.

Here is a link to get you started: https://wiki.archlinux.org/index.php/Full_System_Backup_with_rsync

I personally do a TAR gzip of my USB so I can unzip back to a USB stick that may be a different size.

I believe most or all of the Pogoplugs come with Gigabit standard. However, network speed and copies will be dependent on a few things. The filesystem, the limitation of USB mass storage and your network file sharing protocol.

Out of the box, the Pogos run at 60 Megabytes per second in theory. This is serving from RAM and synthetic benchmarks. When you attach a USB drive, that speed will drop considerably. I would say around 35 MB/sec in super ideal situations.

You can stream 720p MKV and H.264 comfortably in most cases.

There are a few things you should take into consideration and YMMV (Your Mileage May Vary).

After making a backup, the next thing you should do is experiment with Jumbo Frames if your router/switch and network supports it. Start off at 4000 and try slowly going up to 9000. If your system is unresponsive, most likely your guest computer or network switch is incompatible. Worst case scenario, something is wrong with your Pogo and you will need to restore from a backup clone.


As you change your MTU to Jumbo frames, test the transfers using a tool like iperf.
To change MTU, you do like you do in any Linux distro:

ifconfig eth0 MTU XXXX




As you can see in the screenshot above, I started to average 110 Megabytes per second which is near the Gigabit's theoretical limit of 125 MB/s.

Now, when I drop it back to normal frames of 1500, you can see my network speed drop to normal of 65 MB/sec.


Changing to Jumbo Frames can also have undesired consequences. If your other client computers do not have Jumbo Frames, performance will suffer. For example, if you are connecting an iPad or Android device to your Pogo via Samba, there is no way to change Jumbo frames on most mobile devices.

In some cases, mismatch MTUs from client and server produced disastrous results. So YMMV. See below. 2.58 MB/sec.



You may be wondering why bother with network speeds when USB disk access is slow (next section).
Well, with faster Gigabit, you can network mount shares from other sources into your Pogoplug. For example, if you plan on building a Squeezebox music server and just the server itself, you can NFS mount from another file server. The same goes with running a torrent server and saving the files elsewhere. Importantly, if you have multiple disk with multiple shares, you want to ensure each client is not using up all the bandwidth.


Disks Considerations:

The most important thing that affects PogoPlugs (and Linux in general) is the filesystem you plan to use. Native  EXT3/EXT4 is the only way to go.

NTFS and FAT32/ExFAT is not recommended if you want speed. Fuse based Filesystems have to go through several layers.  NTFS and ExFAT is nice because you can store files larger than 4GB. However, Linux EXT filesystems also support large files as well.


The only problem with using EXT3/EXT4 is you can't easily unmount your USB drive and connect to non-Linux running computers. If your main platform of choice is Windows, you may want to stick with using NTFS. I have plenty of Linux computers around the house at my disposal so this is not an issue.

Just for comparison,using the same drive (a 1TB Western Digital Passport drive), NTFS was a slower. Especially in writes, it was horribly bad at 6.5 MB/sec vs 27 MB/sec using EXT3

Here are NTFS disk benchmarks


and EXT3.


I use DD to write and test the same drives. If you plan to use the Pogo as a dedicated server, it is highly recommended to use EXT3 or EXT4.

This also translates over to Network file access. Using Blackmagic's Speed Test on a Macintosh with Samba, I see similar results.


And with EXT3


Interestingly, using Netatalk, I was getting close to 35MB/sec reads.

Encryption will also take your speeds down quite a bit. With SCP/SFTP, you will only get around 5 MB/sec.



NFS did not really fare any better. The best I could get is 8 MB/sec.




In short, if you want the best performance, stick with EXT3 and Samba. USB 2.0 is really the bottleneck with PogoPlugs. They're great at what they do but dont expect them to replace a Synology or any other dedicated NAS for heavy duty work. 25-35 MB/sec is pretty respectable for a USB drive hosted NAS. Backups, Rsync, and Time Machine do not require much more. Then again, a Pogo plus Harddrive consumes 10 watts!

Hopefully this has changed with Series 4 of the PogoPlug. The V4 has a USM SATA dock connector and USB 3.0. However, unlike the Classic Pogos, they don't go for $15-20.
I have one on order and plan to report back soon.