Archive for the ‘tech’ Category

announcing parmeter.net’s newest blog

Wednesday, September 19th, 2012

It is my pleasure to announce the arrival of my new tech blog (http://parmeter.net/tech) which I am unveiling right… now!

For a while now, I’ve been posting a variety of tech related blogs to my own personal pages.  Typically, I write these articles to document how I did certain things so that I can keep a record (for myself) and to help others who are like minded and are having difficulty finding the information elsewhere.   However, I decided that it would be best, to separate my tech stuff from my personal stuff in a more official fashion.

While I’ll still keep the content previously posted to this blog intact here, I have cloned all of my hard-core tech related posts to the new site.  Going forward you’ll be able to find fresh new tech content there.  More ramblings on Ubuntu, setting up and managing a NAS, etc.

To all my tech readers, see you over at http://parmeter.net/tech!

 

accessing your files from anywhere, revisited

Tuesday, August 28th, 2012

Previously on this blog, I’ve written about how you can access your files from anywhere using freenas and ajaxplorer or ssh.  Given that I’ve switched to Ubuntu server, I wanted to clarify that the ssh method still works great, and in fact can be easily accessed via Android apps as well! (I should have titled this post “Access your files from anywhere with Ubuntu Server”)

Regarding accessing your files from Android, I’m sure this would also work with iOS devices as well, however I’m personally an Android user.  All you really need is a file manager or FTP program that can talk to an SFTP server.  I personally love EStrongs File Explorer and recommend it for general Android file management.  It also supports SFTP, perfect for accessing your SSH FTP server and all of your files.

Simply poke a hole in your router (I would suggest not using port 22) and route to your Ubuntu server SSH port 22.  Easy as pie.


ubuntu server hangs on boot after update

Monday, August 27th, 2012

Public service announcement folks.   Recently, after completing updates where the Linux kernel was being updated, my Ubuntu server hung on reboot.  This was rather unpleasant for me since it meant that I needed to climb up on a chair, attach a monitor and keyboard and try to debug the issue of why my system wasn’t booting.

Surprisingly, the system was booting just fine, it was just waiting happily in GRUB (the bootloader) for my input.  This is odd, since GRUB is supposed to auto-boot without any user input.  Somehow, with the update I had recently done, this had changed.

Luckily, I found this blog which told me exactly how to fix this issue.  Unfortunately this has happened twice now and I’ve had to edit the GRUB config each time.   Here’s what you need to do. (many thanks to Knowledge Republic’s blog for documenting this fix)

sudo chmod 644 /boot/grub/grub.cfg

sudo nano /boot/grub/grub.cfg

Find the following line and change from:

set timeout=-1

To:

set timeout=0

Drop me a comment if this helps you out.

freenas 7 lives on

Saturday, August 25th, 2012

Thanks to a tip from one of my commenters, I’ve discovered that FreeNAS 7 (formally “legacy” FreeNAS) lives on as NAS4Free.  This is pretty exciting news, as I did indeed love FreeNAS and it’s super easy Web GUI.  While I’m happy to see that the project has been carried forward with an updated OS (FreeBSD 9), I’m not going to be doing any switching anytime soon.  I’m pretty committed to Ubuntu Server now, and quite frankly the amount of time required to re-setup all of my software would be too much (not to mention lack of Plex support too!).

I would love to see if someone could port the web admin UI to Ubuntu or Debian for general usage.  Anyone out there that’s handy with porting, please consider this my official request.

Over and out.


the great ubuntu NAS project, even more continued…

Saturday, August 25th, 2012
To maximize my remote file management capabilities, I wanted to install a file manager giving me the same functionality I had before with my FreeNAS 7 server.  This was easy enough since I had previously setup Ajaxplorer on my FreeNAS server, and the steps to setup on Ubuntu are basically the same.  Ajaxplorer has come a long way since I first started playing around with it and it’s now a pretty darned amazing piece of software.  I personally love this because I can view pictures remotely, extremely easily with any web browser – and it looks great!

 

The challenges I had were ensuring I had the right security in place.  Since I installed the Apache2 webserver with Ubuntu Server initially, there wasn’t much to do there, except to setup SSL.  Your mileage may vary, but here’s what I did.

Configure SSL on Apache2

Ok, this is definitely not an quick & easy task so I’m going to redirect you to a couple of resources that I found extremely helpful in getting this all setup.  Everything you need to know for Ubuntu 12.04 SSL certificate generation and apache setup is here:

These other two sites were great also and filled in some of the gaps from the above instructions.

Creating the self-signed certificates:

Setting up Apache2 SSL on Ubuntu:

 

Install Ajaxplorer

  • Step 1: Go to the Ajaxplorer website and download the latest zip (http://ajaxplorer.info).  I’m personally using Ajaxplorer v4.2.0.  There is almost definitely a newer version out there now.
  • Step 2: Unpack the ajaxplorer-4.x.x.zip into a directory off of your webserver root directory.  For example “. \www-ssl\ajaxplorer”.  Confirm that all of the directories and files were created properly and that permissions were set properly (see this page for more details)
  • Step 3: Point your browser to your server IP and new webserver port (i.e. https://192.168.1.101:1234/ajaxplorer) to get started.   A diagnostic tool will be ran once to check that your configuration is ok.  You may get some warnings letting you know if you have any incompatibilities, but Ubuntu has most everything you need already setup.  Despite these warnings you should have a mostly functional web file manager installed.
  • Step 4: Click continue and you should see a warning telling you that the user « admin » has been created with the password « admin » : log in with this id/password, and go the the « Settings » panel to change the admin password.  (Note:  For greater security, it’s best to create a new admin account with a different name, then delete the automatically created ‘admin’ account.  This makes it slightly harder for evil robots to guess the login credentials.)
  • Step 5: Configure your users and repositories. (See this page for more details)

 

Poke a Hole in your Router

Because everyone has a different type of router at home, I won’t even attempt to begin to tell you how to do this.  However, you’ll want to make sure that you port-forward whatever port you defined in your Apache2 configuration above.  You can use a different outside port if you desire, but I like to keep it simple and use the same port number.

Now you can access your stuff anywhere you have an Internet connection.  If you have a Dynamic DNS service to help you remember your IP, even better!

the great ubuntu NAS project, sickbeard + sabnzbd

Saturday, August 25th, 2012

Yup, I jumped on the bandwagon recently and setup sickbeard and sabnzbd on my Ubuntu NAS box.  Sickbeard and sabnzbd and it’s direct integration with Plex are really the most awesome thing since Subsonic that could have happened to my server.  Really.  It’s amazing.  Trust me.

The whole thing took me a few hours (all told) to setup partly because it involves spending my hard-earned cash on certain services and partly because I was bouncing around different sites trying to compile the steps I needed to go through to get it setup properly.  I thought it might be helpful to send out a very quick, no-nonsense guide to getting it installed (but not configured – that’s the time consuming bit).

1. Install SabNZBd Plus

As of the writing of this article, it seems that sabnzbdplus is now part of the ubuntu 12.04 repositories.   If you’re on an older version of ubuntu, you may have to go do some research and add a third-party repository.  As for this guide, I’m going the easy route.  Login to your server and type the following on the command lines:

sudo apt-get update

sudo apt-get install sabnzbdplus

sudo apt-get install sabnzbdplus-theme-mobile

This is going to install a few packages and get SabNZBd Plus installed.  Easy, right?  Yup.  Now go edit the configuration file:

sudo nano /etc/default/sabnzbdplus

Now you’ll need to edit the following:

  • USER=putyourusernamehere

Don’t use ROOT.  Bad things may happen.  Save and exit.

That’s it.  Now go configure it at:

  • http://your.server.ip.here:8080/sabnzbd

I recommend following Ainer’s excellent instructions here:

http://www.ainer.org/sabnzbd-install-setup-configuration-guide-for-ubuntu-linux-mint

 

2. Install Sick Beard

Open up a terminal window and execute the following commands.  Make sure you navigate to your user directory of choice (i.e. /home/username) where you’d like to complete the install.  Same user directory as used above in the Sabnzbd instructions.

wget https://github.com/midgetspy/Sick-Beard/tarball/master -O sickbeard.tar.gz

tar xf sickbeard.tar.gz

This will grab the latest Sick Beard package from the internets.  Then it will unpack the contents of the package to a directory names something like “midgetspy-Sick-Beard-xxxxxxx”.

Now we need to move that into it’s install directory.

mv midgetspy-Sick-Beard-xxxxxxx .sickbeard

sudo mv .sickbeard/init.ubuntu /etc/init.d/sickbeard

sudo gedit /etc/init.d/sickbeard

From here on out you’ll want to configure Sick Beard to work with sabnzbd, setup TV shows to download, etc.  Once again, head over to Ainer’s site to get started:

http://www.ainer.org/sick-beard-install-setup-configuration-guide-for-ubuntu-linux-mint/3

 

Shout-Outs

Thanks to Ainer.org for their detailed instructions.  Without these I’d never have gotten this going… or it would have taken me twice as much time.   Of course, the developers of both Sickbeard and Sabnzbd – please consider donating to them – they make amazing software.  Plex, which I cannot praise enough, is also amazing.  I hope they keep providing Linux based server software for us folks using Plex + Roku.

Also when setting this up you may be considering which news servers to use and which search services.  I personally picked up an account with newshosting for news servers because it was a relatively cheap monthly cost (there are deals out there if you search).  For the search service, I went with NZB Matrix which is a onetime fee for life.  In retrospect, you probably don’t need to add a search service, but it definitely helps improve your likelihood of finding NZBs.

 

Disclaimer

I’ve posted these instructions here for educational purposes only.  Of course downloading copyrighted content is a no-no in most countries so please don’t break the law.

Enjoy!

the great ubuntu NAS project, continued…

Monday, March 19th, 2012

In my last “great ubuntu NAS project” post, I explained how to get an ubuntu server OS up and running with the absolute basics.  Now let’s get this thing customized.  I personally wanted to add the following to my rig:

  • Web UI for Administration (Ajenti)
  • Subsonic
  • Transmission
  • Plex Media Server

Let’s dive into the details…

 

(more…)

the great ubuntu NAS project

Thursday, March 8th, 2012

Here we go folks.  Complete, yet half-baked documentation on how to setup your very own home NAS using free Linux software.  I know this has been written about before, and in fact I have pulled from many fine sources (see my acknowledgement below).  This is documented here mainly so I don’t forget how I did this.  It’s not really for you – sorry internet.  Let’s get started:
(more…)

switching from FreeNAS to Ubuntu Server

Monday, February 20th, 2012

This is basically part two of my previous post about troubles in NAS-land.  That experience got me thinking about switching up my NAS solution.  Here’s why:

  1. FreeNAS v0.7.x is based on FreeBSD which is a fairly foreign OS to me.  Everything, I mean everything, that I do in that OS is a complete and total learning experience.  While it’s easy to setup initially, debugging is a chore.  I’m much more comfortable in either a Windows or Linux environment.
  2. FreeNAS v0.7.x has basically been EOL’d and is now in “legacy” support.  That leaves me wondering about security and stability issues when upgrading to new hardware (see my previous post).
  3. FreeNAS v0.7.x transfer speeds have been shown to be a bit slower than (reference needed) other solutions for SAMBA or NFS.
  4. FreeNAS v0.7.x uses UFS (Unix File System).  Yeah… I don’t know either.  Mounting EXT4 or NTFS is not an option, but would be extremely handy when swapping data around.
  5. FreeNAS v0.7.x has questionable USB drivers which seemed to hang on my system when doing large RSYNC or file copy sessions.  Bad.  Also… slooow.
  6. FreeNAS v0.7.x has PHP4 and Lighttp instead of PHP5 and Apache2.  There were a bunch of cool web applications that I wanted to install on FreeNAS but didn’t because I didn’t want to hassle with installing PHP5 and Apache and screwing up the Web UI.  It looks messy and difficult.

Given that I’m comfortable with Linux (Ubuntu specifically), I was eager to see if I could make the switch to something more Linux’y, and still have the nice features and flexibility of FreeNAS.  Here was what I wanted:

  1. I want to run the OS from a USB flash drive.  Well ideally it would be nice to run it from an SSD, but I’m not made of money.
  2. I want a comparable Web UI to FreeNAS (huge selling point).  Needs to have the ability to manage shares, services, show me uptime, transfer rate, etc.
  3. RAID 1 mirror capability is a must.  I have data that I want protected from a drive failure.  Redundancy is key to my strategy.
  4. Services like SMB/CIFS, SSH, NFS, FTP, etc. are important to access the data.
  5. File system flexibility.  I’d like the capability to attach new storage in different formats.  Linux gives me that flexibility.  EXT4 gives me the performance and the protection from issues like power-outages that killed my previous NAS solution dead.
  6. Remote Bittorrent.  Gotta have it.
  7. Subsonic (hell yes)
  8. Exandability.  I want to install my own web apps, servers like Plex Server, Tonido, OwnCloud, and a host others that would have just been a pain in FreeNAS.
  9. Good hardware support and regular security updates.
  10. Good support community.

Here was my final verdict:

  1. Yes, you can run Ubuntu Server from a USB flash drive.  Some folks have pointed out that USB flash drives may run the risk of wear-out and warn to not install an OS on a USB flash drive.  You can minimize the amount of writes that are targeted at the flash device by removing the swap partition (make sure you have enough system memory for this).  Others say that you should probably never run into a problem with a good quality USB device.
  2. I started to look for alternative Web UI’s for server administration and I stumbled across a few.  I was most impressed by Ajenti (http://ajenti.org), however it’s still in an very early stage of development.  I’ll probably go with this, but Webmin appears to be pretty widely used UI and I may fall back on this to get more functionality.
  3. Yup, I’ve done a lot with RAID Mirroring on Ubuntu in the past.  I’ll just dig up this old post (raiding the archives) and implement a mirror as I did before with MDADM.  Easy.
  4. Check.  SMB/CIFS, SSH, NFS, FTP are all a snap to install on ubuntu.  Just pull from the repositories, configure and off we go.  Ajenti has some capability to manage these services from the Web UI as well.
  5. Yes again.  Flexibility abounds.  I will choose EXT4 thank you very much.
  6. Same as FreeNAS, I’ll pull in the latest Transmission Deamon.
  7. Yup – and easier to install, upgrade and manage on Ubuntu.  It’s a deb package so I won’t have to much other than configure it once it’s installed.
  8. Resounding yes.  I will have full flexibility to install the latest PHP, Apache, MySQL, etc… this means I can go crazy installing other fun projects on the NAS in the future.
  9. Yes and yes.
  10. Yes – while FreeNAS has a great community, Ubuntu has a bigger user base and a bigger support community.

So that’s it.  I’ve made up my mind.   Ubuntu Server here we come.   It’s going to be quite a project to get this initially setup, but I think it will be an enriching and useful project.  It’ll open my home server up to new capabilities and hopefully enhanced performance.   FreeNAS is great, but it’s sort of like riding a bike with the training wheels on.  It’s time to ride on two wheels now.

P.S. I should also mention that during my research, I ran across OpenMediaVault (http://openmediavault.org/).   The original FreeNAS project forked into two projects.  The first fork was FreeNAS 8.0 based on FreeBSD8, which is aimed at higher-end server equipment.   I avoided this version because it is still in it’s infancy, requires a kind of ridiculous amount of power and it’s still based on FreeBSD.  I recently discovered that the second fork is actually a Debian Linux based fork aimed more at the home NAS market.   Now they have me second guessing things.  Since it’s based on debian, perhaps this would be the easier route… naw.   

troubles in NAS-land

Wednesday, February 15th, 2012

If you’ve followed my blog in the past, you probably have noticed that I have been a big fan and user of FreeNAS for my home NAS needs.  FreeNAS is a great project and quite excellent for those who want a basic, easy to use, polished NAS OS for free.  I can’t speak enough to how good FreeNAS is.  However, recently, I’ve had some challenges that caused me to re-think my home NAS strategy.

I should probably follow the old saying that “if it ain’t broke, don’t fix it”.  In this case, I totally disregarded that wise advice and “fixed” with wild abandon.  With my current NAS operating relatively glitch free for over a year on FreeNAS, of course it was time for some upgrading and tinkering.

It started out as an idea for offsite backup, which involved installing duplicity (which turned out to not be that hard), which presented some challenges.  More on that later.  I was also doing some large file transfer across my home network, which is gigabit but was struggling to achieve a decent transfer rate.  I decided after some research that my hardware was holding me back, it was probably my 2-3 year old chipset bottlenecking transfer speeds.  Fortunately, I had just decommissioned another system in my home with considerably greater horsepower.  That’d be great to replace this aging slow NAS system.  So backed up my data on the NAS to some old HD’s laying around the house (slowly… across the network), and switched to the new hardware.  Upgraded FreeNAS in the process to the latest stable v0.7.2.  Restored my config.  Good so far.

Then, my FreeNAS box started rebooting randomly.  Worse, it rebooted and hung while we were away in Hawaii for two weeks.  Nothing I hate worse than having no access to my tunes, let alone other data, and having a broken system that I can’t do anything about, a thousand miles away.  At first I thought I was getting power-outages.  But I discovered later that it was nothing to do with our power at the house.   After a look through syslogs, and some internet searching I found my problem.  Corruption.

I was able to run fsck (file system check) on the RAID array and get the darn think back serviceable again… but the reboots continued.   What… the… hell.  I started to go through my mental checklist of what could be going wrong with the system.  Why the crazy random reboots?  And absolutely no warnings in the log files, no errors, no kernel panic, nothing.  Had to be something with the motherboard, cpu, memory or power-supply or something.  After a while I decided to replace the motherboard first… which forced me to replace the memory.  Two more variables removed.  Still, reboots.  Finally I replaced the power-supply.  Bingo – problem solved.   Why did I even bother to do an upgrade in the first place?!

Well, at least we are stable for now.  Stay tuned for part two… switching to Ubuntu Server from FreeNAS.