Calkin
============
ONLY Tested on Ubuntu 12.04 TLS (bash version 4.2.45(1)) + Kindle K3W + apache2 + php 4.9.4
============
"Features" (or: what is this?):
- First all all: No binary blobs, very small, you can check everything for yourself. You don't have to trust me.
- Calkin relies on Calibre for the fetching of news feeds
- "one-way" sync any file (e.g. binaries, pdf, epub, mobi etc.) from a specified location to your kindle (e.g. parts of you library) (it uses md5checksums to reduce bandwitdth)
- Once setup, you just have to have your wifi on and the server (or whatever you are running) on, and you will be provided with fresh news in the background
- This was bourne out of lack of a better alternative (e.g. paid subscription and dependency on even more services and servers), with this just the kindle, your box (and if you want news, the site from which you want to fetch them) have to be online (or rather:connected). 
- The Process:
Server: Cron calls fetch.sh -> get's list of recipes, calls calibre, which fetches them. Time is tracked. A file for the Kindle <-> Server communation is generated. 
Kindle: Cron on Kindle calls calkin-kindle-sync -> calkin-kindle-sync checks wheather connection to server is possible -> Generates list of files already fetched to (hidden?) location and md5sum of files -> Uploads list to server -> Calls script on server, server generates md5sum of every file contained in defined folder (on server) and checks them against the ones in the kindle list -> Provides download links for kindle -> kindle replaces changed files with new ones, updates home screen.
============
Requirements:
-Calibre for your distro
-Newsfeed recipes for Calibre
-VServer, HomeServer, etc., at least Apache2 (sudo apt-get install tasksel,sudo tasksel Web-Server) (or virtual)
-or just a webspace with file access (than you have to upload the files (e.g. via ftp or the like); tweak as you like)
-corresponding port forwarding to Server and Firewall exceptions

-Kindleside: Jailbreak, Usb Network (?)
============
Howto: 
-First off: There are only three files, look into each one and configure as needed. I tried to store the variables nessesary for configuration at the beginning of the file, so you don't have to did too deep.
Chaging the following file affects the others (e.g. they need to be changed accordingly); if you change the config after you installed it already, everthing with "apply" is not affected by the chages anymore (e.g. the corresponding, next relations can be skipped):
--./apply: Path and Name -> calkin-kindle-sync must be tweaked
--kindle/calkin-kindle-sync: $host <-> your general config; $hostlist <-> server/fetch.sh $hostlist etc.; $checksumefilename <-> server/fetch.sh $checksumefilename, or in src/alpha.php

-Kindle in network mode, connected (ready for connection with ssh or the like), change $KINDLEIP in ./apply to your needs.
-copy server/fetch.sh after needed changes to a location of your pleasing and (if needed) create an entry for it in the cron of you system.
-Feed the $LINE in server/fetch.sh with a String of the needed recipes, point 
-If you have run it and confirmed everything is working, I advise you do set $createhostlist=false in server/fetch.sh, because otherwise it is created every single time.
-If you run this on an exposed box you may want to make sure that the upload mechanism in $hostlist is a little more secure, as well as chmod 777 -R $pathtoop$hostdir in fetch.sh
-That's it!
============
Troubleshooting:
-If the $hostlist file is not to your liking (or is not created), feel free to copy it from src dir wherever you want. 
-apply doesn't work: copy kindle/calkin-kindle-sync whereever you want on your kindle, and create a cronjob for it (as seen in apply)
============
Known limitations:
-Currently weird filenames (with whitespacesetc.) don't work
============
Roadmap:
If I can manage to change a thing or two, it would be the effeciancy, e.g. the
-"check" in the kindle uploader, the deletetion of temp files, two files for up and downloading etc. 
-The $hostlist opens the dirs as often as there are files... pretty stupid. Would be better to store it in an array

-Encrypted Transfer (for global communication) (SSL, or symmetric etc.)
....

