1diff --git a/LICENSE b/LICENSE
2new file mode 100644
3index 0000000000000000000000000000000000000000..588d327cb48b7636ddc55620254b780856f2e4bd
4--- /dev/null
5+++ b/LICENSE
6@@ -0,0 +1,22 @@
7+MIT License
8+
9+Copyright (c) 2021 Gabriel Arakaki Giovanini
10+
11+Permission is hereby granted, free of charge, to any person obtaining a copy of
12+this software and associated documentation files (the "Software"), to deal in
13+the Software without restriction, including without limitation the rights to
14+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
15+of the Software, and to permit persons to whom the Software is furnished to do
16+so, subject to the following conditions:
17+
18+The above copyright notice and this permission notice (including the next
19+ paragraph) shall be included in all copies or substantial portions of the
20+Software.
21+
22+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28+ SOFTWARE.
29diff --git a/README.md b/README.md
30index fec77b5c29fe933f4f8dbadccbce157bd24033d9..c0e49117202e87f6a67cd2af69b22d92013ec591 100644
31--- a/README.md
32+++ b/README.md
33@@ -1,6 +1,6 @@
34 # My personal blog
35
36-[gabrielgio.me](https://gabrielgio.me)
37+[gabrielgio.me](http://gabrielgio.me)
38
39
40 To run you just need to:
41diff --git a/config.toml b/config.toml
42index 43c6591138b2dfa4758208b190827b95d13f828d..75f1f4e42bec08d10030347ec0ce0abbebd2084b 100644
43--- a/config.toml
44+++ b/config.toml
45@@ -1,4 +1,4 @@
46-baseURL = "https://gabrielgio.me/"
47+baseURL = "http://gabrielgio.me/"
48 languageCode = "en-us"
49 title = "Yet Another Blog"
50 theme = "flamingo"
51diff --git a/content/logs/2019-11-16-compiling-emacs.org b/content/logs/2019-11-16-compiling-emacs.org
52deleted file mode 100644
53index 23a2181ec1c242b4adad7c349d83a0f86eeb96d0..0000000000000000000000000000000000000000
54--- a/content/logs/2019-11-16-compiling-emacs.org
55+++ /dev/null
56@@ -1,36 +0,0 @@
57----
58-title: "Compiling emacs from source code on Fedora"
59-date: 2019-11-16
60-lastmod: 2020-08-25
61-tags: ['emacs', 'emacs27', 'linux', 'fedora']
62----
63-
64-Compiling emacs from source and installing on fedora.
65-
66-* Installing Packages
67-Install the following packages:
68-#+BEGIN_SRC
69-sudo dnf install git autoconf make gcc texinfo \
70- gnutls-devel giflib-devel ncurses-devel \
71- libjpeg-turbo-devel giflib-devel gtk3-devel \
72- libXpm-devel libtiff-devel libxml2-devel -y
73-#+END_SRC
74-
75-* Cloning Repository
76-Clone repository [[http://savannah.gnu.org/projects/emacs/][savannah.gnu.org]]:
77-#+BEGIN_SRC
78-git clone -b master git://git.sv.gnu.org/emacs.git
79-#+END_SRC
80-
81-* Compiling
82-Navigate to emacs folder (~cd emacs~) and execute the following steps
83-
84-#+BEGIN_SRC sh
85-./autogen.sh
86-./configure
87-make -j$(nproc)
88-sudo make install
89-#+END_SRC
90-
91-After verify version with ~emacs --version~, it should be equal or higher than
92-=28.0.50=.
93diff --git a/content/logs/2020-07-13-k8s.org b/content/logs/2020-07-13-k8s.org
94deleted file mode 100644
95index b55c982d6ecbd8624a79b5700f4821e8c67edf07..0000000000000000000000000000000000000000
96--- a/content/logs/2020-07-13-k8s.org
97+++ /dev/null
98@@ -1,73 +0,0 @@
99----
100-title: "Road to local k8s"
101-date: 2020-07-13
102-tags: ['kubernetes', 'linux', 'fedora']
103----
104-
105-* Goal
106-The goal is to deploy kubernetes on my local networks, and keep everything as
107-reproducible as possible.
108-
109-* Stack
110-
111-I'll use Fedora Core OS, Matchbox and Terraform [fn:1], a match the requirements
112-for Tectonic [fn:2]
113-
114-** Steps
115-- Network Setup DHCP/TFTP/DNS [fn:3]
116-- Matchbox [fn:4]
117-- PXE network boot environment
118-- Terraform Tectonic [fn:5]
119-
120-** Network Setup DHCP/TFTP/DNS
121-First learning the basics again:
122-
123-- https://linuxhint.com/install_dhcp_server_ubuntu/
124-- https://www.youtube.com/watch?v=XQ3T14SIlV4
125-
126-
127-To check open ports
128-#+BEGIN_SRC sh
129-lsof -Pni | grep LISTEN
130-#+END_SRC
131-
132-Run the provided [fn:dnsmasq] image with ~dnsmasq~ and PXE toolkit
133-
134-#+BEGIN_SRC sh
135-docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \
136- -d -q \
137- --dhcp-range=192.168.1.3,192.168.1.254 \
138- --enable-tftp --tftp-root=/var/lib/tftpboot \
139- --dhcp-match=set:bios,option:client-arch,0 \
140- --dhcp-boot=tag:bios,undionly.kpxe \
141- --dhcp-match=set:efi32,option:client-arch,6 \
142- --dhcp-boot=tag:efi32,ipxe.efi \
143- --dhcp-match=set:efibc,option:client-arch,7 \
144- --dhcp-boot=tag:efibc,ipxe.efi \
145- --dhcp-match=set:efi64,option:client-arch,9 \
146- --dhcp-boot=tag:efi64,ipxe.efi \
147- --dhcp-userclass=set:ipxe,iPXE \
148- --dhcp-boot=tag:ipxe,http://matchbox.example.com:8080/boot.ipxe \
149- --address=/matchbox.example/192.168.1.2 \
150- --log-queries \
151- --log-dhcp
152-#+END_SRC
153-
154-
155-** Matchbox
156-** PXE network boot environment
157-** Terraform Tectonic
158-
159-------
160-* Links
161-[fn:1]https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html
162-
163-[fn:2]https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html
164-
165-[fn:3]https://coreos.com/matchbox/docs/latest/network-setup.html
166-
167-[fn:4]https://coreos.com/matchbox/docs/latest/deployment.html
168-
169-[fn:5]https://coreos.com/tectonic/releases/
170-
171-[fn:dnsmasq]https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq
172diff --git a/content/logs/2020-07-14-fritzbox.org b/content/posts/2020-07-14-fritzbox.md
173rename from content/logs/2020-07-14-fritzbox.org
174rename to content/posts/2020-07-14-fritzbox.md
175index df0fb529823cb3fe6e067bd2059e68c02a15a771..bba7f4e6a3ddaf9ad68c709c78860b37558f92e0 100644
176--- a/content/logs/2020-07-14-fritzbox.org
177+++ b/content/posts/2020-07-14-fritzbox.md
178@@ -1,14 +1,14 @@
179 ---
180-title: "Friz.box turned off DHCP"
181-date: 2020-07-14
182+title: "Friz.box turned off DHCP"
183+date: 2020-07-14
184 tags: ['fritz.box', 'DHCP']
185 ---
186
187 If you turned off your DHCP server follow these steps to connect to FritzBox
188 settings.
189
190-- Set your computer IP to ~169.254.1.2~ and your mask to ~255.255.0.0~
191-- Then go to ~169.254.1.1~, login and re-enable the DHCP server.
192+- Set your computer IP to `169.254.1.2` and your mask to `255.255.0.0`
193+- Then go to `169.254.1.1`, login and re-enable the DHCP server.
194
195 On gnome turn the wired connection off on again to apply the settings.
196
197diff --git a/content/logs/2020-08-22-genpass.org b/content/logs/2020-08-22-genpass.org
198deleted file mode 100644
199index c9a0a98c84461d5d0b9a553e9f87764d38ba1c54..0000000000000000000000000000000000000000
200--- a/content/logs/2020-08-22-genpass.org
201+++ /dev/null
202@@ -1,35 +0,0 @@
203----
204-title: "Moving from Github to Gitlab pages"
205-date: 2020-08-22
206-tags: ['gitlab']
207----
208-
209-This was quite simple, I had just to create a simple Gitlab pipeline job and
210-publish to pages this is done by:
211-
212-#+BEGIN_SRC
213-image: clojure:lein-2.7.0
214-
215-before_script:
216- - lein deps
217-
218-test:
219- script:
220- - lein test
221-
222-pages:
223- stage: deploy
224- script:
225- - lein package
226- artifacts:
227- paths:
228- - public
229- only:
230- - master
231-
232-#+END_SRC
233-
234-- before_script :: will download all the dependencies with ~lein deps~.
235-- test :: is self explanatory.
236-- pages :: will compile the cljs into js with ~lein package~ and publish it into
237- pages.
238diff --git a/content/logs/2020-12-28-k8s-private-registry.org b/content/logs/2020-12-28-k8s-private-registry.org
239deleted file mode 100644
240index 9a571ef9b0541f73bd05554ac2f674d33f9715f5..0000000000000000000000000000000000000000
241--- a/content/logs/2020-12-28-k8s-private-registry.org
242+++ /dev/null
243@@ -1,57 +0,0 @@
244----
245-title: "K8S private gitlab registry using podman"
246-date: 2021-12-28
247-tags: ['kubernetes', 'linux', 'podman', 'gitlab', 'k3s']
248----
249-
250-This is based on [[https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/][Log in to Docker Hub]].
251-It is just a bit different to use podman
252-
253-First we should take a look at podman-login man page:
254-
255-#+BEGIN_SRC bash
256-man podman login
257-#+END_SRC
258-
259-It will give some valueable information like the location of auth.json file.
260-Now we can login using podman:
261-
262-#+BEGIN_SRC bash
263-podman login registry.gitlab.com
264-#+END_SRC
265-
266-Then check the ~auth.json~ file located at
267-~${XDG_RUNTIME_DIR}/containers/auth.json~ (as described by the manual).
268-
269-#+BEGIN_SRC bash
270-cat "${XDG_RUNTIME_DIR}/containers/auth.json"
271-#+END_SRC
272-
273-It will print your auth config:
274-
275-#+BEGIN_SRC json
276-{
277- "auths": {
278- "registry.gitlab.com": {
279- "auth": "..."
280- }
281- }
282-}
283-#+END_SRC
284-
285-Now copy that file over to the server and register it in k8s with the following command:
286-
287-#+BEGIN_SRC bash
288-kubectl create secret generic regcred \
289- --from-file=.dockerconfigjson=auth.json \
290- --type=kubernetes.io/dockerconfigjson
291-#+END_SRC
292-
293-Once you have created you can list by ~kubectl get secret~:
294-
295-#+BEGIN_SRC
296-NAME TYPE DATA AGE
297-regcred kubernetes.io/dockerconfigjson 1 53s
298-#+END_SRC
299-
300-
301diff --git a/content/logs/2021-12-26-nfs-k3s.org b/content/logs/2021-12-26-nfs-k3s.org
302deleted file mode 100644
303index 5785d4f99db2f3d74898a61808dc41a50184cafd..0000000000000000000000000000000000000000
304--- a/content/logs/2021-12-26-nfs-k3s.org
305+++ /dev/null
306@@ -1,61 +0,0 @@
307----
308-title: "Enable NFS on K3S"
309-date: 2021-12-26
310-tags: ['kubernetes', 'linux', 'helm', 'k3s']
311----
312-
313-By default [[https://k3s.io/][K3S]] comes only with [[https://github.com/rancher/local-path-provisioner][local-path]] storage class, and if you are running
314-with more than one node in your cluster you may want to use a more "distributed"
315-solution. For may case I opted for NFS.
316-
317-To check the current storage class you can run:
318-
319-#+BEGIN_SRC bash
320-k3s kubectl get storageclasses
321-#+END_SRC
322-
323-And it will print something like:
324-
325-#+BEGIN_SRC
326-NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
327-local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d
328-#+END_SRC
329-
330-To start adding First you need to install [[https://github.com/helm/helm][helm]] on your server. To do so you may
331-run:
332-
333-#+BEGIN_SRC bash
334-curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
335-#+END_SRC
336-
337-*Be careful when running scripts directly into bash always check the source*
338-*Sometimes is also recommended to do not pipe directly to bash*
339-
340-Once it is installed we need to add the [[https://kubernetes.io/docs/concepts/storage/storage-classes/#nfs][NFS storage classes]]. It has two
341-providers, I have chose [[https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner][NFS Subdir External Provisioner]].
342-
343-Add the helm repo
344-
345-#+BEGIN_SRC bash
346-helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
347-#+END_SRC
348-
349-Then we need to actually install the provider
350-
351-
352-#+BEGIN_SRC bash
353-helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
354- --set nfs.server=x.x.x.x \
355- --set nfs.path=/exported/path
356-#+END_SRC
357-
358-Set the ~nfs.server~ and ~nfs.path~ accordingly with your setup.
359-
360-After that if we run ~k3s kubectl get storageclasses~ it will now print another
361-NFS provider:
362-
363-#+BEGIN_SRC
364-NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
365-local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d
366-nfs-client cluster.local/nfs-subdir-external-provisioner Delete Immediate true 76m
367-#+END_SRC
368diff --git a/content/posts/2019-03-03-welcome-to-my-blog.md b/content/posts/2019-03-03-welcome-to-my-blog.md
369new file mode 100644
370index 0000000000000000000000000000000000000000..01aeff32b9eba1826221b50edcc4c5b19ae36c86
371--- /dev/null
372+++ b/content/posts/2019-03-03-welcome-to-my-blog.md
373@@ -0,0 +1,14 @@
374++++
375+title = "Welcome to my blog"
376+date = 2019-03-03
377+lastmod = 2020-07-12
378++++
379+
380+On this blog, I\'ll be posting some personal projects that I\'m working
381+on or just logging stuff that I don\'t want to forget.
382+
383+*Disclaimer*: English it\'s not my native language so if you find
384+something that you don\'t understand I\'d love you to open an
385+[issue](https://gitlab.com/gabrielgio/homestation/-/issuess), or if you
386+have something to add open a
387+[MR](phttps://gitlab.com/gabrielgio/homestation/-/merge_requests)
388diff --git a/content/posts/2019-03-03-welcome-to-my-blog.org b/content/posts/2019-03-03-welcome-to-my-blog.org
389deleted file mode 100644
390index 889131d205f98d0991607ad6e2e19bc4f3570d79..0000000000000000000000000000000000000000
391--- a/content/posts/2019-03-03-welcome-to-my-blog.org
392+++ /dev/null
393@@ -1,12 +0,0 @@
394----
395-title: "Welcome to my blog"
396-date: 2019-03-03
397-lastmod: 2020-07-12
398----
399-
400-On this blog, I'll be posting some personal projects that I'm working on or just
401-logging stuff that I don't want to forget.
402-
403-/Disclaimer/: English it's not my native language so if you find something that
404-you don't understand I'd love you to open an [[https://gitlab.com/gabrielgio/homestation/-/issuess][issue]], or if you have something to
405-add open a [[phttps://gitlab.com/gabrielgio/homestation/-/merge_requests][MR]]
406diff --git a/content/posts/2019-03-07-ansible-part-1.md b/content/posts/2019-03-07-ansible-part-1.md
407new file mode 100644
408index 0000000000000000000000000000000000000000..2746afc84ce988f403ecb8d1454e5bce43cf42ca
409--- /dev/null
410+++ b/content/posts/2019-03-07-ansible-part-1.md
411@@ -0,0 +1,104 @@
412+---
413+layout: post
414+title: "Automating setup with ansible-pull part-1"
415+date: 2019-03-07
416+lastmod: 2020-07-12
417+tags: ['ansible','ansible-pull', 'linux', 'fedora']
418+---
419+
420+Every time that I do a clean install on my machine it takes a few hours till I
421+get to point where I was before formatting it, install all packages, select
422+themes, icons, fonts, install IDEs, extensions and so on. After doing it a few
423+times I came to the conclusion that I would save time by spending time
424+automating this chore, and as a result, I could toy a little more with my
425+system and not worry about spending a weekend re-installing everything (which
426+have happened more time that I\'d like to remember).
427+
428+\<!--more-->
429+
430+So after a few attempts using python and bash I ended with many files and keep
431+everything organized and concise turned out to be more tedious than the setup
432+itself. So there comes [Ansible](https://www.ansible.com/). It is an
433+enterprise-graded software used to automate tasks. It has A LOT OF features and
434+it can be really helpful if you\'re a sysadmin but for now we\'re going to
435+focus on [Ansible
436+Pull](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#ansible-pull)
437+and
438+[Playbooks](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html).
439+As better described:
440+
441+> \[Ansible-Pull\] is used to up a remote copy of ansible on each
442+> managed node, each set to run via cron and update playbook source via
443+> a source repository. This inverts the default push architecture of
444+> Ansible into a pull architecture, which has near-limitless scaling
445+> potential.
446+>
447+> Playbooks are Ansible's configuration, deployment, and orchestration
448+> language. They can describe a policy you want your remote systems to
449+> enforce, or a set of steps in a general IT process.
450+>
451+> [source](https://docs.ansible.com/ansible/latest/cli/ansible-pull.html)
452+
453+The goal is to pull and run a playbook remotely using a git repository.
454+The playbook will describe the tasks needed to setup our machine from
455+scratch.
456+
457+But first lets toy a bit a with playbooks locally with `ansible-playbook`, to
458+do so we need to add `localhost` to ansible's hosts list. Add it to
459+ `/etc/ansible/hosts`:
460+
461+``` service
462+[all]
463+localhost
464+```
465+
466+As an experiment we\'re going to write a asks to install vim. Currently, I\'m
467+using [Fedora](https://getfedora.org/) thus we going to use [dnf
468+modeule](https://docs.ansible.com/ansible/latest/modules/dnf_module.html) to
469+install packages, but if you\'re using another distribution look for a
470+equivalent module like [apt
471+module](https://docs.ansible.com/ansible/latest/modules/apt_module.html) for
472+[Ubuntu](https://ubuntu.com/).
473+
474+The playbook to install is quite straightforward:
475+
476+``` yaml
477+# main.yaml
478+- hosts: all
479+ tasks:
480+ - name: install vim
481+ dnf:
482+ name: vim
483+ state: latest
484+```
485+
486+`hosts:` is required and it has to match our hosts otherwise the
487+playbook won\'t run.
488+
489+`tasks:` is the list of tasks that the playbook will perform, in this
490+case will be `dnf install vim`.
491+
492+To run a playbook use the command `ansible-playbook` commando to run
493+`main.yml` direct from disk, do to so just run the following command:
494+
495+``` bash
496+sudo ansible-playbook --connection=local main.yml
497+```
498+
499+After a few seconds, vim will be installed on your machine.
500+
501+```
502+PLAY [all] *************************************************************
503+
504+TASK [Gathering Facts] *************************************************
505+ok: [localhost]
506+
507+TASK [install vim] *****************************************************
508+ok: [localhost]
509+
510+PLAY RECAP *************************************************************
511+localhost : ok=2 changed=0 unreachable=0 failed=0
512+```
513+
514+This is the first step, next part we shall create a more complex
515+playbook and setup repository to run it remotely using `ansible-pull`.
516diff --git a/content/posts/2019-03-07-ansible-part-1.org b/content/posts/2019-03-07-ansible-part-1.org
517deleted file mode 100644
518index c8782e9068f8357b3c86c6a86da8d58f7064eb61..0000000000000000000000000000000000000000
519--- a/content/posts/2019-03-07-ansible-part-1.org
520+++ /dev/null
521@@ -1,99 +0,0 @@
522----
523-layout: post
524-title: "Automating setup with ansible-pull part-1"
525-date: 2019-03-07
526-lastmod: 2020-07-12
527-tags: ['ansible', 'ansible-pull', 'linux', 'fedora']
528----
529-
530-Every time that I do a clean install on my machine it takes a few hours till I
531-get to point where I was before formatting it, install all packages, select
532-themes, icons, fonts, install IDEs, extensions and so on. After doing it a few
533-times I came to the conclusion that I would save time by spending time automating this chore, and
534-as a result, I could tinker a little more with my system and not worry about
535-spending a weekend re-installing everything (which have happened more time that
536-I'd like to remember).
537-
538-<!--more-->
539-
540-So after a few attempts using python and bash I ended with many files and
541-keep everything organized and concise turned out to be more tedious than the
542-setup itself. So there comes [[https://www.ansible.com/][Ansible]]. It is an enterprise-graded software used
543-to automate tasks. It has A LOT OF features and it can be really helpful if
544-you're a sysadmin but for now we're going to focus on [[https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#ansible-pull][Ansible Pull]] and
545-[[https://docs.ansible.com/ansible/latest/user_guide/playbooks.html][Playbooks]]. As better described:
546-
547-#+BEGIN_QUOTE
548-[Ansible-Pull] is used to up a remote copy of ansible on each managed node, each
549-set to run via cron and update playbook source via a source repository. This
550-inverts the default push architecture of Ansible into a pull architecture, which
551-has near-limitless scaling potential.
552-
553-Playbooks are Ansible’s configuration, deployment, and orchestration language.
554-They can describe a policy you want your remote systems to enforce, or a set of
555-steps in a general IT process.
556-
557-[[https://docs.ansible.com/ansible/latest/cli/ansible-pull.html][source]]
558-#+END_QUOTE
559-
560-The goal is to pull and run a playbook remotely using a git repository. The
561-playbook will describe the tasks needed to setup our machine from scratch.
562-
563-But first lets tinker a bit a with playbooks locally with ~ansible-playbook~, to
564-do so we need to add ~localhost~ to ansible's hosts list. Add it to
565-~/etc/ansible/hosts~:
566-
567-#+BEGIN_SRC service
568-[all]
569-localhost
570-#+END_SRC
571-
572-As an experiment we're going to write a asks to install vim. Currently, I'm using
573-[[https://getfedora.org/][Fedora]] thus we going to use [[https://docs.ansible.com/ansible/latest/modules/dnf_module.html][dnf modeule]] to install packages, but if you're using
574-another distribution look for a equivalent module like [[https://docs.ansible.com/ansible/latest/modules/apt_module.html][apt module]] for [[https://ubuntu.com/][Ubuntu]].
575-
576-The playbook to install is quite simple:
577-
578-#+BEGIN_SRC yaml
579-# main.yaml
580-- hosts: all
581- tasks:
582- - name: install vim
583- dnf:
584- name: vim
585- state: latest
586-#+END_SRC
587-
588-~hosts:~ is required and it has to match our hosts otherwise the playbook won't
589-run.
590-
591-~tasks:~ is the list of tasks that the playbook will perform, in this case will
592-be ~dnf install vim~.
593-
594-To run a playbook use the command ~ansible-playbook~ commando to run
595-~main.yml~ direct from disk, do to so just run the following command:
596-
597-#+BEGIN_SRC bash
598-sudo ansible-playbook --connection=local main.yml
599-#+END_SRC
600-
601-
602-After a few seconds, vim will be installed on your machine.
603-
604-#+BEGIN_SRC
605-PLAY [all] *************************************************************
606-
607-TASK [Gathering Facts] *************************************************
608-ok: [localhost]
609-
610-TASK [install vim] *****************************************************
611-ok: [localhost]
612-
613-PLAY RECAP *************************************************************
614-localhost : ok=2 changed=0 unreachable=0 failed=0
615-#+END_SRC
616-
617-
618-This is the first step, next part we shall create a more complex playbook and
619-setup repository to run it remotely using ~ansible-pull~.
620-
621diff --git a/content/posts/2019-04-22-ansible-part-2.md b/content/posts/2019-04-22-ansible-part-2.md
622new file mode 100644
623index 0000000000000000000000000000000000000000..e50005e9850a3a37a0f3a08d1d2db66e9880d416
624--- /dev/null
625+++ b/content/posts/2019-04-22-ansible-part-2.md
626@@ -0,0 +1,79 @@
627+---
628+title: "Automating desktop setup with ansible-pull part-2"
629+date: 2019-04-22
630+lastmod: 2020-07-12
631+tags: ['ansible', 'ansible-pull', 'linux', 'fedora']
632+---
633+
634+Now we\'re going to setup ansible to work with a git repository. The process is
635+quite similar to `ansible-playbook`, the only difference is that the source for
636+the playbook will be a remote repository and not a local file. Following the
637+previous example we\'ll get vim setup automated.
638+
639+Create a git repository wherever you see fit,
640+[gitlab](https://about.gitlab.com/) and [github](https://github.com/) offer
641+free repositories. For this task we need to add only two file: one for the
642+`yml` file describing the tasks and the `.vimrc` file.
643+
644+In the `.vimrc` add your own configuration, you can see mine [over
645+here](https://gitlab.com/gabrielgio/homestation/-/blob/debcf3458df511aef9f7dca0cb73f6cf6baddd5d/.vimrc),
646+it is pretty small as I don\'t use it but for small text editing (like this
647+post) so you can start with that if you don\'t have one.
648+
649+The `yml` file will have two tasks, one is to install vim, just like we
650+did in the part 1.
651+
652+``` yaml
653+# main.yml
654+---
655+- name: install vim
656+ dnf:
657+ name: vim
658+ state: latest
659+```
660+
661+To copy `.vimrc` file to your `$HOME` we going to use [copy
662+module](https://docs.ansible.com/ansible/latest/modules/copy_module.html):
663+
664+``` yaml
665+# main.yml
666+---
667+- name: copy vimrc file
668+ copy:
669+ src: config/.vimrc
670+ dest: ~/
671+ mode: 0644
672+```
673+
674+After we\'ve added those two files to repository you will have be something
675+[like
676+this](https://gitlab.com/gabrielgio/homestation/-/tree/debcf3458df511aef9f7dca0cb73f6cf6baddd5d).
677+
678+And now we just need to run `ansible-pull` command
679+
680+``` shell
681+# you may need run it as a sudo
682+ansible-pull -U $YOUR_REPO -i all main.yml
683+```
684+
685+Params:
686+
687+- **`-i`** is a list of hosts.
688+- **`-U`** is the git repository URL.
689+
690+Remember `man` is your best friend, take a look at `man ansible-pull` to
691+know more about its parameters.
692+
693+The best part you can quickly test and see the result by running my
694+sample:
695+
696+``` shell
697+ansible-pull -U https://gitlab.com/gabrielgio/homestation.git -C debcf3458df511aef9f7dca0cb73f6cf6baddd5d -i all main.yml
698+```
699+
700+The idea here is to keep your repository as a source of truth when comes to
701+configuration, you can add `ansible-pull` to a CRON tab, so you just need to
702+push something to your repository and after a few minutes not only your machine
703+but all the machines that have it setup will run the playbooks. You can use
704+this method as a straightforward way to install software, update machines or
705+even distribute tooling company-wise.
706diff --git a/content/posts/2019-04-22-ansible-part-2.org b/content/posts/2019-04-22-ansible-part-2.org
707deleted file mode 100644
708index cea1161581878ec9042d46795f107bde8219b634..0000000000000000000000000000000000000000
709--- a/content/posts/2019-04-22-ansible-part-2.org
710+++ /dev/null
711@@ -1,75 +0,0 @@
712----
713-title: "Automating desktop setup with ansible-pull part-2"
714-date: 2019-04-22
715-lastmod: 2020-07-12
716-tags: ['ansible', 'ansible-pull', 'linux', 'fedora']
717----
718-
719-[[{{< ref "2019-03-07-ansible-part-1.org " >}}][See part 1]]
720-
721-Now we're going to setup ansible to work with a git repository. The process is
722-quite similar to ~ansible-playbook~, the only difference is that the source for
723-the playbook will be a remote repository and not a local file. Following the
724-previous example we'll get vim setup automated.
725-
726-Create a git repository wherever you see fit, [[https://about.gitlab.com/][gitlab]] and [[https://github.com/][github]] offer free
727-repositories. For this task we need to add only two file: one for the
728-~yml~ file describing the tasks and the ~.vimrc~ file.
729-
730-
731-In the ~.vimrc~ add your own configuration, you can see mine [[https://gitlab.com/gabrielgio/homestation/-/blob/debcf3458df511aef9f7dca0cb73f6cf6baddd5d/.vimrc][over here]], it is
732-pretty simple as I don't use it but for simple text editing (like this post) so
733-you can start with that if you don't have one.
734-
735-The ~yml~ file will have two tasks, one is to install vim, just like we did in
736-the part 1.
737-
738-#+BEGIN_SRC yaml
739-# main.yml
740----
741-- name: install vim
742- dnf:
743- name: vim
744- state: latest
745-#+END_SRC
746-
747-To copy ~.vimrc~ file to your ~$HOME~ we going to use [[https://docs.ansible.com/ansible/latest/modules/copy_module.html][copy module]]:
748-
749-#+BEGIN_SRC yaml
750-# main.yml
751----
752-- name: copy vimrc file
753- copy:
754- src: config/.vimrc
755- dest: ~/
756- mode: 0644
757-#+END_SRC
758-
759-After we've added those two files to repository you will have be something [[https://gitlab.com/gabrielgio/homestation/-/tree/debcf3458df511aef9f7dca0cb73f6cf6baddd5d][like
760-this]].
761-
762-And now we just need to run ~ansible-pull~ command
763-
764-#+BEGIN_SRC shell
765-# you may need run it as a sudo
766-ansible-pull -U $YOUR_REPO -i all main.yml
767-#+END_SRC
768-
769-Params:
770-- *~-i~* is a list of hosts.
771-- *~-U~* is the git repository URL.
772-
773-Remember ~man~ is your best friend, take a look at ~man ansible-pull~ to know
774-more about its parameters.
775-
776-The best part you can quickly test and see the result by running my sample:
777-#+BEGIN_SRC shell
778-ansible-pull -U https://gitlab.com/gabrielgio/homestation.git -C debcf3458df511aef9f7dca0cb73f6cf6baddd5d -i all main.yml
779-#+END_SRC
780-
781-The idea here is to keep your repository as a source of truth when comes to
782-configuration, you can add ~ansible-pull~ to a CRON tab, so you just need to push
783-something to your repository and after a few minutes not only your machine but
784-all the machines that have it setup will run the playbooks. You can use this
785-method as a simple way to install software, update machines or even distribute
786-tooling company-wise.
787diff --git a/content/posts/2019-11-16-compiling-emacs.md b/content/posts/2019-11-16-compiling-emacs.md
788new file mode 100644
789index 0000000000000000000000000000000000000000..6773344aec4370ee1a70118787a6b19df47d8e05
790--- /dev/null
791+++ b/content/posts/2019-11-16-compiling-emacs.md
792@@ -0,0 +1,40 @@
793+---
794+title: "Compiling emacs from source code on Fedora"
795+date: 2019-11-16
796+lastmod: 2020-08-25
797+tags: ['emacs', 'emacs27','linux', 'fedora']
798+---
799+
800+Compiling emacs from source and installing on fedora.
801+
802+# Installing Packages
803+
804+Install the following packages:
805+
806+```shell
807+sudo dnf install git autoconf make gcc texinfo \
808+ gnutls-devel giflib-devel ncurses-devel \
809+ libjpeg-turbo-devel giflib-devel gtk3-devel \
810+ libXpm-devel libtiff-devel libxml2-devel -y
811+```
812+
813+# Cloning Repository
814+
815+Clone repository
816+[savannah.gnu.org](http://savannah.gnu.org/projects/emacs/):
817+
818+ git clone -b master git://git.sv.gnu.org/emacs.git
819+
820+# Compiling
821+
822+Navigate to emacs folder (`cd emacs`) and run the following steps
823+
824+```shell
825+./autogen.sh
826+./configure
827+make -j$(nproc)
828+sudo make install
829+```
830+
831+After verify version with `emacs --version`, it should be equal or
832+higher than `28.0.50`.
833diff --git a/content/posts/2020-07-13-k8s.md b/content/posts/2020-07-13-k8s.md
834new file mode 100644
835index 0000000000000000000000000000000000000000..8b706c162077dbaa1437ee396b7e202bd1c761ef
836--- /dev/null
837+++ b/content/posts/2020-07-13-k8s.md
838@@ -0,0 +1,79 @@
839+---
840+title: "Road to local k8s"
841+date: 2020-07-13
842+tags: ['kubernetes', 'linux', 'fedora']
843+---
844+
845+# Goal
846+
847+The goal is to deploy kubernetes on my local networks, and keep everything as
848+reproducible as possible.
849+
850+# Stack
851+
852+I\'ll use Fedora Core OS, Matchbox and Terraform [^1], a match the requirements
853+for Tectonic [^2]
854+
855+## Steps
856+
857+- Network Setup DHCP/TFTP/DNS [^3]
858+- Matchbox [^4]
859+- PXE network boot environment
860+- Terraform Tectonic [^5]
861+
862+## Network Setup DHCP/TFTP/DNS
863+
864+First learning the basics again:
865+
866+- <https://linuxhint.com/install_dhcp_server_ubuntu/>
867+- <https://www.youtube.com/watch?v=XQ3T14SIlV4>
868+
869+To check open ports
870+
871+```shell
872+lsof -Pni | grep LISTEN
873+```
874+
875+Run the provided [^6] image with `dnsmasq` and PXE toolkit
876+
877+``` {.bash org-language="sh"}
878+docker run --rm --cap-add=NET_ADMIN --net=host quay.io/coreos/dnsmasq \
879+ -d -q \
880+ --dhcp-range=192.168.1.3,192.168.1.254 \
881+ --enable-tftp --tftp-root=/var/lib/tftpboot \
882+ --dhcp-match=set:bios,option:client-arch,0 \
883+ --dhcp-boot=tag:bios,undionly.kpxe \
884+ --dhcp-match=set:efi32,option:client-arch,6 \
885+ --dhcp-boot=tag:efi32,ipxe.efi \
886+ --dhcp-match=set:efibc,option:client-arch,7 \
887+ --dhcp-boot=tag:efibc,ipxe.efi \
888+ --dhcp-match=set:efi64,option:client-arch,9 \
889+ --dhcp-boot=tag:efi64,ipxe.efi \
890+ --dhcp-userclass=set:ipxe,iPXE \
891+ --dhcp-boot=tag:ipxe,http://matchbox.example.com:8080/boot.ipxe \
892+ --address=/matchbox.example/192.168.1.2 \
893+ --log-queries \
894+ --log-dhcp
895+```
896+
897+## Matchbox
898+
899+## PXE network boot environment
900+
901+## Terraform Tectonic
902+
903+------------------------------------------------------------------------
904+
905+# Links
906+
907+[^1]: <https://coreos.com/tectonic/docs/latest/install/bare-metal/metal-terraform.html>
908+
909+[^2]: <https://coreos.com/tectonic/docs/latest/install/bare-metal/requirements.html>
910+
911+[^3]: <https://coreos.com/matchbox/docs/latest/network-setup.html>
912+
913+[^4]: <https://coreos.com/matchbox/docs/latest/deployment.html>
914+
915+[^5]: <https://coreos.com/tectonic/releases/>
916+
917+[^6]: <https://github.com/poseidon/matchbox/tree/v0.7.0/contrib/dnsmasq>
918diff --git a/content/posts/2020-08-22-genpass.md b/content/posts/2020-08-22-genpass.md
919new file mode 100644
920index 0000000000000000000000000000000000000000..3991a869ae1185fb32f23e9d8d3571ece5bda66d
921--- /dev/null
922+++ b/content/posts/2020-08-22-genpass.md
923@@ -0,0 +1,39 @@
924+---
925+title: "Moving from Github to Gitlab pages"
926+date: 2020-08-22
927+tags: ['gitlab']
928+---
929+
930+This was quite fast, I had just to create a small Gitlab pipeline job and
931+publish to pages this is done by:
932+
933+```yml
934+image: clojure:lein-2.7.0
935+
936+before_script:
937+ - lein deps
938+
939+test:
940+ script:
941+ - lein test
942+
943+pages:
944+ stage: deploy
945+ script:
946+ - lein package
947+ artifacts:
948+ paths:
949+ - public
950+ only:
951+ - master
952+```
953+
954+before_script
955+: will download all the dependencies with `lein deps`.
956+
957+test
958+: is self explanatory.
959+
960+pages
961+: will compile the cljs into js with `lein package` and publish it
962+ into pages.
963diff --git a/content/posts/2020-12-28-k8s-private-registry.md b/content/posts/2020-12-28-k8s-private-registry.md
964new file mode 100644
965index 0000000000000000000000000000000000000000..6706da7e0dc59f40354d47252654eebc71723368
966--- /dev/null
967+++ b/content/posts/2020-12-28-k8s-private-registry.md
968@@ -0,0 +1,56 @@
969+---
970+title: "K8S private gitlab registry using podman"
971+date: 2021-12-28
972+tags: ['kubernetes', 'linux', 'podman', 'gitlab', 'k3s']
973+---
974+
975+This is based on [Log in to Docker
976+Hub](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).
977+It is just a bit different to use podman
978+
979+First we should take a look at podman-login man page:
980+
981+``` bash
982+man podman login
983+```
984+
985+It will give some valueable information like the location of auth.json
986+file. Now we can login using podman:
987+
988+``` bash
989+podman login registry.gitlab.com
990+```
991+
992+Then check the `auth.json` file located at
993+`${XDG_RUNTIME_DIR}/containers/auth.json` (as described by the manual).
994+
995+``` bash
996+cat "${XDG_RUNTIME_DIR}/containers/auth.json"
997+```
998+
999+It will print your auth config:
1000+
1001+``` json
1002+{
1003+ "auths": {
1004+ "registry.gitlab.com": {
1005+ "auth": "..."
1006+ }
1007+ }
1008+}
1009+```
1010+
1011+Now copy that file over to the server and register it in k8s with the
1012+following command:
1013+
1014+``` bash
1015+kubectl create secret generic regcred \
1016+ --from-file=.dockerconfigjson=auth.json \
1017+ --type=kubernetes.io/dockerconfigjson
1018+```
1019+
1020+Once you have created you can list by `kubectl get secret`:
1021+```
1022+NAME TYPE DATA AGE
1023+regcred kubernetes.io/dockerconfigjson 1 53s
1024+```
1025diff --git a/content/posts/2021-12-26-nfs-k3s.md b/content/posts/2021-12-26-nfs-k3s.md
1026new file mode 100644
1027index 0000000000000000000000000000000000000000..e9988c7970086b9652e5f81e64f9945e90a7bbd8
1028--- /dev/null
1029+++ b/content/posts/2021-12-26-nfs-k3s.md
1030@@ -0,0 +1,62 @@
1031+---
1032+title: "Enable NFS on K3S"
1033+date: 2021-12-26
1034+tags: ['kubernetes', 'linux', 'helm', 'k3s']
1035+---
1036+
1037+By default [K3S](https://k3s.io/) comes only with
1038+[local-path](https://github.com/rancher/local-path-provisioner) storage
1039+class, and if you are running with more than one node in your cluster
1040+you may want to use a more \"distributed\" solution. For may case I
1041+opted for NFS.
1042+
1043+To check the current storage class you can run:
1044+
1045+``` bash
1046+k3s kubectl get storageclasses
1047+```
1048+
1049+And it will print something like:
1050+
1051+ NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
1052+ local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d
1053+
1054+To start adding First you need to install
1055+[helm](https://github.com/helm/helm) on your server. To do so you may
1056+run:
1057+
1058+``` bash
1059+curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
1060+```
1061+
1062+**Be careful when running scripts directly into bash always check the
1063+source** **Sometimes is also recommended to do not pipe directly to
1064+bash**
1065+
1066+Once it is installed we need to add the [NFS storage
1067+classes](https://kubernetes.io/docs/concepts/storage/storage-classes/#nfs).
1068+It has two providers, I have chose [NFS Subdir External
1069+Provisioner](https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner).
1070+
1071+Add the helm repo
1072+
1073+``` bash
1074+helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
1075+```
1076+
1077+Then we need to actually install the provider
1078+
1079+``` bash
1080+helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
1081+ --set nfs.server=x.x.x.x \
1082+ --set nfs.path=/exported/path
1083+```
1084+
1085+Set the `nfs.server` and `nfs.path` accordingly with your setup.
1086+
1087+After that if we run `k3s kubectl get storageclasses` it will now print
1088+another NFS provider:
1089+
1090+ NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
1091+ local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 154d
1092+ nfs-client cluster.local/nfs-subdir-external-provisioner Delete Immediate true 76m
1093diff --git a/content/projects/_index.md b/content/projects/_index.md
1094index 3195403063fd9b557d9807a5e1cbef452cf82099..7dfbe4c445c5576be22a03eb3ca197553900a3a3 100644
1095--- a/content/projects/_index.md
1096+++ b/content/projects/_index.md
1097@@ -8,24 +8,24 @@
1098
1099 Just a list of some projects I have done and find useful on my day-to-day life.
1100
1101-- [Hub Watcher](https://hub-watcher.gabrielgio.me/)
1102+- [Hub Watcher](https://hub-watcher.gabrielgio.me/)
1103 [[gitlab](https://gitlab.com/gabrielgio/hub-watcher)]
1104-
1105+
1106 A small project to monitor changes in a docker image from [docker
1107 hub](https://hub.docker.com/). By default every 5 minutes it will fetch the
1108 digest of image and compare with the previous returned digest, if they are
1109 different it will make a post request to a given url.
1110-
1111+
1112 I created it so I can automatically trigger my gitlab pipeline to build my
1113 custom nextcloud image everytime Nextcloud GmbH updates their image.
1114-
1115+
1116 - [Reddit to Nextcloud
1117 importer](https://gabrielgio.gitlab.io/reddit-nextcloud-importer/)
1118 [[github](https://gitlab.com/gabrielgio/reddit-nextcloud-importer)]
1119
1120 A small project that monitors user\'s saved posts on reddit, downloads its
1121- media and uploads to a nextcloud instance.
1122-
1123+ media and uploads to a nextcloud instance.
1124+
1125 It combines 3 projects: [praw](https://github.com/praw-dev/praw) to read and
1126 motitor user's saved feed, [gallery-dl](https://github.com/mikf/gallery-dl)
1127 to download media from several sources, and
1128@@ -44,7 +44,7 @@ podcast client.
1129
1130 - [Password generator](https://genpass.gabrielgio.me/)
1131 [[gitlab](https://gitlab.com/gabrielgio/genpass)]
1132-
1133+
1134 It started with me having fun with clojure script ([last
1135 commit](https://gitlab.com/gabrielgio/genpass/-/tree/2db3d88503fbe219e99c464c4cc8e768613e1359)).
1136 Now I have been using it as a playground to play a bit with rust/wasm and it
1137diff --git a/themes/flamingo/layouts/partials/header.html b/themes/flamingo/layouts/partials/header.html
1138index 80240ee39565cdd7b8199c8a927b84c0a1c78a53..317d5899d9cfa26d54f0c5a5b8080ee5fb5c9475 100644
1139--- a/themes/flamingo/layouts/partials/header.html
1140+++ b/themes/flamingo/layouts/partials/header.html
1141@@ -8,7 +8,6 @@ </a>
1142 <nav>
1143 <ul>
1144 <li><a class="{{ cond (eq .Title "Posts") "active-link" ""}}" href="/posts/">posts</a></li>
1145- <li><a class="{{ cond (eq .Title "Logs") "active-link" ""}}" href="/logs/">logs</a></li>
1146 <li><a class="{{ cond (eq .Title "Projects") "active-link" ""}}" href="/projects/">projects</a></li>
1147 <li><a
1148 href="https://gitlab.com/gabrielgio/cv/-/raw/main/cv.pdf?inline=false"