Thursday, March 28, 2013

No more Google Reader? Try Tiny Tiny RSS!

It's old news now but, in case you've been living under a rock, I should let you know that Google Reader is shutting down. As a result, many users, myself included, have been looking for a solid replacement. I'm happy to report that I think I've found my new home in Tiny-Tiny RSS. After trying out many other alternatives, among them The Old Reader and Feedly I have found that this simple, self-hosted solution really does everything I want. What's more? Did I mention it's Self Hosted!?

At this point you're probably asking yourself, "But Ted, why would I want to go through all the effort of setting up and maintaining my own server just for an RSS reader?". A local RSS reader has it's limitations. Sure, you could copy your reader's config around with you on a flash drive or use a cloud storage solution like Owncloud to move it around your machines, but then you have to figure out what reader works on all of your platforms. A web reader is, generally, a much more flexible route as it, usually, works on all platforms and Tiny-Tiny RSS even has a native Android app. So why not just use a hosted solution like Feedly, TheOldReader or GoogleRea.... oh, right, because these are run companies who have the right to shut down down a product whether you like it or not. By hosting it yourself, you only have to answer to what you want, it doesn't have to shutdown just because the rest of the market would prefer to hear what their neighbor had for breakfast on the insert latest social media/micro-blogging site, you control the site, you control the content, you control it's fate.

I found Tiny-tiny RSS to be extremely easy to set-up. Now, don't say, "But you're a sysadmin, that's not saying very much". Well, I pride myself on trying hard to analyse things from the average user's (or at least average Linux user's) perspective. If you know how what the terminal is, can edit a plain English configuration file and have a spare computer or shared web host just laying around (or even if you don't), Tiny-tiny RSS takes only a few minute to set-up.

The Install

The installation of Tiny-tiny RSS requires that you have a web host running php and mysql or postgres. I've outlined the basic installation procedure below:
  1. Download the .tar.gz file from here (as always, make sure you get the latest version).

  2. Extract this to your web directory. On most servers this will be /var/www. Make sure your apache user owns this directory, on Ubuntu you can do this with: chown -R www-data:www-data /var/www/ttrss

  3. Once you've downloaded the files and extracted them to your web directory, you need to tell apache where to look. Since you're going to be logging in to this server, you'll probably want to use HTTPS. It's not necessary but I strongly encourage it. I've copied my server configuration below as an example of how to do an port 80 (http) to port 443 (https) redirect to make your life easier when navigating to your feeds as well as the main apache configuration I used. If you're lucky enough to have a server running Ubuntu or Debian (or other Debian dirivative that uses the /etc/apache2/site-available directory structure) you can just copy paste these two files to /etc/apache2/sites-available and proceed.

    /etc/apache2/site-available/yoursite-redirect
    
    <VirtualHost feeds.yoursite.com:80>
        RewriteEngine on
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*)$ https://%{SERVER_NAME}/$1 [NC,R,L]
    </VirtualHost>
    

    /var/apache2/site-available/yoursite
    
    <Virtualhost feeds.yoursite.com:443>
        ServerName feeds.yoursite.com
        ServerAdmin admin@feeds.yoursite.com
    
        DocumentRoot /var/www/tt-rss
    
        SSLEngine on
        SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
        SSLCertificateKeyFile   /etc/ssl/private/ssl-cert-snakeoil.key
    
        <Directory /var/www/tt-rss>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/feeds_yoursite_error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel info
    
        CustomLog ${APACHE_LOG_DIR}/feeds_yoursite_access.log combined
    
        Alias /doc/ "/usr/share/doc/
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from 127.0.0.0/255.0.0.0 ::1/128
        </Directory>
    </VirtualHost>
    

  4. Disable the default apache configuration and enabler your new ones:
    sudo a2dissite 000-default && sudo a2dissite default-ssl
    sudo a2ensite yoursite && sudo a2ensite yoursite-redirect

  5. Since we're using apache's ssl module along with the apache rewrite module to redirect you to https://, we need to enable two modules:

    sudo a2enmod ssl && a2enmod rewrite

    enable php as well if not already:

    sudo a2enmod php

  6. Restart apache:

    sudo service apache2 restart

  7. Set cronjob for www-data to refresh feeds periodically. To do this run the following command and paste the following line (making changes where appropriate for your site). The example I have given will refresh all feeds, for all users, every 30 minutes.

    sudo crontab -u www-data -e

    */30 * * * * cd /var/www/tt-rss && /usr/bin/php /var/www/tt-rss/update.php --feeds >/dev/null 2>&1

That's pretty much it for the install. In addition to the web interface, you can also download the Android app from the marketplace. It's free for the demo and only a few dollars to buy forever. I have used the app for a few days now and have come to like it almost as much, if not more, than I loved the Google Reader app.

Friday, January 4, 2013

Syncing Encrypted Files Between Multiple Platforms

This is going to be a fairly short and quick how-to on syncing encrypted files between different systems running different operating systems. The software we will be using is EncFS (on Linux) and Boxcryptor (on everything else).

First thing we need to do is choose what we're going to use as the common storage point for the encrypted files. Boxcryptor supports Dropbox, Google Drive, SkyDrive, WebDav and SD card. Since Google hasn't gotten their act together on a Google Drive application for Linux and I don't have anything running WebDav, I chose to use Dropbox.

Download Boxcryptor to your device (I chose to use my Android phone) and select to connect it to your drop box account. Once connected, click the button to create a new encrypted folder. Once you have done this, we can move on to setting up your Linux desktop with EncFS. If you don't have any Linux systems (shame on you) you can stop here and repeat this process of setting up BoxCryptor on your other close source platforms. The only difference being that instead of creating a new folder, you'll be selecting the one you created from your first device.

Setting up EncFS on Linux can be a bit tricky. This is mainly due to the fact that a lot of tutorials I found around the web recommended that you use the "CryptKeeper" application as a front end. I tried this and it was terrible. I would recommend skipping it all together and just using the command line utility "encfs". To do this, use your package manager to download fuse-encfs. "apt-get install fuse-encfs" on Ubuntu and "yum install fuse-encfs on RHEL/Fedora". Next, download and install the dropbox build for your distribution. Sign in to your account and let it sync your files. Once it finishes synchronizing we're ready to set-up the encfs mount. Run "encfs ~/Dropbox/path/to/folder.bc ~/mount/point/for/encfs". This will prompt you if you want to create the mountpoint (if it does not yet exist) and then your encryption passphrase.

Thats it! It's important to note that in order for files to be encrypted, you must access the directory via the mount point, not the raw directory within dropbox. To demonstrate this, you can create a text file within the "~/mount/point/for/encfs" and put some random jibberish in it. Save the file and then try to read the file from the raw directory, in this case, ~/Dropbox/path/to/folder.bc. You'll notice that the contents of the file when viewed outside of the mountpoint is scrambled.

Please feel free to ask any question in the comments section, I'll be happy to help you out if you get stuck or send me a message on Google+ if that's more convenient.

Thursday, December 1, 2011

Using Rsync to Backup Windows

I don't normally write about Windows and I don't think I would consider today's post to be any different. That said, I am going to post about something related to Windows. I recently made the switch from Red Hat Enterprise Linux 6.1 back to Windows 7 for day to day work on my office workstation. The reason behind this was mainly just software compatibility. I found most of my work was being done on my secondary Windows workstation anyway and decided that the few advantages Linux had over Windows, for my purposes in a 70% Windows corporate environment, were just not worth the hassle of maintaining two workstations. As of yesterday I'm now running off of my HP Elitebook with Windows 7 Enterprise edition. With this switch has come several challenges, not the least of which was how to make sure I had regular, local, backups of my data.

My laptop has a 120GB SSD in it and, while they are getting better, I still don't trust the reliability of MLC SSDs. In the past, under Linux, I had just been running rsync as a cron job ever few hours while I was in the office. This had been working very well for me for some time and I wanted to find a way to accomplish the same thing under Windows. Enter a project named Cygwin. Cygwin allows you to run Linux applications inside of your Windows environment; setup is easy and you can easily expand the selection of available tools by re-running the installer. I opted to give this a try by installing a few simple utilties, bash, openssh, openssl, git and rsync.

Since this provides you a full bash shell you are able to create bash scripts just like you would in a real Linux environment so I set off creating myself a quick backup.sh script that would use rsync to back up C:\Users\my_username. I've posted the results of my work below, feel free to copy this and use it on your own windows system for backups. Feel free to post any comments or questions in the comments section below as well.

Note: Don't forget to change the variables I've noted in the comments in the script.


#!/bin/bash
#
# Will backup /cygdrive/c/Users/$username to /cygdrive/$drv/$hostname/Users/$username
#
## Change these values to match your computer
#
hostname="MY_COMPUTER" #Name of your computer
drv="g" #Drive to back up to
username="YOUR_USER" #Your username
## You might need to change "c" on the next line if your users folder is elsewhere
bkpfrm="/cygdrive/c/Users/$username"

