diff options
Diffstat (limited to 'gemfeed/2022-06-15-sweating-the-small-stuff.html')
| -rw-r--r-- | gemfeed/2022-06-15-sweating-the-small-stuff.html | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/gemfeed/2022-06-15-sweating-the-small-stuff.html b/gemfeed/2022-06-15-sweating-the-small-stuff.html index a0eed256..96bce73d 100644 --- a/gemfeed/2022-06-15-sweating-the-small-stuff.html +++ b/gemfeed/2022-06-15-sweating-the-small-stuff.html @@ -14,20 +14,20 @@ <br /> <pre> _ - /_/_ .'''. - =O(_)))) ...' `. - jgs \_\ `. .''' - `..' + /_/_ .'''. + =O(_)))) ...' `. + jgs \_\ `. .''' + `..' </pre> <br /> -<span>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's "Tiny programs" blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</span><br /> +<span>This blog post is a bit different from the others. It consists of multiple but smaller projects worth mentioning. I got inspired by Julia Evan's "Tiny programs" blog post and the side projects of The Sephist, so I thought I would also write a blog posts listing a couple of small projects of mine:</span><br /> <br /> <a class='textlink' href='https://jvns.ca/blog/2022/03/08/tiny-programs/'>Tiny programs</a><br /> -<a class='textlink' href='https://thesephist.com/projects/'>The Sephist's project list</a><br /> +<a class='textlink' href='https://thesephist.com/projects/'>The Sephist's project list</a><br /> <br /> -<span>Working on tiny projects is a lot of fun as you don't need to worry about any standards or code reviews and you decide how and when you work on it. There aren't restrictions regarding technologies used. You are likely the only person working on these tiny projects and that means that there is no conflict with any other developers. This is complete freedom :-).</span><br /> +<span>Working on tiny projects is a lot of fun as you don't need to worry about any standards or code reviews and you decide how and when you work on it. There aren't restrictions regarding technologies used. You are likely the only person working on these tiny projects and that means that there is no conflict with any other developers. This is complete freedom :-).</span><br /> <br /> -<span>But before going through the tiny projects let's take a paragraph for the <span class='inlinecode'>1y</span> anniversary retrospective.</span><br /> +<span>But before going through the tiny projects let's take a paragraph for the <span class='inlinecode'>1y</span> anniversary retrospective.</span><br /> <br /> <h2 style='display: inline'><span class='inlinecode'>1y</span> anniversary</h2><br /> <br /> @@ -36,7 +36,7 @@ <ul> <li>I practice English writing (I am not a native speaker). I am far from being a novelist, but this blog helps improves my writing skills. I also tried out tools like Grammarly.com and Languagetool.org and also worked with <span class='inlinecode'>:spell</span> in Vim or the LibreOffice checker. This post was checked with the <span class='inlinecode'>write-better</span> Node application. </li> <li>I force myself to "finish" some kind of project worth writing about every month. If its not a project, then its still a topic which requires research and deep thinking. Producing 2k words of text can actually be challenging.</li> -<li>It's fun to rely on KISS (keep it simple & stupid) tools. E.g. use of Gemtexter and not WordPress, use of Vim instead of an office suite or a rich web editor.</li> +<li>It's fun to rely on KISS (keep it simple & stupid) tools. E.g. use of Gemtexter and not WordPress, use of Vim instead of an office suite or a rich web editor.</li> </ul><br /> <span>Retrospectively, these have been the most popular blog posts of mine over the last year:</span><br /> <br /> @@ -46,7 +46,7 @@ <a class='textlink' href='./2021-12-26-how-to-stay-sane-as-a-devops-person.html'>How to stay sane as a DevOps person</a><br /> <a class='textlink' href='./2022-05-27-perl-is-still-a-great-choice.html'>Perl is still a great choice</a><br /> <br /> -<span>But now, let's continue with the small projects worth mentioning :-)</span><br /> +<span>But now, let's continue with the small projects worth mentioning :-)</span><br /> <br /> <h2 style='display: inline'>Static photo album generator</h2><br /> <br /> @@ -62,15 +62,15 @@ <br /> <span>More than 10 years ago I wrote the bespoke small static photo album generator in Bash <span class='inlinecode'>photoalbum.sh</span> which I recently refactored to a modern Bash coding style and also freshened up the Cascading Style Sheets. Last but not least, the new domain name <span class='inlinecode'>irregular.ninja</span> has been registered.</span><br /> <br /> -<span>The thumbnails are presented in a random order and there are also random CSS effects for each preview. There's also a simple background blur for each page generated. And that's all in less than 300 lines of Bash code! The script requires ImageMagick (available for all common Linux and *BSD distributions) to be installed.</span><br /> +<span>The thumbnails are presented in a random order and there are also random CSS effects for each preview. There's also a simple background blur for each page generated. And that's all in less than 300 lines of Bash code! The script requires ImageMagick (available for all common Linux and *BSD distributions) to be installed.</span><br /> <br /> <span>As you can see, there is a lot of randomization and irregularity going on. Thus, the name "Irregular Ninja" was born.</span><br /> <br /> <a class='textlink' href='https://irregular.ninja'>https://irregular.ninja</a><br /> <br /> -<span>I only use a digital compact camera or a smartphone to take the photos. I don't like the idea of carrying around a big camera with me "just in case" so I keep it small and simple. The best camera is the camera you have with you. :-)</span><br /> +<span>I only use a digital compact camera or a smartphone to take the photos. I don't like the idea of carrying around a big camera with me "just in case" so I keep it small and simple. The best camera is the camera you have with you. :-)</span><br /> <br /> -<span>I hope you like this photo site. It's worth checking it out again around once every other month!</span><br /> +<span>I hope you like this photo site. It's worth checking it out again around once every other month!</span><br /> <br /> <h2 style='display: inline'>Random journal page extractor</h2><br /> <br /> @@ -80,11 +80,11 @@ <br /> <a class='textlink' href='https://codeberg.org/snonux/randomjournalpage'>https://codeberg.org/snonux/randomjournalpage</a><br /> <br /> -<span>There's also a weekly <span class='inlinecode'>CRON</span> job on my servers to send me a reminder that I might want to read in my old journals again. My laptop also runs this script each time it boots and saves the output to a NextCloud folder. From there, it's synchronized to the NextCloud server so I can pick it up from there with my smartphone later when I am "on the road".</span><br /> +<span>There's also a weekly <span class='inlinecode'>CRON</span> job on my servers to send me a reminder that I might want to read in my old journals again. My laptop also runs this script each time it boots and saves the output to a NextCloud folder. From there, it's synchronized to the NextCloud server so I can pick it up from there with my smartphone later when I am "on the road".</span><br /> <br /> <h2 style='display: inline'>Global uptime records statistic generator</h2><br /> <br /> -<span><span class='inlinecode'>guprecords</span> is a Perl script which reads multiple <span class='inlinecode'>uprecord</span> files (produced by <span class='inlinecode'>uptimed</span> - a widely available daemon for recording server uptimes) and generates uptime statistics of multiple hosts combined. I keep all the record files of all my personal computers in a Git repository (I even keep the records of the boxes I don't own or use anymore) and there's already quite a collection of it. It looks like this:</span><br /> +<span><span class='inlinecode'>guprecords</span> is a Perl script which reads multiple <span class='inlinecode'>uprecord</span> files (produced by <span class='inlinecode'>uptimed</span> - a widely available daemon for recording server uptimes) and generates uptime statistics of multiple hosts combined. I keep all the record files of all my personal computers in a Git repository (I even keep the records of the boxes I don't own or use anymore) and there's already quite a collection of it. It looks like this:</span><br /> <br /> <pre> ❯ perl ~/git/guprecords/src/guprecords --indir=./stats/ --count=20 --all @@ -144,32 +144,32 @@ Pos | System | Kernel | Uptime | <br /> <h2 style='display: inline'>Server configuration management</h2><br /> <br /> -<span>The <span class='inlinecode'>rexfiles</span> project contains all Rex files for my (personal) server setup automation. A <span class='inlinecode'>Rexfile</span> is written in a Perl DSL run by the Rex configuration management system. It's pretty much KISS and that's why I love it. It suits my personal needs perfectly. </span><br /> +<span>The <span class='inlinecode'>rexfiles</span> project contains all Rex files for my (personal) server setup automation. A <span class='inlinecode'>Rexfile</span> is written in a Perl DSL run by the Rex configuration management system. It's pretty much KISS and that's why I love it. It suits my personal needs perfectly. </span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/rexfiles'>https://codeberg.org/snonux/rexfiles</a><br /> <a class='textlink' href='https://www.rexify.org'>https://www.rexify.org</a><br /> <br /> <span>This is an E-Mail I posted to the Rex mailing list:</span><br /> <br /> -<span class='quote'>Hi there! I was searching for a simple way to automate my personal OpenBSD setup. I found that configuration management systems like Puppet, Salt, Chef, etc.. were too bloated for my personal needs. So for a while I was configuring everything by hand. At one point I got fed up and started writing Shell scripts. But that was not the holy grail so that I looked at Ansible. I found that Ansible had some dependencies on Python on the target machine when you want to use all the features. Furthermore, I am not really familiar with Python. But then I remembered that there was also Rex. It's written in my beloved Perl. Also, OpenBSD comes with Perl in the base system out of the box which makes it integrate better than all my scripts (automation and also scripts deployed via the automation to the system) are all in the same language. Rex may not have all the features like other configuration management systems, but its easy to work-around or extend when you know Perl. Thanks!</span><br /> +<span class='quote'>Hi there! I was searching for a simple way to automate my personal OpenBSD setup. I found that configuration management systems like Puppet, Salt, Chef, etc.. were too bloated for my personal needs. So for a while I was configuring everything by hand. At one point I got fed up and started writing Shell scripts. But that was not the holy grail so that I looked at Ansible. I found that Ansible had some dependencies on Python on the target machine when you want to use all the features. Furthermore, I am not really familiar with Python. But then I remembered that there was also Rex. It's written in my beloved Perl. Also, OpenBSD comes with Perl in the base system out of the box which makes it integrate better than all my scripts (automation and also scripts deployed via the automation to the system) are all in the same language. Rex may not have all the features like other configuration management systems, but its easy to work-around or extend when you know Perl. Thanks!</span><br /> <br /> <h2 style='display: inline'>Fancy SSH execution loop</h2><br /> <br /> -<span><span class='inlinecode'>rubyfy</span> is a fancy SSH loop wrapper written in Ruby for running shell commands on multiple remote servers at once. I also forked this project for work (under a different name) where I added even more features such as automatic server discovery. It's used by many colleagues on a frequent basis. Here are some examples:</span><br /> +<span><span class='inlinecode'>rubyfy</span> is a fancy SSH loop wrapper written in Ruby for running shell commands on multiple remote servers at once. I also forked this project for work (under a different name) where I added even more features such as automatic server discovery. It's used by many colleagues on a frequent basis. Here are some examples:</span><br /> <br /> <pre> -# Run command 'hostname' on server foo.example.com -./rubyfy.rb -c 'hostname' <<< foo.example.com +# Run command 'hostname' on server foo.example.com +./rubyfy.rb -c 'hostname' <<< foo.example.com -# Run command 'id' as root (via sudo) on all servers listed in the list file +# Run command 'id' as root (via sudo) on all servers listed in the list file # Do it on 10 servers in parallel -./rubyfy.rb --parallel 10 --root --command 'id' < serverlist.txt +./rubyfy.rb --parallel 10 --root --command 'id' < serverlist.txt # Run a fancy script in background on 50 servers in parallel -./rubyfy.rb -p 50 -r -b -c '/usr/local/scripts/fancy.zsh' < serverlist.txt +./rubyfy.rb -p 50 -r -b -c '/usr/local/scripts/fancy.zsh' < serverlist.txt # Grep for specific process on both servers and write output to ./out/grep.txt -echo {foo,bar}.example.com | ./rubyfy.rb -p 10 -c 'pgrep -lf httpd' -n grep.txt +echo {foo,bar}.example.com | ./rubyfy.rb -p 10 -c 'pgrep -lf httpd' -n grep.txt # Reboot server only if file /var/run/maintenance.lock does NOT exist! echo foo.example.com | @@ -232,7 +232,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <h2 style='display: inline'>Delay sending out E-Mails with Mutt</h2><br /> <br /> -<span>This is a shell script for the Mutt email client for delaying sending out E-Mails. For example, you want to write an email on Saturday but don't want to bother the recipient earlier than Monday. It relies on CRON.</span><br /> +<span>This is a shell script for the Mutt email client for delaying sending out E-Mails. For example, you want to write an email on Saturday but don't want to bother the recipient earlier than Monday. It relies on CRON.</span><br /> <br /> <a class='textlink' href='https://codeberg.org/snonux/muttdelay'>https://codeberg.org/snonux/muttdelay</a><br /> <br /> @@ -249,7 +249,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <span><span class='inlinecode'>ipv6test</span> is a quick and dirty Perl CGI script for testing whether your browser connects via IPv4 or IPv6. It requires you to setup three sub-domains: One reachable only via IPv4 (e.g. <span class='inlinecode'>test4.ipv6.buetow.org</span>), another reachable only via IPv6 (e.g. <span class='inlinecode'>test6.ipv6.buetow.org</span>) and the main one reachable through both protocols (e.g. <span class='inlinecode'>ipv6.buetow.org</span>).</span><br /> <br /> -<span>I don't have it running on any of my servers at the moment. This means that there is no demo to show now. Sorry!</span><br /> +<span>I don't have it running on any of my servers at the moment. This means that there is no demo to show now. Sorry!</span><br /> <br /> <h2 style='display: inline'>List open Jira tickets in the terminal</h2><br /> <br /> @@ -275,15 +275,15 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <h2 style='display: inline'>More</h2><br /> <br /> -<span>There are more projects on my Codeberg page but they aren't as tiny as the ones mentioned in this post or aren't finished yet so I won't bother listing them here. However, there also a few more scripts used frequently by me (not publicly accessible (yet?)) which I would like to mention here:</span><br /> +<span>There are more projects on my Codeberg page but they aren't as tiny as the ones mentioned in this post or aren't finished yet so I won't bother listing them here. However, there also a few more scripts used frequently by me (not publicly accessible (yet?)) which I would like to mention here:</span><br /> <br /> <h3 style='display: inline'>Work time tracker</h3><br /> <br /> -<span><span class='inlinecode'>worktime.rb</span>, for example, is a command line Ruby script I use to track my time spent working. This is to make sure that I don't overwork (in particular useful when working from home). It also generates some daily and weekly stats and carries over work time (surpluses or minuses) to the next work day, week or even year.</span><br /> +<span><span class='inlinecode'>worktime.rb</span>, for example, is a command line Ruby script I use to track my time spent working. This is to make sure that I don't overwork (in particular useful when working from home). It also generates some daily and weekly stats and carries over work time (surpluses or minuses) to the next work day, week or even year.</span><br /> <br /> <span>It has some special features such as tracking time for self-improvement/development, days off and time spent at the lunch break and time spent on Pet Projects.</span><br /> <br /> -<span>An example weekly report looks like this (I often don't track my lunch time but what I do instead I stop the work timer when I go out for lunch and start the work timer once back at the desk):</span><br /> +<span>An example weekly report looks like this (I often don't track my lunch time but what I do instead I stop the work timer when I go out for lunch and start the work timer once back at the desk):</span><br /> <br /> <pre> Mon 20211213 50: work:5.92h @@ -301,19 +301,19 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs <br /> <h3 style='display: inline'>Password and document store</h3><br /> <br /> -<span><span class='inlinecode'>geheim.rb</span> is my personal password and document store ("geheim" is the German word for secret). It's written in Ruby and heavily relies on Git, FZF (for search), Vim and standard encryption algorithms. Other than the standard <span class='inlinecode'>pass</span> Unix password manager, <span class='inlinecode'>geheim</span> also encrypts the file names and password titles.</span><br /> +<span><span class='inlinecode'>geheim.rb</span> is my personal password and document store ("geheim" is the German word for secret). It's written in Ruby and heavily relies on Git, FZF (for search), Vim and standard encryption algorithms. Other than the standard <span class='inlinecode'>pass</span> Unix password manager, <span class='inlinecode'>geheim</span> also encrypts the file names and password titles.</span><br /> <br /> <span>The tool is command line driven but also provides an interactive shell when invoked with <span class='inlinecode'>geheim shell</span>. It also works on my Android phone via Termux so I have all my documents and passwords always with me. </span><br /> <br /> <h3 style='display: inline'>Backup procedure</h3><br /> <br /> -<span><span class='inlinecode'>backup</span> is a Bash script which does run once daily (or every time on boot) on my home FreeBSD NAS server and performs backup related tasks such as creating a local backup of my remote NextCloud instance, creating encrypted (incremental) ZFS snapshots of everything what's stored on the NAS and synchronizes (via <span class='inlinecode'>rsync</span>) backups to a remote cloud storage. It also can synchronize backups to a local external USB drive.</span><br /> +<span><span class='inlinecode'>backup</span> is a Bash script which does run once daily (or every time on boot) on my home FreeBSD NAS server and performs backup related tasks such as creating a local backup of my remote NextCloud instance, creating encrypted (incremental) ZFS snapshots of everything what's stored on the NAS and synchronizes (via <span class='inlinecode'>rsync</span>) backups to a remote cloud storage. It also can synchronize backups to a local external USB drive.</span><br /> <br /> <a class='textlink' href='./2016-04-03-offsite-backup-with-zfs.html'>Check out my offsite backup series</a><br /> <br /> <h2 style='display: inline'>konpeito.media</h2><br /> <br /> -<span>Here's a bonus...</span><br /> +<span>Here's a bonus...</span><br /> <br /> <pre> ▄ █ ▄ ▄ █ ▄ ▄ █ ▄ @@ -326,7 +326,7 @@ v = 008 [v = p*c*(s != c ? 2 : 1)] Total logical CPUs ▀▄█▄█▄▄▄▄▄▄▄█▄█▄▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀ ▀▀▀▀ ▀ ▀ ▀▀▀ </pre> <br /> -<span>*THIS ISN'T MY PROJECT* but I found KONPEITO an interesting Gemini capsule. It's a quarterly released Low-Fi music mix tape distributed only through Gemini (and not the web). </span><br /> +<span>*THIS ISN'T MY PROJECT* but I found KONPEITO an interesting Gemini capsule. It's a quarterly released Low-Fi music mix tape distributed only through Gemini (and not the web). </span><br /> <br /> <a class='textlink' href='gemini://konpeito.media'>gemini://konpeito.media</a><br /> <br /> |
