Commit 6e2e6b65 authored by CORP\skazi's avatar CORP\skazi

Remove template blogs and add self-hosting adventures 1 post

parent cc9cc9d2
+++
date = "2015-12-21T04:05:25-06:00"
draft = false
title = "Les Misérables by Victor Hugo"
+++
Although this detail has no connection whatever with the real substance of what we are about to relate, it will not be superfluous, if merely for the sake of exactness in all points, to mention here the various rumors and remarks which had been in circulation about him from the very moment when he arrived in the diocese.
### Bool
True or false, that which is said of men often occupies as important a place in their lives, and above all in their destinies, as that which they do. M. Myriel was the son of a councillor of the [Parliament of Aix](https://en.wikipedia.org/wiki/Parliament_of_Aix-en-Provence); hence he belonged to the nobility of the bar. It was said that his father, destining him to be the heir of his own post, had married him at a very early age, eighteen or twenty, in accordance with a custom which is rather widely prevalent in parliamentary families. In spite of this marriage, however, it was said that Charles Myriel created a great deal of talk. He was well formed, though rather short in stature, elegant, graceful, intelligent; the whole of the first portion of his life had been devoted to the world and
to gallantry.
> "The halls are nothing but rooms, and it is with difficulty that the air can be changed in them."
This conversation took place in the gallery dining-room on the ground-floor. The [Bishop](https://www.youtube.com/watch?v=dQw4w9WgXcQ) remained silent for a moment; then he turned abruptly to the director of the hospital.
+++
date = "2015-12-21T04:03:46-06:00"
draft = false
title = "Metamorphosis by Franz Kafka"
+++
### Part One
One morning, when *Gregor Samsa* woke from troubled dreams, he [found](./) himself transformed in his bed into a horrible vermin.
> He lay on his armour-like back, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections.
The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked.
### Part Two
It was not until it was getting dark that evening that Gregor awoke from his deep and coma-like sleep. He would have woken soon afterwards anyway even if he hadn't been disturbed, as he had had enough sleep and felt fully rested. But he had the impression that some hurried steps and the sound of the door leading into the front room being carefully shut had woken him.
* He pushed himself over to the door, feeling his way clumsily with his antennae - of which he was now beginning to learn the value - in order to see what had been happening there.
* The whole of his left side seemed like one, painfully stretched scar, and he limped badly on his two rows of legs.
The light from the [electric street lamps](https://en.wikipedia.org/wiki/Street_light) shone palely here and there onto the ceiling and tops of the furniture, but down below, where Gregor was, it was dark.
+++
date = "2016-08-13T04:05:25-06:00"
draft = false
title = "Self-hosting Adventures Part 1: Introducing Io"
+++
With the threat to privacy and information security due to new policies from tech giants like Microsoft, Google, Facebook, etc., I started exploring open-source self-hosted alternatives to various applications that I personally use. I had pretty low expectations for these sorts of services, however, I was pleasantly surprised with the quality of the products and resources that I found online. I will go into more details with the specifics of these services with later posts.
## The Hardware
[PCPartPicker part list](http://ca.pcpartpicker.com/list/ntTtcf) / [Price breakdown by merchant](http://ca.pcpartpicker.com/list/ntTtcf/by_merchant/)
Type|Item|Price
:----|:----|:----
**CPU** | [Intel Core i5-6400 2.7GHz Quad-Core Processor](http://ca.pcpartpicker.com/product/rK4NnQ/intel-cpu-bx80662i56400) | Purchased For $293.78
**Motherboard** | [Gigabyte GA-H110M-S2HP Micro ATX LGA1151 Motherboard](http://ca.pcpartpicker.com/product/qCzZxr/gigabyte-motherboard-gah110ms2hp) | Purchased For $101.68
**Memory** | [Crucial 4GB (1 x 4GB) DDR4-2133 Memory](http://ca.pcpartpicker.com/product/d72kcf/crucial-memory-ct4g4dfs8213) | Purchased For $36.44
**Storage** | [Kingston SSDNow V300 Series 120GB 2.5" Solid State Drive](http://ca.pcpartpicker.com/product/rtzv6h/kingston-internal-hard-drive-sv300s37a120g) | Purchased For $64.39
**Storage** | [Western Digital Red 2TB 3.5" 5400RPM Internal Hard Drive](http://ca.pcpartpicker.com/product/9wW9TW/western-digital-internal-hard-drive-wd20efrx) | Purchased For $138.97
**Case** | [Fractal Design Node 804 MicroATX Mid Tower Case](http://ca.pcpartpicker.com/product/yTdqqs/fractal-design-case-fdcanode804blw) | Purchased For $118.64
**Power Supply** | [Corsair CSM 450W 80+ Gold Certified Semi-Modular ATX Power Supply](http://ca.pcpartpicker.com/product/H9fp99/corsair-power-supply-cs450m) | Purchased For $90.37
| *Prices include shipping, taxes, rebates, and discounts* |
| **Total** | **$844.27**
| Generated by [PCPartPicker](http://pcpartpicker.com) 2016-07-09 16:00 EDT-0400 |
## Server setup
After a lot of debate between popular server-friendly linux distributions, I decided to go with Ubuntu Server. The main reasons for choosing this was because of the vast amount of resources available and support of services targetting this particular distribution. If any service only officially supports one flavour of Linux, it's almost always Ubuntu Server. After messing up my setup twice (both while trying to configure LVM after the initial installation), I finally managed to get a partition table that I was happy with:
```
sda 8:0 0 111.8G 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
├─sda2 8:2 0 244M 0 part
└─sda3 8:3 0 111.1G 0 part
├─io--vg-root (dm-0) 252:0 0 107.1G 0 lvm /
├─io--vg-swap_1 (dm-1) 252:1 0 3.9G 0 lvm [SWAP]
└─io--vg-home (dm-3) 252:3 0 466.1G 0 lvm /home
sdb 8:16 0 1.8T 0 disk
└─sdb1 8:17 0 1.8T 0 part
├─io--vg-data (dm-2) 252:2 0 1.4T 0 lvm /var
└─io--vg-home (dm-3) 252:3 0 466.1G 0 lvm /home
```
As it can be seen, I allocated my `/root`, `/boot` and swap partition to the SSD, while keeping my home directory and `/var` on the hard drive. When running a service that requires the use of a database, those databases go into `/var`, which is the standard destination for these types of data. Home mainly contains my Syncthing folder and occassionally I use it as a workspace for experimental builds. As the usage grows, I hope to easily extend the storage of both `/home` and `/var` using LVM.
Then comes the topic of security, probably the most important part of this project. I never had experience with this before, but following a couple of guides I setup a firewall (using **), private/public key SSH, two-factor authentication, and login timeout mechanism (using fail2ban). For further reading, please read [this short guide](http://www.codelitt.com/blog/my-first-10-minutes-on-a-server-primer-for-securing-ubuntu/). Port forwarding and remote access had to be enable on my routers end so that I could SSH and maintain my server from anywhere I want. I did have some problems with dynamic IP, and ended up transfering my domain to [NoIP](no-ip.com) and installed their automatic DDNS update client on my server.
## Services
I primarily have an nginx web server running which contains server blocks to redirect different hosts to different ports on the server. The primary types of services that I will be focusing on deploying are:
* File syncing
* Communication platform
* Git server
* Notes and to-do manager
* Finance manager
* Static web server
Once all these are taken care of, I have plans to extend the range of services by adding things such as:
* Email server
* Social networking (Diaspora)
* Nylas email sync engine
* Cozy (replacement for Google services like calendar, drive, etc)
And probably a lot more to come. For each of these (types of) services, I plan to go into more specific details on later posts. This draws the conclusion to my first part. Next up I will discuss setting up TLS/SSL certificate with Let's Encrypt on an nginx server instance and separating server blocks.
+++
date = "2015-08-25T17:09:14-05:00"
draft = false
title = "Use @ instead of HEAD"
slug = 'use-at-instead-of-head'
+++
I recently discovered that from git version [1.8.5](https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.5.txt#L100) onwards, `@` can replace `HEAD`:
{{< highlight bash >}}
$ git reset --hard @~2
$ git rebase -i @~10
$ git diff @~2..@~3
{{</highlight>}}
And also in most scenarios `HEAD` can be left out completely, so you can say:
{{< highlight bash >}}
$ git reset -- @{2}
{{</highlight>}}
instead of:
{{< highlight bash >}}
$ git reset -- HEAD@{2}
{{</highlight>}}
It takes some getting used to, but it's definitely faster than typing `HEAD`.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment