kloeckner.com.ar

a backup of my entire webpage
Index Commits Files Refs README LICENSE
commit d890b5f57e5c844bec76e082f2b180b94f65cd6f
parent fdfb339c4849637acc8a6226211e99278fa0e6fc
Author: mjkloeckner <martin.cachari@gmail.com>
Date:   Fri, 21 Oct 2022 01:00:41 -0300

Blog update

Diffstat:
Mmd/dwm-config/dwm-config.md | 106++++++++++++++++++++++++++++++++++++++++++-------------------------------------
Mmd/nerdearla-2022/nerdearla-2022.md | 63+++------------------------------------------------------------
Mmd/sav/sav.md | 13+++++++------
Mmd/vim-config/vim-config.md | 35+++++++++++++++++++++++------------
4 files changed, 89 insertions(+), 128 deletions(-)
diff --git a/md/dwm-config/dwm-config.md b/md/dwm-config/dwm-config.md
@@ -5,9 +5,9 @@
 
 A window manager is a software that can manage the layout and appearance
 of every window spawned in your desktop, most people confuse them with
-desktop enviroments, which isn't the same since a desktop enviroment is
-more of an ecosystem, they come with a more 'complete' set of tools,
-like a basic web browser, a terminal emulator or calculator, an example
+desktop enviroments, which aren't the same since a desktop enviroment is
+more like an ecosystem, they come with a more 'complete' set of tools,
+like a basic web browser, a terminal emulator or a graphical calculator, an example
 of desktop enviroment would be gnome, xfce or kde plasma; instead a
 window manager is only the program that manages the windows spawned,
 although there are window managers that come with a little more, like
@@ -16,7 +16,7 @@ docks or taskbars (openbox for example).
 In my case I use dwm, which is a window manager written in C developed
 by suckless software. The most relevant thing of this window manager is
 that out of the box it comes with the most basic functionallity, and if
-you want to extend it you need to patch it.
+you want to extend it you need to patch it (I explain patching later).
 
 By default dwm comes with 9 workspaces, in which you can open as many
 windows as you please; to spawn a new window for example a web browser
@@ -29,23 +29,23 @@ you need to assign it a keybinding or use an application launcher like
 
 ### Requisites
 
--   GNU/Linux or BSD based operating system
--   A C library and a C compiler
--   make utility installed
--   X server installed
--   dwm source code, you can clone the repository or download as a tar file at the web
+- GNU/Linux or BSD based operating system
+- A C library and a C compiler
+- make utility installed
+- X server installed
+- dwm source code
 
 As you can see above you can only install dwm on GNU/Linux or BSD based
-distros, unfortunally dwm is not available for Windows users but I'm
-sure there is an alternative.
+distros, unfortunally dwm is not available for Windows users and I'm not
+sure if there is an alternative.
 
-### Installation
+### Steps
 
