How I (almost) permanently logged off the cloud - Part 2 - Calendar and Contacts

by Viktor Hansson on 04 February 2015, 15:38

Tags: self-hosted calendar contacts carddav caldav radicale

Now we've come to the second part of this series, and this is actually a quite simple one. The topic is that of calendar and contacts.
 
Up until now I have used what most other people user, either google or icloud. This is mostly due to convenience, which is most often the deciding factor. Having all your contacts and calender appointments downloaded by just signing into one account is great, and is in fact the way it should work. But google and apple knowing who I contact and what I do (honestly its most probably possible to get this information anyway, I imagine both of those companies store the call logs and related data, but this at least makes it more difficult to systematically monitor ones habits) is not someting I like.

Unlike file syncing, both calendar and contacts can be synced over standard protocols, which work on all devices I use (iOS, Mac, Linux, Windows and Android) with minial effort. These protocols are called CalDAV and CardDAV.

So after a little bit of googling I found a program called Radical which is both a CalDav and CardDav server. A few hours and some testing on my test VM I concluded that it worked really well, it is both quite simple to setup, and works good with all clients I have tested it with (Thunderbird, iOS, Android).

As usual i have added the radicale config to my config gists
How I (almost) permanently logged off the cloud - Part 1 - Files

by Viktor Hansson on 01 February 2015, 17:49

Tags: self-hosted mail smtp imap postfix

So I'm not really sure how to begin this post, it's going to be a long one.
I split it into parts, one for each service I switched:
  1. File syncing
  2. Contact and Calender
  3. Mail

If you have not been able to figure out what this will be about based on my previous posts and my general persona, I can tell you now that in this series I will explain how I stopped using various "cloud services" and switched to self-hosted solutions.

File syncing
One important part of keeping files these days is the automatic folder->server sync. The king in this area is without a doubt Dropbox, and their product is really fenomenal, it rarely, if ever, fails to sync anything, the speeds could be better but they could also be a lot worse. The desktop client works well on all platforms, the mobile app is great. I could go on, however the very arcitecture of their product makes Dropbox a non-option. There is no way of setting up your own backend, everything is synced to their servers. And the thing is that this is the case with all other similar providers: Google Drive, M$ Skydrive, Box etc.

Owncloud
This is where owncloud comes in. From my years of searching this is the only software with open sourced frontend and backend. The software is not nearly as good as that of dropbox, on any front. The desktop clients is rather slow to pick up changes, the iOS app is really crappy, the webgui is getting better, but still not close to Dropbox. But being self-hosted and free makes it the best option for anyone looking to set up a filesyncing service. 

The setup process for an owncloud instance is quite difficult, and requires much time so I won't write a half-assed tutorial, other people have already written better stuff than I could ever do. Here is one for doing it with a ubuntu server.

File server
File syncing is great, but its not ideal in all cases. For example your media library. Mine is currently at around 800GB, and having all of this synced to every computer I own would be a real waste.
So for this I setup a system on my NAS VM, where I can create a new linux user with a home directory in /home/. This directory can then be accessed through sftp, ftp, smb and http(only read). This system is actually very good, because it makes it much easier to keep all my files in just one place, instead of spreding them out all over my environment.
The configs related to this can be found in my fileconfig gists

Git
So I currently have about 20 repos for my personal projects, and just having these as directories on the server works, but it's far from ideal. One option is to pay for github to enable having private repos, however this still means that all my code would be hosted on their servers. So after some research I found out that the only real option is gitlab, which comes close to github in both features and interface. However gitlab can be a real hassle to install, especially on an Arch linux server, since they don't have an official build for this distro. 
But never fear, the trusty AUR contains one package that with some alterations can be installed on Arch. I won't go into details, mostly since the Arch wiki covers most of it, but I will mention that if you try this for yourself you most likely will run into a problem where showing all groups will display a 500 error, as well as trying to delete groups or repos will show the same 500 error. This turned out to be a problem with the ruby version. From the arch repos I believe the most recent version (as of writing this) is 2.2, but gitlab will not yet function without ruby 2.1.5. After getting that installed however I can no longer start vim, since some required ruby lib is no longer available. I have not yet found a solution to this problem.

EDIT(May 26:th 2015): I found a solution to the vim problem: compile vim from source. Quite simple really, just followed the guide at https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source
New Server

by Viktor Hansson on 09 January 2015, 19:31

Tags: server linux hypervisor arch

Since I started working at Data Ductus I have had to do a lot of server configurations, which has improved my knowledge of networking and linux vastly. These servers are of course virtual machines hosted in a cluster of physical hosts. And after having been exposed to this setup so much now I decided to upgrade my own server configuration. But my needs are not exactly that high so I opted for building a server from scratch, using ordinary desktop pc components to keep the cost at a minimum.

The host I built is hosted(yes pun intended) in a mini-itx case, with a 4-core i3 CPU @3.40 GHz, with 16GB RAM and a 128 GB SSD for the hypervisor OS and some of the most used vms. I have currently installed a 1.5 TB HDD and as soon as I have migrated my current physical server to a vm I plan on fitting the 2 TB HDD from that in the new one.

For the hypervisor part I opted for Arch Linux with qemu using kvm for optimal performance. This together with webvirtmgr makes the vm management fairly painless, although not quite. Currently autostarting vms with the host is not working, due to the bridge interface not being started before the vms are started, so the start fails.

At the moment I only have one vm active, called NAS. My plan is to use this only to host files, nothing else. The server shares each users home folder using the users credentials on both scp + ftp + samba right now, which is very convenient.

EDIT: So I finally managed to get the vms to start, although it is not pretty...
I put a script  in /root/start.sh

#!/bin/bash
sleep 20;
systemctl restart libvirtd

and added this in my /etc/netctl/bridge

...
ExecUpPost="/root/start.sh"
...

So while it may not be the best solution, I will probably settle for it since it works at least.

Raspberry Pi magnet lamps

by Viktor Hansson on 16 November 2014, 19:19

Tags: rpiremote

After a long wait for the magnet switch I ordered from ebay I took a little time today to try it out. After fighting my way out of dependency hell regarding python/rpi.gpio/pip I managed to produce a simple little script which sends an http request to my rpiremote system and switches on a lamp when the magnet approaches and switches it off once the magnet is removed. 

I intend to use this in a little more sophisticated way to turn on the lamps in my bedroom (where I keep my clothes) in the morning when I get up. I already have the lamps outside the bedroom set up to turn on when my alarm clock rings, but since I get up at different times every morning I can't have the lamps inside my bedroom on a timer, hence the magnet contact on the door.

Øredev 2014

by Viktor Hansson on 06 November 2014, 08:16

Tags:

So yesterday I attended Øredev for the first time (never heard of it before this fall). Not a lot to say about it, I'm not one for large gatherings of people. I did attend some interesting talks (and a few not so interesting). My favorite ones were probably the final keynote by Dan North, who was really an impressive speaker, and one titled "Confessions of an accidental security tester", given by Alan Richardson. 

Newer

1 2 3 4 5

Older

About Me

This is my personal blog where I might write some interesting stuff. I have some examples of 3D javascript/webgl things in the works which should be done in the comming months, so be sure to return somewhat regularely.

Featured

Internet Cryptography Series

See also...

Blankycan
Terali
Andréas Söderberg