diff options
author | Michał Sapka <michal@sapka.me> | 2023-01-08 12:12:11 +0100 |
---|---|---|
committer | Michał Sapka <michal@sapka.me> | 2023-01-08 12:12:11 +0100 |
commit | 0381d2e62d10fd30402c29d85041071adcc483bf (patch) | |
tree | 7a07eb53f9b4f95c71750af29b8a3db3e07c6817 /content | |
parent | 8987664e3ab4dd08879c3d45ba4ba954aaec6f69 (diff) |
feat: basic list
Diffstat (limited to 'content')
-rw-r--r-- | content/ddns.md | 149 | ||||
-rw-r--r-- | content/gnu_stow.md | 128 | ||||
-rw-r--r-- | content/music_server.md | 122 | ||||
-rw-r--r-- | content/repartitioning.md | 79 | ||||
-rw-r--r-- | content/workman_layout.md | 37 |
5 files changed, 515 insertions, 0 deletions
diff --git a/content/ddns.md b/content/ddns.md new file mode 100644 index 0000000..fb112cd --- /dev/null +++ b/content/ddns.md @@ -0,0 +1,149 @@ +--- +date: 2022-05-13T20:17:00+02:00 +draft: false +type: homeserver +title: Adding dynamic DNS to the home server +--- +I am one of the unlucky ones without static IP address. I would get one from my ISP, but this would require me to upgrade to a business contract. And to do such upgrade, I would need a company - which I do not own nor have I any plans to own in the near future. Luckily, I can still have a domain. There is a group of services under the umbrella term Dynamic DNS. +<!--more--> + +[DDNS on Arch Wiki](https://wiki.archlinux.org/title/Dynamic_DNS) + +Basically, I need to point my domain to their name server and keep them up to date with changes of my IP. The DDNS server acts as a middle-man when using a normal domain. In most cases, I just need to fetch a given URL periodically ad the service will treat this as current IP set. + +## Self hosting vs 3rd party + +There are ready-made packages I could instal on any VPS, but debugging DNS is not something I would like to do. Therefore, I will go with 3rd party. + + +I looked through the interwebs for providers and found lots of them. Unfortunately, most of them are dead, so the choice is much less difficult. + + +## Requirements + +After a short analysis, I came up with few requirements: + +``` +Max number of domains........................3 +Max number of subdomains per domain.........20 +Expected uptime..........................>95.5 +Location............................Europe/USA +MX Records.................................YES +TTL.....................................<10min +``` + + +## Instant rejects + +I instantly rejected some providers, since they will now work for my use case: + +``` +| Service | Reason? +|-----------------------+----------------------------- +| activedns.co.za | South Africa only +| bcu.cc | Site does not open +| ddns.nu | Site does not open +| dhcp.io | Domain for sale +| dhs.org | Site does not open +| dns.widge.net | Site does not open +| dnsdynamic.org | Some random site under the address +| dnsmadeeasy.com | It's namecheap now +| dnspark.com | It's namecheap now +| dtdns.com | Broken site +| dyn.ee | Domain for sale +| dyn.ro | Domain for sale (I think) +| dynamicdomain.net | Site reads like poor phising attempt +| dyndsl.com | Domain for sale +| domain-dns.com | Not accepting new zones +| dyndnsservices.com | Offers self-host only +| dynfree.com | Broken site +| dynup.net | Broken site +| hldns.com | No longer offers DDNS +| hn.org | Site does not work +| homepc.org | Site does not work +| hub.turnkeylinux.org | Site does not work +| microtech.co.gg | Site does not work +| minidns.net | Site does not work +| myonlineportal.net | Only 10 domains per account +| myserver.org | Broken site +| nettica.com | Domain for sale +| nicolas.cx | No sign-up via web +| nubem.com | Site does not work +| ods.org | Domain for sale +| powerdns.com | Self hosted solution +| prout.be | Self hosted solution +| spdns.de | No english site +| system-ns.com | No longer offers DDNS +| tzo.com | Site does not work +| whyi.org | Site does not work +| worldwidedns.net | Does not support enough zones +| xname.org | Site does not work +| yi.org | Site does not work +| zerigo.com | Site does not work +``` + +## The potential ones + +After removing most positions from list, I dig a big deeper: + +``` +| Service | Price | Uptime | Location +| | per year | | +|-----------------------+---------------+-----------+--- +| changeip.com | $6 | 99.9% (1) | USA +| dhis.org | Donation | ? | ? +| dns2go.com | lots$ | ? | ? +| dnsexit.com | FREE for TLD | 100% | Distributed +| duckdns.org | FREE | ? | ? +| duiadns.net | $11 | ? | ? +| dynaccess.de | 22EUR | ? | Germany +| dynamip.com | $48 | ? | ? +| dyndns.berlin | FREE | ? | Germany +| dyndns.com | $55 | ? | ? +| dyndns.dk | FREE | ? | ? +| dynip.com | lots$ | ? | ? +| dyns.cx | Donation | ? | ? +| dynu.com | FREE | 100% (2) | Distributed +| easydns.com | FREE | 100% | ? +| freedns.afraid.org | $60 | ~99.3%(3) | ? +| noip.com | $24.99 | 100% (2) | ? +| planetdns.net | $299.95 | ? | ? +| staticcling.org | FREE | ? | ? +| thatip.com | $48 | ? | ? +| thebbs.org | FREE | ? | ? +| totaluptime.com | $1188(SIC!) | ? | ? +| zonomi.com | lots$ | ? | ? + ``` + - [(1) whtop.com](https://www.whtop.com/review/changeip.com) + - [(2) comparingtech.com](https://www.comparitech.com/net-admin/dynamic-dns-providers/) + - [(3) dnsperf.com](https://www.dnsperf.com/dns-provider/afraid-org) + +Notes: +- "?" - I couldn't find data, but also I wasn't looking very hard +- "lots$" - some providers have a complicated pricing and at first glance it was obvious, that it will be expensive. + + As we see, some working providers are crazy expensive. They add extra features, but still - crazy expensive. + +## Conclusion + +DDNS is a strange market. It's mostly dead. But when the service is still available, it seems to be run from someone's basement. There are companies in the space, don't get me wrong - but most of it looks like hacker culture byproduct. And this makes sense, since the primary use case for DDNS is someone without static IP - ergo, an individual and not a company. + +The sad aspect of this is lack of any SLAs in most cases. + +The happy aspect of this is that you can get a lot for very little. + +## Decision + +Looking at the data, I have decided to go with dynu.com as it has 100% uptime, and it's free. + +## Setting up dynu.com on Synology + +First, create a dedicated IP update password on dynu.com. It's optional, but highly recommended. + +Then, in Synology Control Panel open External Access, then click on "DDNS" tab. Click "Customize Provider" and set query URL to + +``` +https://api.dynu.com/nic/update?myip=__MYIP__&username=__USERNAME__&password=__PASSWORD__&hostname__HOSTNAME__&myipv6=no +``` + +Now, add a subdomain. Note, that it would be best to MD5 the password. diff --git a/content/gnu_stow.md b/content/gnu_stow.md new file mode 100644 index 0000000..33ebb73 --- /dev/null +++ b/content/gnu_stow.md @@ -0,0 +1,128 @@ +--- +date: 2022-06-09T19:10:00+02:00 +draft: fale +type: productivity +title: Managing dotfiles with GNU Stow +--- +If you are working with linux/bsd based system, you are most likely accustomed to managing +your configs with dotfiles. And you most likely have them stored with Git. But there is the +never ending problem of how to actually use them. I have moved management of this under +GNU Stow. +<!--more--> +Let's take a very typical dotfiles repository. + +``` +./nvim/init.lua +./tmux/tmux.conf +``` + +You want to have those files available as + +``` +~/.config/nvim/init.lua +~/.tmux.conf +``` + +The most popular approach would be to symlink the files under the expected location. We +could also copy the files every time something changes, but that would be crazy. Are we +the stuck with having to do those symlinks manually every time we install a new machine +or create a virtual one? And what if we have dozens of such configs stored under git? + +## Symlink farm + +GNU Stow is a symlink farm. This means, that it's a system aimed at automating creating of +those symlinks. + +[GNU Stow website](https://www.gnu.org/software/stow/manual/stow.html) + +For Stow, the dotfiles directory is called "Stowed" directory. Now comes the cool part. Each folder +in the Stowed directory (called "Package directory") stores a separate directory tree. GNU +Stow will join all those separate trees and create a proper structure under Target Directory, +which by default is the parent of Stowed directory. Let's look at example. + +``` +~/target/stow/one/config/one.conf +~/target/stow/two/config/two.conf +~/target/stow/three/config/three.conf +``` + +So, our home director now has a "Target" directory, which has a "Stow" directory. The Stow +directory stores three configs which we want to sylink as + + +``` +~/target/config/one.conf +~/target/config/two.conf +~/target/config/three.conf +``` + +Let's stow the first one + +``` +cd ~/target/stow +stow one +``` + +And see what happened + +``` +cd ~/target +ls -lA +``` + +We get somethine like + +``` +lrwxrwxrwx 1 msapka wheel 15 Jun 9 23:01 config -> stow/one/config +drwxr-xr-x 5 msapka wheel 4096 Jun 9 22:55 stow +``` + +Stow created a config symlink in the target directory. Very cool, but it gets cooler! Let' +stow the second one + +``` +cd ~/target/stow +stow two +``` + +and what we get + +``` +drwxr-xr-x 2 msapka wheel 4096 Jun 9 23:03 config +drwxr-xr-x 5 msapka wheel 4096 Jun 9 22:55 stow +``` + +Our config is no longer a symlink, but a real folder. Let's see what's inside here. + +``` +cd config +ls -lA +``` + +``` +lrwxrwxrwx 1 msapka wheel 27 Jun 9 23:03 one.conf -> ../stow/two/config/one.conf +lrwxrwxrwx 1 msapka wheel 26 Jun 9 23:03 two.conf -> ../stow/one/config/two.conf +``` + +We have our two configs, but what has happened? Stow looked at both sub trees for "one" and +"two"m and joined then in a way, that is possible. The only way for one.conf and two.conf to +exist in config is if config is a normal directory. Extremely cool! + +Let's image that our target is actually homedir, so we have a ~/dotfiles directory. Then +each package directory can mimic the tree struture of the actual config! Coming back +to our example, we can have a + +``` +~/dotfiles/tmux/.tmux.conf +~/dotfiles/nvim/.config/nvim/init.lua +``` + +Then, after stowing both packages we have symlinks under our desired + + +``` +~/.config/nvim/init.lua +~/.tmux.conf +``` + +GNU Stow is a very simple tool. All we understand what will happen with each sub tree. diff --git a/content/music_server.md b/content/music_server.md new file mode 100644 index 0000000..ed0ae05 --- /dev/null +++ b/content/music_server.md @@ -0,0 +1,122 @@ +--- +date: 2022-05-25T20:17:00+02:00 +draft: false +type: homeserver +title: Adding simple music server to my network +--- +One of my goals for 2022 is to not pay for music subscriptions anymore. Nowadays, it's really easy and cheap to actually own my music. + <!--more--> +## Getting music +Internet is full of cheap, used CDs and new music is ready for purchase on sites like Bandcamp. Since I mostly listen to dead people, CDs are my primary source. + +The first problem is having something to put a disc in. I've gotten myself a cheap USB-CD/DVD drive. It's very loud, but since I use it only for getting the data to my computer, it's not a problem. + +I rip (a word that I have not seen in a long time) on MacBook using XLD app. I plan to move this step to Linux soon. + +[XLD homepage](https://tmkk.undo.jp/xld/index_e.html) + +I rip the music to FLAC, which seems to be standard. It's lossless and most file-based players have no problems with it. Of course, not everywhere. iOS is always problematic, but I don't listen to music on the go very often, so it's a problem for future me. + +A single album in FLAC takes about 200-300 MB. I still remember MP3 days, where it would go down to 60 MB or less, but back then storage and transfer were actually expensive. I don't hear any noticeable difference between FLAC and good compressed file, but again - storage and transfer is cheap, Furthermore I have a single high-res album where half an hour takes 750 MBMB and there is zero difference. Well, now I know, and I won't buy-high res ever again :) + +## Storing and serving music + +The music will be accessed by multiple devices on local network, so putting it on the Home Server makes perfect sense. I now have a dedicated share "music" which is shared via Samba and NFS. + +Samba seems better than NFS, but then NFS on Linux is simpler to set up. + +For Samba, I need to add read+write access to Music share for each user from Synology web UI. + +NFS on the other hand doesn't support users, but devices instead. The first step is to set static IP for my devices (which is always a good idea). How exactly this should be approached depends on the setup, but I use UniFi Dream Machine and forcing IP for a device is very straight forward. After I have static IPs, I can add read/write access for those addresses, also via Synology web UI. + +Served music is so small, that this does not add any noticeable overhead for the server. + +## Accessing the music on Linux + +First, I needed to install NFS support. I use Arch, so: + +``` +# pacman -S nfs-utils +``` + +Then I checked if the share actually exists. My server's address is 10.0.1.200. + +``` +$ showmount -e 10.0.1.200 +------------------ +Export list for 10.0.1.200: +/volume2/music 10.0.1.10 +``` + +Voilà! Next step: check if it works + +``` +# mkdir /mnt/music +# mount 10.0.1.200:/volume2/music /mnt/music/ +# cd /mnt/music +# ls +``` + +And listing worked. Noice. To automate it for future, and to allow non-root users to actually mount the drive I added a new mount to /etc/fstab: + +``` +10.0.1.200:/volume2/music /mnt/music nfs _netdev,noauto,x-systemd.automount,x-systemd.mount-timeout=10,timeo=14,users,x-systemd.idle-timeout=1min 0 0 +``` + +After the first user accesses /mnt/music, the drive will be mounted. + +## Playing the music using CMUS + +We have access to the files, let's play it. Every modern music player for Linux should work with Flac, but I've chosen CMUS. It's fast, it's terminal based, and it supports VIM keybindings. + + +[CMUS webpage](https://cmus.github.io/) + +``` +# pacman -S cmus +``` + +After we open cmus, we need to add music. It's done similarly to VIM, via an ex command. + +``` +:add /mnt/music/ +``` + +And a few seconds later, the music is visible in the player. Using CMUS requires reading the manual + +``` +$ man cmus-tutorial +``` + +but the basics I needed to play something from Artist/Album view were: + +``` +j go up +k go down +tab change active window (artists/tracks) +space expand artist to album list +c play track / pause track +e add track to queue +q exit +``` + +Extra bonus: after first configuring system I had some problems with audio not working from time to time. Moving from Pulse to Pipewire solved them all. + +[Pipewire webpage](https://pipewire.org/) + +## Listening on Mac via CMUS + +I have no idea how to auto mount a server on MacOS, so after every reboot or network change, I need access the Samba share via Finder. After it's mounted, I can access it under /Volumes/music. + +On Mac I also use CMUS, so all of the above apply as well. One difference is adding the files due to different location + +``` +:add /Volumes/music +``` + +## Next up + +This doesn't solve all my needs. In the future I need to find out how to: + +- access the music outside my home network +- how to marry this setup with my multiroom system (Sonos + Homepods) diff --git a/content/repartitioning.md b/content/repartitioning.md new file mode 100644 index 0000000..fa0b7be --- /dev/null +++ b/content/repartitioning.md @@ -0,0 +1,79 @@ +--- +date: 2022-05-07T10:15:00+02:00 +draft: false +type: homeserver +title: Repartitioning the home server +--- +I have owned Synology 920+ for some two years. Unfortunately, when I first got it, I made some assumptions that are no longer true and therefore this NAS is basically a glorofied Plex machine. A bad one, as the CPU is not powerful for any modern codec transcoding. Time to fix it! + +## Durandal + +The server (named Durandal) had all drives in Synology Hybrid Raid (SHR) configuration until recenly. When I first bought the device, I got three WD-RED 4 TB drives, which left one bay empty. Soon, the occupied space filled the three drives, and I expanded it with 6 TB - as SHR allows for mixing drive size. In adition, SHR1 allows for one drive failure. +The configuration looked like: + +``` + HDD1 HDD2 HDD3 HDD4 + -------- -------- -------- ------------ + | | | | | | | | + | WD-RED | | WD-RED | | WD-RED | | WD-RED | + | 4 TB | | 4 TB | | 4 TB | | 6 TB | + | | | | | | | | + -------- -------- -------- ------------ +| | + --------------------------------------------------- + Volume 1 (SHR1) + 9.6 TB +``` + +This setup has the drawback of not allowing as much storage as required, and storing movie backups on volume with redundancy is an overkill. + + +## Vulcan + +A few days ago, I rethought the current assumption, and the new ones are: + +- I want to host application on the NAS +- I want to host my photographs (no more iCloud subscription) +- I want to store multimedia, but I don't care if I lose it. + +This led to a new architecture based on two volumes: + + +``` + HDD1 HDD2 HDD3 HDD4 + -------- -------- -------- ------------ + | | | | | | | | + | WD-RED | | WD-RED | | WD-RED | | WD-RED | + | 4 TB | | 4 TB | | 4 TB | | 6 TB | + | | | | | | | | + -------- -------- -------- ------------ + + CACHE1 CACHE2 + -------- -------- + | Samsung| | Samsung| + | 256 GB | | 256 GB | + -------- -------- +| | | | + ------------------------ --------------------------- + Volume 1 (SHR1) Volume 2 (RAID0) + 3.5 TB 8.7 TB + +``` + +Now I have a clear distinction between space for important stuff and for stuff I can recreate with ease. Having 3.5 TB is overkill here, as the drives will sooner fail than I will be able to fill them - currently, I store 520 GB in iCloud... and I pay for 2 TB as there is nothing in between. Having two 2 TB drives there would be much more economical + +The total capacity is also significantly higher now. There will be things I'll want to secure that are on Volume 2, but since it won't be anything mission-critical, I can just use a USB Drive for this. + +## The future + +Since the server is ready, I think I'll strive for: + +- adding new offsite backup (or 2) for Volume 1, +- leaving Plex (temporarily I use Samba shares), +- adding proper photo storage, +- adding a music server, +- adding DNS server, +- moving this site, +- moving my XMPP server, +- adding a VPN server, +- adding backup power for the NAS, modem, and router. diff --git a/content/workman_layout.md b/content/workman_layout.md new file mode 100644 index 0000000..c1e1904 --- /dev/null +++ b/content/workman_layout.md @@ -0,0 +1,37 @@ +--- +date: 2022-06-01T21:10:00+02:00 +draft: false +type: updates +title: Trying out the Workman layout +--- +I'm a terrible typist. I make more typos than I'd like to admit, I type slow and mostly use 3 fingers in total. Time for a makeover. + <!--more--> +I never liked typing. I consider it a tedious task I do 8-12 hours a day. I'm guessing this is mostly due to my terrible skills, but I hope that's not the whole story. + +The standard QWERTY keyboard layout we know and (do not) love is, according to the legend, an effect of deliberately slowing do typing speeds. It comes from typewriter times, where typing too fast could result in jamming the machine. We no longer have this problem, but QWERTY is still with us. + +Luckily there are alternatives. Lots of them actually, but only 3 seem viable: + +- Dvorak +- Colemak +- Workman + +Out of those three, Dvorak seems to be outdated as it was also designed around typewriters. Workman was designed as a solution for downsides of Colemak, and this was my choice. Then I found out about Colemak-DH, which is a modified version of Colemak addressing Workman... but I've already chosen. I'll be a Workman! + +[Workman Keyboard Layout](https://workmanlayout.org/) + +Also, I don't know anyone who uses Workman, so why not? What is important, is that every layout is told be a significant improvement over QWERTY. + +The plan is simple: + +- use QWERTY as daily layout +- practice Workman daily +- after I am able to confidently type my passwords in Workman, completely abandon QWERTY. + +I've chosen Keybr as my tutoring platform + +[keybr.com](https://www.keybr.com) + +It supports Workman (which is not that common as I found out) and is able to emulate it on system with QWERTY. I set myself a goal of 15 mins per day... and it's a nightmare. Or at least it was for the first few days. Muscle memory is strong, even with my mediocre QWERTY skills. Keybr uses a great system where it starts with 6 most common letters of US dictionary, then grades how well I type them and decides if I am ready for more. After 5 days I am not. However, what I've noticed is the joy of flow when typing. I've never felt this way with QWERTY, it was always a struggle. I am using very few letters, I am typing slowly. However, the movements come together as something enjoyable. I'll see what comes of it. I always enjoy new things, so maybe that's just it + +[My Keybr profile](https://www.keybr.com/profile/723pl7f) |