-In order to install dwm you can visit the web of the creators at
-[suckless.org/dwm](https://dwm.suckless.org/), where you can download
-the source code as a tar file, or clone the repository.
+In order to install dwm download the source code from [suckless.org/dwm](https://dwm.suckless.org/),
+you can clone the repo from [git.suckless.org/dwm](https://git.suckless.org/dwm) or
+download it as a tar file.
 
-After you obtain the source code you need to navigate to the root folder
+After you obtain the source code navigate to the root folder
 of the source code and execute the following command
 
 ```console
@@ -53,64 +53,68 @@ $ sudo make install
 ```
 
 after that you can log out of you user account, if you use a display
-manager you can select dwm as window manager and log back in, if you
-dont use a display manager you need to edit your .xinitrc file located
-at you home folder so that when you start X dwm gets launched too, you
+manager, select dwm as window manager on it and log back in, if you
+don't use a display manager, you need to edit your .xinitrc file located
+at your home folder, so that when you start Xorg dwm gets launched, you
 do this by adding \`exec dwm\` to the end of the .xinitrc
-file, its important that you add it to the end of the file.
+file, its *important* that you add it to the end of the file.
 
 ```console
 $ cat $HOME/.xinitrc
 exec dwm
 ```
 
-Then you can start the X server by executing \`startx\` on a tty and it
-should open dwm without any problems.
+Then you can start the X server by executing \`startx\` on a tty and
+dwm should start without any problems.
 
-## How do you configure dwm?
+## Customizing dwm
 
-Basically you configure it by editing its source code, inside the root
+Basically you configure dwm by editing its source code, inside the root
 folder of the project there is a C header file named
-[config.def.h](https://github.com/klewer-martin/dotfiles/blob/master/.config/dwm/config.def.h)
-which if you open with a text editor you can see that there is some C
-code that you can edit, for example the line \"static const int topbar\"
+[config.def.h](https://github.com/mjkoeckner/dotfiles/blob/master/.config/dwm/config.def.h)
+which if you open with a text editor you can see that is a C
+file that you can edit, for example the line \"static const int topbar\"
 defines a variable named topbar which you can set to 1 or 0, to select
-if the status bar should spawn in the top or the bottom of the screen.
+if the status bar should spawn in the top or the bottom of the screen respectively.
 After every change you make to the source code you need to copy
 config.def.h to config.h and then recompile dwm
 
 ### Show information on the status bar
 
 dwm by default won't show any information on the status bar, this is
-done by using the xsetroot utility, which sets the WM\_NAME enviroment
-variable that dwm uses, lets assume you want to set the clock and date
-on the status bar, well you could execute the following command
+done by using the xsetroot utility, which sets the value of WM\_NAME enviroment
+variable, the content of this variable is automatically displayed by dwm on the
+right side of the statusbar. Lets assume you want to set the clock and date
+on the status bar, well you could accomplish this by executing the following command
 
 ```console
 $ xsetroot -iname $(date)
 ```
 
-and all the output of the command \`date\` would be printed on the status bar, this
+and all the output of the command \`date\` would be stored on the WM\_NAME variable
+causing dwm to print the date on the statusbar, this
 makes dwm status bar highly scriptable, in fact there are a ton of status
 bar implementations, the one that I use is called
 [dwmblocks](https://github.com/torrinfail/dwmblocks) and its also
 written in C and the configuration its pretty much the same as dwm, in
 order to get information you need to have scripts that prints the
-desired data to stdout, then you can include it on the config.h of
-dwmblocks by having them on a folder which is included in the \$PATH
-variable of your user.
+desired data to stdout, then you can include them on the config.h of
+dwmblocks. It is important that the scripts are on your user's PATH, otherwise
+it won't work.
 
 ### Getting emoji support on dwm
 
 dwm by default doesn't come with emoji support, if you want to render
-an emoji in the status bar its going to either show it as a box or in
-the worst case crash, so in order to get emoji support first you need to
-get a font with emojis, I'm using [JoyPixels®
-font](https://www.joypixels.com/) you can also use
-[Google's noto font](https://fonts.google.com/noto), or any other font
-that comes with emoji support. Then open dwm configuration file and
-append to the fonts array the name of the font you want,
-in my case it's JoyPixels®.
+an emoji in the status bar, it's going to either show it as a box or in
+the worst case crash.
+
+In order to get emoji support first make sure you have installed \`libxft\`,
+then you need to get a font with emoji support, I'm using [JoyPixels® font](https://www.joypixels.com/)
+you can also use [Google's noto font](https://fonts.google.com/noto),
+or any other font that comes with emoji support, then open dwm \`config.def.h\` and
+append to the fonts array the name of the font you want to use as fallback for the first font,
+since the emojis are not being printed because the font used doesn't include emojis, my
+config looks like this:
 
 ```c
 static const char *fonts[] = { "Source Code Pro:style=Regular:size=9",
@@ -118,15 +122,15 @@ static const char *fonts[] = { "Source Code Pro:style=Regular:size=9",
                                  "DejaVu Sans" };
 ```
 
+I've also added \`DejaVu Sans\` to the fonts array because, sometimes, the emojis where being displayed
+with a little box or square next to them, this was a quick solution.
+
 After you setup the font you need to remove or comment a chunk of code
 from drw.c, a file located in the root of the folder where dwm source
 code resides, between lines 136-150 there is a function named IsCol, you
-need to remove it or comment it.
+need to remove it or comment it, since this causes dwm to crash sometimes.
 
-Finally you can recompile dwm and you will get emoji support. Sometimes
-even though you made all this procedure you still get boxes insted of
-the proper emoji, I solved this by adding another font name in the
-fonts array, like a fallback font.
+Finally you can recompile dwm and, if everything went fine, you will get emoji support.
 
 ### Patches in dwm
 
@@ -138,13 +142,15 @@ from [suckless.org/patches](https://dwm.suckless.org/patches/), then
 make sure you got it 'patch' installed, although I think it comes with
 most linux distributions by default nowdays.
 
+To apply a patch navigate to dwm's root folder and execute this command
 ```console
 $ patch -p1 < <file.diff>
 ```
+being \`file.diff\` the patch file downloaded previoulsy of course.
 
 If you never patched dwm before then probably no errors would be
-reportjd, but if you already have applied a ton of patches then probably
-you would get a HUNK \## FAILED, in this case you need to get your hands
+reported, but if you already have applied a ton of patches, (or sometimes just a couple)
+then probably you would get a HUNK \## FAILED, in this case you need to get your hands
 dirty, and manually patch all the files that failed, you do this by
 opening the files with .rej extension (short for rejected), and the
 corresponding file to be patched, for example dwm.c and dwm.c.rej, and
diff --git a/md/nerdearla-2022/nerdearla-2022.md b/md/nerdearla-2022/nerdearla-2022.md
@@ -5,67 +5,10 @@
 
 As the title says I'm going to be present at [Nerdearla](https://nerdear.la/).
 
-This will be my second time that I attend to this event since I've been there for the first time in 2019. I remember that [John 'Maddog' Hall](https://en.wikipedia.org/wiki/Jon_Hall_(programmer)) was making a presentation called "50 years of UNIX and the landing on the Moon", you can find a record of the presentation [here](https://www.youtube.com/watch?v=9O_FnKZI6_M).
+This will be my second time that I attend to this event since I've been there for the first time in 2019. I remember that [John 'Maddog' Hall](https://en.wikipedia.org/wiki/Jon_Hall_(programmer)) was making a presentation called "50 years of UNIX and the landing on the Moon", and it was very enjoyable, you can find a record of the presentation [here](https://www.youtube.com/watch?v=9O_FnKZI6_M).
 
 [![Nerdearla 2019](nerdearla-2019.jpeg)](nerdearla-2019.png "Nerdearla 2019")
 
-It was my first talk ever and I loved it, sadly becouse of the pandemic I couldn't go in the past two years.
+It was my first talk ever and I loved it, sadly, because of the pandemic the event could only be remote the past two years.
 
-The event is half remote half presential and the entrance is free. It takes place at Centro cultural Konex on Once, Buenos Aires on Oct 19 to Oct 22, last three days.
-
-```console
-$ sudo make clean install
-```
-
-This is how I replace the variables in the template with the data aquired from the metadata contained in the files written in markdown
-
-```console
-$ sed -e "s/\$article-title\\$/$title/" -e "s/\$article-date\\$/$date/" \
-    -e "s/\$pagetitle\\$/$pagetitle/" -e '/\$body\$/r./body.html' \
-    -e '/\$body\$/d' $TEMPLATE > $filename.html
-```
-
-This is how I generate this webpage, converting it from its markdown file into html, this is a custom scripts that I made that only depends on lowdown, grep, and sed. Previously I had another script similar, which depended on pandoc, which is an alternative of lowdown but much more bloated, it depends on a ton of libraries wirtten in haskell
-
-
-```
-$ ./build.sh nerdearla-2022.md
-```
-
-this is an nginx config file snippet taken from [LandChad.net](https://landchad.net)
-
-
-```nginx
-server {
-    #...
-    auth_basic "What's the Password?" ;
-    auth_basic_user_file /etc/nginx/myusers ;
-    location /public/ {
-        #...
-        auth_basic off ;
-    }
-    #...
-}
-```
-
-```c
-int main (void)
-{
-    SAV *sav = NULL;
-    Drw *drw = NULL;
-    time_t tic, toc;
-    unsigned int ti, tf, dt, time_per_frame;
-    pthread_t p1 = 0;
-    status_t st;
-
-    if((st = SAV_create(&sav)) != OK) goto end;
-    if((st = drw_create(&drw)) != OK) goto end;
-
-    tic = time(NULL);
-    time_per_frame = 16; /* miliseconds */
-    sav->arr->shuffle(sav->arr);
-
-    char *hw = "Hello, world!\n"
-    return 0;
-}
-```
+The event is half remote half presential and the entrance is free, you can get your free tickets at [registro.nerdear.la](https://registro.nerdear.la/). It takes place at Centro cultural Konex at Once, Buenos Aires, on Oct 19 to Oct 22.
diff --git a/md/sav/sav.md b/md/sav/sav.md
@@ -1,18 +1,17 @@
-% title: "SAV - Sorting Algorithms Visualized"
+% title: "Sorting Algorithms Visualized in SDL2"
 % date: "18-Sep-2022"
 
-# SAV - Sorting Algorithms Visualized
+# Sorting Algorithms Visualized in SDL2
 
-This is a desktop app that shows how an array is being sorted using different algorithms.
+SAV, short for Sorting Algorithms Visualized, is a desktop app that shows how an array is being sorted using different algorithms.
 
 ![](sav.gif "Gif showing SAV working")
 
 I made it using pure C and SDL2 for graphics, you can take a look at it's source code on [Github](https://github.com/mjkloeckner/sav).
 
-The main purpose of this app was to put in practice the knowledge I gained in C as well with algorithms, and it was like a challenge since I'd never used SDL2 graphics before. In the end was a very enjoyable project since SDL2 per se is a very simple and easy to use library.
+The main purpose of this app was to put in practice the knowledge I gained in C as well with algorithms, and it was like a challenge since I have never used SDL2 graphics before. In the end it was a very enjoyable project since SDL2 per se is a very simple and easy to use library.
 
-
-Currently it supports the following algorithms:
+Currently the following sorting algorithms can be displayed:
 
 * bubble sort improved
 * insertion sort
@@ -21,3 +20,5 @@ Currently it supports the following algorithms:
 * shell sort
 * selection sort
 * heap sort
+
+but in a future I would like to add more algorithms, as well as sound.
diff --git a/md/vim-config/vim-config.md b/md/vim-config/vim-config.md
@@ -11,29 +11,40 @@ file that someone wrote, this webpage it's just text interpreted by
 your web-browser, whose also just plain text implemented by another
 program, some software has more complexity than others, for example the
 linux kernel it's estimated that has around 27.8 million lines of code,
-which is also just plain text
+which is also just plain text.
 
-The way we tell computers what to do it's with text, so in order to
-write that text we just need a text editor and this is were Vim it's
-known for. Vim it's just a text editor. The term Vim stands for Vi
-IMproved, Vim it's a rewrite and improved version of Vi, a text editor
-that dates from 1978.
+The way we tell computers what to do is with text, so in order to
+write that text we need a set of basic tools, one of which is a text editor,
+and this is were Vim it's known for. Vim is just a text editor.
+The term Vim stands for Vi IMproved, Vim is a rewrite and improved version of Vi,
+a text editor that dates from 1978.
 
 In this article I want to show how this text editor became my best
-frient (?), I learned to love about Vim keybindings and now I even have
+frient (?), why I learned to love about Vim keybindings and now I even have
 and extension on my browser to use vim like keybindings.
 
 Vim is a console text editor (altough you can find distributions like
-gvim, which comes with a gui), a benefit of this its that It's very
-lightweign in terms of system resources. Vim it's also highly
+gvim, which comes with a gui), a benefit of this is that, It's very
+lightweign in terms of system resources. Vim is also highly
 configurable, you can do this by editing the *.vimrc* text
 file, which should be in you home directory in Linux or BSD bases OSs,
-if not you can *create* a new blank one and start from zero
+if not, you can *create* a new blank one and start from zero.
 
 If you installed Vim and you don't know how to move around or insert
 text, first you need to understand the basics, Vim has 3 main "modes"
 
-By default Vim comes with a lot of features disabled, for example a key
-binding to comment a line or auto close brackets, parenthesis, etc, this
+If you installed Vim and you don't know how to move around or insert
+text, I'm only going to tell two things, first, how to exit, press esc
+a couple of times and also Ctrl+C, just to make sure that you are on normal mode,
+then type \`:wq\` and press enter. I'm also going to tell you how to
+run vim tutor, which is a good tutorial included with vim which teaches you
+how to use vim in an interactive way.
+
+## Vim configuration
+
+## Vim plugins
+
+By default Vim comes with a lot of features missing, for example, a key
+binding to comment a line, or auto close brackets, parenthesis, etc, this
 features you can enable them by installing *plugins* which I
 will cover leter.