Daily Newspaper on E-Book Reader via Arch Linux

My friend x23b5 has an Amazon Kindle and wants to read daily newspapers each morning.

Time for a cron job on my Pogoplug to send some newspapers to this Kindle 🙂

There is a pretty cool package called calibre.
It can convert online newspapers to ebook specific files and send it via email to your eBook Reader.

Install calibre

Calibre uses recipes to fetch news and convert those to ebook files like .mobi or .epub.
You can list all available recipes with the following command:

Note: It’s a good idea to create a new email for this task because your password will be saved in plain text. Use a freemailer or create a new user on your own mailserver.
Create the following file in /usr/local/bin/calibre-cron and replace all variables and recipes with yours.
I used another usb stick (cacheStick) to save the temp files because I want to protect my arch linux stick.
To change the output format just change the file extension.

Make it executable:

Execute it and check whether it works.

Now we have to create a cron job to execute this script each morning.
Execute this command before you edit your crontab file.

Edit your crontab file:

> /dev/null 2>&1” because I don’t need any email or log output.

Now enable cron service:

Calibre is pretty memory and cpu intensive and takes pretty long! You should run it overnight otherwise your plug pc will be very slow.

How it looks like:

Kindle newspaper

Setup Samba 4 on Arch Linux

Updated: [03.05.2015] Sync some performance settings with my own personal settings, added a link to some more performance tips (see bottom).
Updated: [28.09.2015] Sync again

Note: Check this article if you want to install arch on your pogoplug.

Samba 4 is out now 🙂
So I’ll make this tutorial for Samba 4 because it seems to be slightly faster.
This article will tell you how to install it on your PogoplugV2 or another PlugPC.
Should be pretty much the same for all arch installations.

Samba 3 is going to be removed once Samba 4 is installed.
Your old config will be saved to /etc/samba/smb.conf.pacorig

Installation of Samba 4 is pretty easy.

Now enable the services.

Create Users

If you want to create shares for multiple users you have to create new Unix user and add this one to samba as well.
To make it clean we will create a group called “samba”.

Now we can add a new user to this group. This user “fabian” is not able to login (-s /sbin/nologin) for security purposes.

To use this user in samba shares you have to add it to samba

Create Shares

We are ready to configure our samba shares.
At the beginning configure
To do so edit /etc/samba/smb.conf

Here is an example configuration.
You have to edit the Share definitions below so it fits your setup.

Optimize performance

The stock performance of samba isn’t that great. Especially with NTFS.
But there are some parameters which will increase Samba performance significantly.

Add all these settings to the global section in your smb.conf file.

The main problem for slow file transfer speeds is NTFS, because NTFS needs much CPU on linux.
Nevertheless there are 2 options which will boost the speed:

write cache size

If this integer parameter is set to non-zero value, Samba will create an in-memory cache for each oplocked file (it does not do this for non-oplocked files). All writes that the client does not request to be flushed directly to disk will be stored in this cache if possible. The cache is flushed onto disk when a write comes in whose offset would not fit into the cache or when the file is closed by the client. Reads for the file are also served from this cache if the data is stored within it.

This cache allows Samba to batch client writes into a more efficient write size for RAID disks (i.e. writes may be tuned to be the RAID stripe size) and can improve performance on systems where the disk subsystem is a bottleneck but there is free memory for userspace programs.

The integer parameter specifies the size of this cache (per oplocked file) in bytes.

Default: write cache size = 0

Example: write cache size = 262144 # for a 256k cache size per file

Some example values are:

(262144 = 256KB – you should test some values it’s pretty memory intensive)

Don’t forget to start the samba services or reboot:

For some additonal performance tips check this blogpost: https://linuxengineering.wordpress.com/2014/08/03/performance-tuning-with-pogoplug-v4/