## Nothing below here should need to be changed

# Check that drive letter entered is present, else prompt
while [ ! -d /cygdrive/$drv/ ]; do
read -p "$drv:\ does not appear to be a valid drive letter, please enter the correct drive letter: " drv1
if [ ! -z $drv1 ]; then #Change drive to new value if one is entered
drv="$drv1"
fi
done
rsync -au --delete $bkpfrm /cygdrive/$drv/$hostname/Users/$username

Monday, November 21, 2011

Android Hacking on the Kindle Fire

I've been working recently on making the new Amazon Kindle Fire do everything that Amazon doesn't want it to do. Among other things, after a few days of tinkering and hacking away on the Android Developer Bridge (ADB) I now have a fully rooted Kindle Fire. In addition I've also been working to get all of the Google Android apps working and here is the progress so far.

1. Rooted the Kindle Fire using the well publicized "SuperOneClick" method.
2. Loaded the Google account manager (required step for the applications to follow).
3. Loaded Gmail, Google+, Android Market and several other applications.

At this point with those three steps I've managed to convert what was intended to be a simple ebook reader into a fully featured Android tablet (now we just need an Android 4 rom). If you have a Kindle Fire and wish to do the same as I've done to yours head over to xda-developers.com and take a peek at kindle forums.

Speaking of Android 4, ICS, I have started playing around with compiling my own Android 4.0 ROM. So far I've not made a lot of progress but I'll definitely update in a post here once I've successfully booted my first ROM.

Saturday, November 19, 2011

The Eee is dead and a mini MAME system is born

I must apologize to those of you who follow me. I've been absent recently and I would like to take a moment and try to explain why.

For those of you who know where I work, I don't need to explain too much, you know it's been a busy month at the office. In addition, as the title of the post states, my brand new laptop has sadly processed it's last bit, at least for now. For those who don't know, the laptop took a tumble last month while I was getting into my car on my way into the office. I was in the middle of writing a review on the performance of Ubuntu 11.10 on the Eee 1215B when this occurred. After the fateful tumble the touchpad frequently malfunctioned, requiring me to shutdown and pull the battery out to reset it. I tried for several days to repair it and call Asus about acquiring a replacement wrist rest. I was unsuccessful in my repair attempts and was told my Asus technical support that a replacement was not available. This effectively brought a halt to my review and the search for a replacement test machine is still ongoing. As unfortunate as this was I do not believe this will be the EOL for this machine.

I was fortunate enough to attend SkyDogCon earlier this month. At the conference I began talking with one of the members of Unallocated space, a hacker space in Maryland, who had brought with him a device called a "MAME box". For those who are unfamiliar with MAME (Multi Arcade Machine Emulator), it is a cross-platform application designed to play classic arcade and video games. A few days later I came across the Nanocade and decided that I could give the Eee new life as a desktop arcade machine. If you go to my Google+ page you can check out the first prototype design I made in Sketchup for the housing. The system is undoubtedly going to run some incarnation of Linux, likely Debian or Arch. Subscribe to the blog to stay up to date on my progress as I move forward with the project.

Thursday, September 15, 2011

Further thoughts on the Eee 1215B

So, I'm a few more weeks into using my Asus Eee 1215B netbook. I'm still very happy with it. It's nice and light and the battery life is wonderful. I've been having a lot of issues with it and Linux compatibility, however. I had to run Ubuntu 11.10 Beta-1 in order to resolve a suspend/resume issue I was having. Overall 11.10 is pretty stable but I did run into a few instances here and there where an application would crash, normally a background application though. In addition, I found another particularly annoying bug with the Fn-F9 key. This key combination disables the touchpad, which can actually be kind of useful if I'm typing a lot, and while the first time you press the button it works as it's supposed to (IE turns off the touchpad) I have yet to find a way to turn it back on short of re-creating my home directory. After doing this several times yesterday to fix my accidental button presses (the volume button is right next to the trackpad button) I decided to try something else. I checked out the top picks on the Distrowatch page. There I found a few candidates to try out.

The first candidate was Bodhi linux. I had heard good things about it it and I wanted to give it a shot. Bodhi is an Ubuntu based distribution that uses the Enlightenment E17 window manager. I've always wanted to try that windows manager out. I was sorely disappointed, however, to find that the installer would get stuck at a snowy looking still image at boot and would not move forward. Both the normal and "failsafe" install methods exhibited this same behavior.

