refactor: moved to hugo

This commit is contained in:
Felipe M 2024-06-16 20:39:53 +02:00
parent 4c6912edd0
commit e77e5583c2
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8
604 changed files with 1675 additions and 2279 deletions

View file

@ -0,0 +1,16 @@
+++
title = "2016 updates"
date = 2016-04-08
+++
It's sad but I always end up not writing in the blog for some reason. I will
post here a short TL;DR of what happened in the last months and some of the
stuff I want to do for the site (and what I've already done).
* First of all, I got promoted at my job (this was like... months ago!) which left me with even less time that before for personal stuff. I can't believe I'm saying this but when I get out of the office the last thing I want to do is sitting in front of my computer again.
* Good part, I have been trying all the stuff at work I couldn't before and adding goodies to the dev team (automatic code reviews, unit testing, deployments, etc)
* Bad stuff: now I develop less than before. :_
* Also, I wasn't comfortable with how the editor on the site worked (it's a CKEditor) because I'm a big fan of markdown so I wasn't eager to do nothing until some day I did a clumsy implementation to support markdown conversion to HTML to the blog. [I also added some other goodies](https://trello.com/b/QgoVFfl2/fmartingr-com).
* More stuff to the mix? I got pretty much overwhelmed with all the things I had to/want to/should do on a daily basis so my workflow was chaotic. I have been trying new habits to sort everything out and now I'm more or less comfortable with the results. And I will write an entry about that :)
* Related with the last one now I'm not giving up on reading all the stuff in "the read later vault" which until not so long ago was filled with diverse stuff and articles came in but not out.
* I play a bit now! Since I have thoughts and days in order now I can rest from time to time to play some videogames. It was time to remove the dust from my 3DS.

View file

@ -0,0 +1,40 @@
+++
title = "The penguin trials"
date = 2016-04-11
+++
I've been using OS X for my workstation environment for about five or six
years now. I always say (and believe to this moment) that OS X is the most
comfortable environment for work.
It has an stable window manager, a terminal that does not suck and lot's of
software related to my daily activities. I can reinstall and have a fully
working environment from scratch in an hour or so (no hdd dupes, a full OS
installation).
I've been really comfortable with this for a long time, and with [the last
features coming to windows](http://arstechnica.com/information-
technology/2016/03/ubuntus-bash-and-linux-command-line-coming-to-windows-10/)
I thought that it was time to refresh my GNU/Linux rants and give it a try
again like I did to Android not so long ago.
So, here's the deal: Starting today I'm going to spend one month on a linux
environment at work to see how it goes. I think the starting transition will
be easier since at work most of the company tools are online or done via ssh,
and my most used app is emacs and I use it directly on a terminal.
The chosen penguin is: [AntergOS](https://antergos.com/) (based on [Arch
Linux](https://www.archlinux.org/), it simplified me the installation process)
with [i3](https://i3wm.org/) as the window manager. I always wanted to try a
tiling _wm_ so this is the best moment to do so, and Arch was my favourite OS
back at the time and I will know how to use most of the internals if it hasn't
changed a lot.
![](wallpaper.png)
For now I just have installed my most common apps and I haven't tuned a bit
apart from the screensaver. I'm sure this will change in no time. I will try
to make weekly or biweekly entries with updates, or if things don't get out of
control just a summary after a month.
Let's see how it goes!

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,267 @@
+++
title = "The penguin trials after two weeks"
date = 2016-04-27
+++
It's been two weeks already and I will make a quick post with two subjects:
the stuff broken that needed to be fixed (from my point of view) and
improvements to the workstation that made my life easier.
After other two weeks I will post a summary with the good and bad parts.
<!--more-->
## Stuff fixed
### Lightdm black screen
After the first reboot the first problem appeared, the lightdm login window
was a black screen (accepting input but showing nothing). I remember that from
not so long ago when I tried to install linux on my home computer and that
happened, luckily it had a solution, I just needed to install `lightdm-gtk-
greeter` and replace it at the lightdm configuration.
``` text
# /etc/lightdm/lightdm.conf
# ...
greeter-session=lightdm-gtk-greeter
# ...
```
### Better font rendering for i3
The default fonts for the i3bar and so on are a bit clunky for my personal
taste so I changed the rendering from `pango` to `xft` and now it looks nice.
``` text
font xft:monospace 8
```
### Better font rendering system wide (ala. OS X)
One of my worst problems with linux is the font rendering. Everything looks
worse than on OS X, that's a fact. Even people using linux desktops say it
when looking text on a OS X machine. Luckily I found `infinality`, a patch for
the font rendering in the freetype2 package that left my fonts almost
_Macish_.
I just installed the `infinality-bundle` following [the official ArchLinux
Wiki entry](https://wiki.archlinux.org/index.php/Infinality) on the subject
and used the setup for the _Soft of OS X_ appareance editing the
`/etc/profile.d/infinality-settings.sh` using the `ultimate5` configuration.
``` text
export INFINALITY_FT="ultimate5"
```
Just restart X to the settings to take effect. I haven't seen problems with
the infinality patch until now.
## Improvements over the base system
### Adding some background with feh
The most basic stuff! I don't really know if there's another way to do this
but looking around I found that using `feh` you can just point to an image
file and use that as wallpaper.
Just adding this to my i3 config file:
``` text
exec_always feh --bg ~/.config/i3/wallpaper.png)
```
I want to improve it having a script that will iterate over png images inside
a folder and using one at random but since I don't need fancy stuff this will
work for now.
### Running stuff when I log in
To start programs when you log in at your session adding them to your i3
configuration seems like the way to go:
``` text
# Startup programs
exec dropbox
```
### Adding a lock screen with i3lock
Another thing I missed a lot. When I leave my desk I lock my computer so no
one can, just say, put a David Hasselhoff wallpaper on it or something, so
with `i3lock`, `scrut`, a bash script and a key binding I have a very nice
screen locker in place!
``` text
#!/bin/sh
# Take screenshot
scrot /tmp/lockscreen.png)
# Pixellate
mogrify -scale 10% -scale 1000% /tmp/lockscreen.png)
# Lock screen with the image
i3lock -i /tmp/lockscreen.png)
```
And in the i3 config file:
``` text
bindsym $mod+l ~/.config/i3/i3lock.sh
```
### More integrated notifications with dunst
Since the default desktop environment I installed was xfce4, the notifications
being shown was from them and it were horrible. Instead of that I installed
[dunst](https://github.com/knopwob/dunst).
![dunst notifications](dunst.png)
They are not the best looking notifications but are well integrated with the
system design and are highly customizable, they will change soon enough :)
### Using the media keys for volume with alsa mixer
This was easy since I just need to bind the X media volume up and down to the
alsa mixer control app so I can use the keyboard to control the system volume
easily.
``` text
# Media keys
bindsym XF86AudioRaiseVolume exec amixer -q set Master 4%+ unmute
bindsym XF86AudioLowerVolume exec amixer -q set Master 4%- unmute
```
### Using the media keys for media players with playerctl
By default my system didn't recognize the media keys for
play/pause/back/forward for any player but this was the easiest of them all.
Just installed `playerctl` and every app I used until now worked out of the
box. Even the forward/backwards keys for `mpv` which wasn't working for mpv
with mps-youtube on OS X are functional on my linux box!
``` text
# Media player controls
bindsym XF86AudioPlay exec playerctl play-pause
# bindsym XF86AudioPause exec playerctl pause
bindsym XF86AudioNext exec playerctl next
bindsym XF86AudioPrev exec playerctl previous
```
### Removing the title bars for the windows
That was space I didn't need, it may seem stupid but... how often do you look
at the titlebar of the app you're using? Some like the browsers didn't even
have one! So I've removed the titlebars and left only 2px borders for the
application windows.
``` text
# Windows without titlebars
for_window [class="^.*"] border pixel 2
```
### Auto enable floating for pop-up windows
It was really annoying watching a google login window take half of the desktop
just for a moment to login into a service, so every window with the role of
popup is now floating by default.
``` text
# Browser popups floating
for_window [window_role="pop-up"] floating enable
```
### Using a custom i3bar with i3pystatus
Since most of the default information the i3bar was unnecesary I found out
about i3pystatus that allows you to use python modules to customize the i3bar
at will. Below are my config file and the i3bar.py I use for it.
``` python
from i3pystatus import Status
from i3pystatus.updates import pacman, yaourt
status = Status()
# Pacman/Yaourt updates
status.register("updates",
format="Updates: {count}",
format_no_updates="No updates",
backends=[pacman.Pacman(), yaourt.Yaourt()])
# Displays clock like this:
status.register("clock",
format="%a %-d %b %H:%M",)
# CPU
status.register('cpu_usage')
# Memory
status.register('mem',
format='{used_mem}/{total_mem}')
# Shows the average load of the last minute and the last 5 minutes
# (the default value for format is used)
status.register("load", color='#00ff00')
# Shows the address and up/down state of enp6s0
status.register("network",
interface="enp6s0",
format_up="{v4cidr}")
# Shows disk usage of /
status.register("disk",
path="/",
format="{used}/{total}G [{avail}G]",)
# Shows pulseaudio default sink volume
status.register("pulseaudio",
format="♪{volume}",)
status.run()
```
``` text
# .config/i3/config
bar {
status_command ~/.config/i3/i3bar.py
position up
}
```
### Hide the mouse cursor when not needed
Using i3 I rely on the keyboard a lot, so much that sometimes my wireless
mouse turn itself off to save battery due to inactivity. That said, it's
really annoying for me having the cursor over text I'm writing or just sitting
there when I don't need it so I installed
[unclutter](https://wiki.archlinux.org/index.php/unclutter) and running it on
startup was very relieving.
``` bash
# .config/i3/unclutter.sh
#!/bin/bash
unclutter &
```
``` text
# .config/i3/config
exec ~/.config/i3/unclutter.sh
```
## What's next?
There are still two weeks pending and even after all this tweaks the
customization is far from over! There are still stuff I miss a lot, like:
* Easily take screenshots with keybinds.
* Better window switching.
* Better dmenu launcher
* Prevent the screenshoter from drawing the area selector on the screenshot taken. (**xfce4-screenshoter**)
* `ctrl`+`e`/`a` for end and start of line global keybinds.
* Use the scratchpad more and try to improve it.
See ya in two weeks!

View file

@ -0,0 +1,30 @@
+++
title = "New site"
date = 2016-12-21
+++
After a really long time I finally managed to spend some time redesigning and moving my blog to another platform, everyone already know that [I tried really hard](https://gitlab.com/fmartingr/fmartingr.com/blob/master/fmartingrcom/themes/v1/templates/blog/entry.jinja#L67) to create an editor that satisfied me while the answer was simpler.
<!--more-->
I like to *reinvent the wheel* (~~I don't even know if that expression exists or it's said like that in English, let me know!~~ [Apparently yes](http://www.urbandictionary.com/define.php?term=reinvent%20the%20wheel)) but this time I got really far... like years far: I stopped writting because I did not find any editor confortable to the point [I created my own blog application](https://gitlab.com/fmartingr/fmartingr.com) without success. This madness has to stop, there has to be something already there for me.
After trying almost every blog and static content generator out there I stumbled upon [https://www.getlektor.com](Lektor), a simple but really powerful static site generator that almost completely fit my needs.
After trying it a bit, I migrated the new theme I was making [in a refactor of my old site to Flask](https://gitlab.com/fmartingr/fmartingr.com/tree/v3) (*yikes!*) and recreated the same site structure to do a final test.
I liked it.
*But why?* you may ask... *Lektor's editor is worst that the one you made*.
And you are right, Lektor's editor is just a `textarea`, but you forget one thing: **all the content are plain text files that I can edit with whatever I want**.
Having this flexibility is awesome, most of the content of the site [is edited in either Emacs or Atom](/made-with-open-source). Even if it was tricky at first because Lektor creates all the content in the same path [I managed a -I'm sure overengineered- way](https://github.com/fmartingr/fmartingr-lektor/tree/master/content) to sort the files the way I wanted. Will improve it in the future when I know more about Lektor's internals.
The theme also reflects the change I've been noticing in the past year: I want simplicity, so the site is as simple as it gets.
Just a few colors, no CSS frameworks (only a simple grid) and everything is made up from scratch. It still needs a little enhancements but it wont get much further. Also I'm sure I left a few stuff broken when I migrated all the blog entries but everything will be fixed with time.
I hope this gives me more time and motivation to keep writing. There are a few old drafts from tools that I'm going to finish up, and... well, more stuff that will be shared with you in future posts. :)
P.S.: I do not forget that I owe you the conclusion of [the penguin trials](/blog/2016/04/11/penguin-trials/) too!

View file

@ -0,0 +1,94 @@
+++
title = "A week for personal development"
date = 2016-12-26
+++
Sadly, over time, my programming time at work is becoming less frequent. Doesnt mean I dont do stuff its just little by little most my time is spent on management things. Since I dont want to get stalled and to give myself focus into other things I got last week off to see whatever I was capable of making. To my surprise it was time well spent.
<!--more-->
> Side effect: instead of five or six days it was down to four or less cause you know, everyone is busy these days ;)
So, what did I do?
## Used Lektor to build this site
[This site on github](https://github.com/fmartingr/fmartingr-lektor)
I finally managed to rebuild my site from scratch with [lektor](https://www.getlektor.com). Already wrote about this [in a previous post](/blog/2016/12/21/new-site/).
Summary:
- :arrow_up_small: Read other people's code, which is nice.
- :arrow_up_small: Made some goodies with Make, Gulp and Bash to automate stuff.
- :arrow_up_small: Discovered that ARM servers are ~~not so~~ fun.
- :arrow_down_small: It wasn't coding.
## Natif
[Natif on github](https://github.com/fmartingr/natif)
Simple app to use a website as a desktop application.
I wanted to do something with [electron](https://electron.atom.io) for some time now and since I use some webapps that I wanted outside of my browser this was a simple yet powerful ally for me.
I wanted it mostly to create a *Netflix app* because my main browser is Firefox and Netflix isn't working on it but [I came into *trouble* when trying it out](https://github.com/fmartingr/natif/issues/1).
Summary:
- :arrow_up_small: Tried electron.
- :arrow_up_small: Simple code, good results.
- :arrow_down_small: Widevine.
- :arrow_down_small: Packaging automation on release for every operating system without a decent server will force me to use jenkins, and I don't want to.
## SymbolDoc
[Symboldoc on github](https://github.com/fmartingr/symboldoc)
Print a simple docstring based on a given python module and a symbol name.
I wanted to use [abtract syntax trees](https://en.wikipedia.org/wiki/Abstract_syntax_tree) for something thinking it was more difficult than it really were, and it came to a simple script that print a docstring for a symbol that also could be easily integrated into my emacs setup, forcing me to document my projects more.
Summary:
- :arrow_up_small: Used AST!
- :arrow_up_small: Made tests.
- :arrow_down_small: Understanding the AST wasn't as difficult as I expected.
## Nout
[Nout on github](https://github.com/fmartingr/nout)
Maybe in the future a note taking app.
After trying almost every note taking app out there mine are just files on a `Notes` folder written in markdown syntax. Thinking about what I needed, it came just to a couple features, so I thought that creating an index of my notes in a sqlite database would be enough. Parsing files to normalize the information and using simple queries to look up for the data.
Right now I only made the file watcher and the database storage, there's a pull request on the works with some tests. It's not usable yet.
Summary:
- :arrow_up_small: Forgot how fun was working with multithreading.
- :arrow_up_small: Getting the mindset to start bigger projects.
- :arrow_up_small: Now I know that [fnmatch](https://docs.python.org/3.6/library/fnmatch.html) exists.
- :arrow_down_small: Got the feeling that the components are not as modular as they should be.
- :arrow_down_small: Not enough testing, solving it now.
- :arrow_down_small: Not documented, but time was scarce.
## Other stuff
Other things I did:
- Started reading [the pragmatic programmer](https://pragprog.com/book/tpp/the-pragmatic-programmer) and started to feel that it was money really well invested. **Highly recommended to every developer out there**. (Thank you [@RusEu](https://github.com/RusEu) and [@MiguelGR](https://github.com/miguelgr))
- Made a few Pull Requests to [i3pystatus](https://github.com/enkore/i3pystatus). Minor things but it felt rewarding.
- Made [a simple plugin for lektor](https://github.com/fmartingr/fmartingr-lektor/tree/master/packages/emojify). Not published yet.
- Built a list of stuff to automate my laptop provisioning with Ansible even more.
- Tuned a little bit more my i3 configuration.
- Found out tools like codecov, scrutinizer and gemnasium.
- Learn things about open source projects (guidelines, contribution, CI, ...).
- Moved my site from a custom server to [Firebase](https://www.firebase.com).
Things I miss:
- Doing something in another programming language. Not so long ago [I tried golang](https://github.com/fmartingr/goshare) and I got the feeling that I should have invested more time in this or a new one.
- Lack of documentation but you know, when there's not enough time...
- Focus on unit testing more than I did.
- Related with the above, should have tried to use [TDD](https://en.wikipedia.org/wiki/Test-driven_development) or another different development process.
- Not having a boilerplate to create projects and its integrations and base file tree, spent a lot of time doing it. It's silly because you're not creating tons of projects in a short period of time but it's a task that could be automated somehow.
Overall it felt really rewarding. I encourage everyone to get some time off to create new stuff, maintain your projects, create that tool you always wanted, research about that subject you read so long ago, etc.
I don't know when but I will surely repeat this.