The second candidate was Lubuntu 11.04. This is an Ubuntu derivative which uses the LXDE desktop environment. I was again disappointed, though not terribly surprised, that Lubuntu 11.04 had the same suspend/resume issue that Ubuntu 11.04 did.

The third candidate, Crunchbang 10 "statler", is a distro I use on my older Pentium III laptop. It's extremely light weight and based off of the Debian/GNU Linux operating system. I was more successful with Crunchbang than I had been so far with the others. It booted up fine (and quick) but sadly to a 1024x768 resolution. The 1215B has a widescreen monitor so this didn't look quite right. Upon further investigation, this appears to be a known issue with the Radeon HD6250 video cards and is only a problem in the live environment. I will likely return to Crunchbang if Lubuntu 11.10 Beta-1 does not prove any better.

This brings me to the distro I'm currently trying out, Lubuntu 11.10 Beta-1. Again, based off of the Ubuntu 11.10 Beta-1 I was using previously, I expect it to have some of the same bugs, most notably the touchpad issue mentioned early.

I'll add a quick follow up after I settle on a distribution to report on what I ended up with. Though I have a feeling it's going to be Crunchbang 10 from the looks of it.

Saturday, September 10, 2011

Ubuntu 11.10 Beta 1 on an Asus eee 1215B

I purchased an Asus eee 1215B netbook recently with the intent of replacing my IBM T61 for day to day mobile computing. The computer, from the factory comes with a dual core 1Ghz AMD Fusion C-50 APU. It's also equipped with 1GB of DDR3 RAM and a 250GB HDD. I was able to get the laptop for a very reasonable price so I was able to treat it to a 4GB kit of DDR3 and a 60GB OCZ Agility3 SSD. For an operating system I chose Ubuntu 11.04 (before you say I made a typo, keep reading). My first impression with this combination of hardware and software was impressive. I had believed that the 1Ghz processor would hamper performance and that the integrated graphics chip would cause Unity to be sluggish. I was happy to find that I was very wrong. The performance of this little computer couldn't really be any better. You do notice a little lag here and there, but overall, it's very usable. I did find one small annoyance, however. The Radeon drivers included with Ubuntu 11.04 have a bug that prevents the laptop from resuming from suspend successfully. After a bit of digging on the Ubuntu forums, I discovered I was (thankfully) not the only person experiencing this issue and that some had had success upgrading to 11.10 Beta 1. I gave it a shot and got off to a bit of rough start. I had tried installing the proprietary (full 3D acceleration support) Radeon drivers and noticed visual artifacts after resuming from suspend. After removing the proprietary drivers the video never returned to normal so I re-installed. After I re-installed, I avoided installing the proprietary drivers (the default open source ones seem to work just fine) and worked, and is currently working, just fine.

I've been using the laptop for about a week now and I'm very very happy with it's performance. It boots up in just a few seconds and the battery lasts for about 8 hours. I replaced the hard drive with the SSD to increase the battery life and it appears to have had the desired affect as several reviews about the laptop claimed the battery lasted only about 6 hours. There is a little bit of graphical lag from time to time while under heavy processor load, but this was expected given the low end processor. Firefox, however, as well as some of the other commonly used applications open just moments after clicking them open and are just as snappy as my desktop once open.

One of my only complaints about this laptop is that you have to take the whole machine apart and void your warranty to replace the hard drive. Doing this is not particularly difficult but there are several tabs around the edges of the plastic pieces which break very easily while disassembly. I've noticed that the corners of the laptop do not sit flush any more since replacing the hard drive, now, due to some broken plastic clips. I believe Asus could have done a better job of taking a queue from other IBM's T series laptops and skip the clips all together (or just make the laptop more easily removed). Another small annoyance is that the keyboard is held secure underneath by small strips of adhesive padding. once you remove the keyboard once, however, it never quite sticks right anymore and gives the keyboard a slightly loose, almost cheap, feel. This was just yet another disappointment about the build quality of the machine.

All told the laptop is reasonable. While the build quality leaves a bit more to desire. The fact that it came with a price tag of just around $250 ($400 with all upgrades) and was able to replace my T61 for every day mobile computing. It's good for the price and I would recommend it to anyone looking for a highly mobile computer. If you need a smaller footprint Asus also offers a 10" model as well.