7c0h

Untitled Bash blog - source code is now online

As I mentioned before, I have now replaced my blogging engine with Pelican. Now that I'm mostly done dealing with ensuring that everything behaves more-or-less as before, it's time to talk about Bash.

I don't really remember why I wanted to write my blog using Bash. In general, I think it was a combination of the following factors:

  • I didn't want to install PHP. I have way too many memories of script-kiddies constantly probing my server, and that was never fun. Sure, I keep my server up-to-date, but why risking it? The less entry points for wannabe crackers, the better.
  • I didn't really thought it would be possible. Sure, writing it at first was kind of fun, but once I started writing triple-nested-quotes (all of which needed to be escaped properly) things got weird. I probably should have called it a day at that point, but I was close enough to my goal to make it worth it to continue till the end.
  • It was a good conversation starter - if you want to get a conversation rolling, bringing your terrible idea up is not the worst way to do it.

Of course, just because it was not the right tool for the job it doesn't mean that it was that bad. If anything, once I accepted that the heavy lifting should be made in a "proper" programming language (in this case, perl), using Bash to glue everything together worked surprisingly well.

With all of that in mind, I have now finally published the source code. I also plan on some light editing to make it friendlier, and an installation guide in case you really want to blog in a system where you have no permissions to install anything. The current template (just as my current blog) is based on Yahoo's Pure.css library library. In case you're not familiar with it, Pure.css is a set of CSS modules to make your project look good and responsive without a lot of effort, similarly to that other library whose name escapes me right now Bootstrap. I chose it specifically because I like to explore alternatives to the most popular projects, and Pure.css ended up being one of my favorites.

Music for programming

Like many programmers, I am a night owl. Also, as many other programmers, I have a day job that forces me to be there at 8. These two characteristics interact badly with each other.

For most programmers, this is the type of problem normally solved with coffee. But not being a coffee drinker in general (I think it's just okay) and with what I can only assume is a natural immunity to caffeine, my to-go alternative solution is music: a good pair of headphones and epic, upbeat music makes wonders for my concentration until lunch time, when all productivity dies.

2019 was a great year for me to both catch up with songs I didn't listen to in many years and to discover new ones. The following is a list of songs to which I return every week, divided into three sections: Full albums, Instrumental songs (no words), and Individual songs (with words).

Full albums

There are two full albums that I have often listened entirely during long coding sessions, and that I definitely recommend:

  • For no one's surprise, Daft Punk's soundtrack for TRON: Legacy makes the list. Too bad the rest of the movie was not as good.
  • I haven't seen The Exorcist yet, so I never considered this album "creepy", but if you have seen it then you might recognize the opening of Tubular Bells. I found that the song's rhytm perfectly syncs with my internal rhytm, and it is not unusual for me to realize that I need to take a break right as the album comes to an end.

Instrumental Songs

It has been common knowledge for some time now that movie music is ideal for focusing on a task - you don't want the music to pull you out of a movie, the same way I don't want my music to pull me out of my work. For this reason alone, the first three items in this list are pulled straight out of Hollywood blockbusters:

Moving onto TV, the next two songs are taken from the Japanese series "Kill la Kill": Naming Sense Gata Boshi Gokuseifuku, which I could swear I never heard in the series itself, and Nui Harime's theme.

Finally, and cheating a little bit, the theme from "The Good, the bad, and the ugly" as performed by the Danish National Symphony Orchestra is the one piece of music that got me to actually, physically buy music in many years.

Individual Songs

Individual songs are always tricky, because it takes a lot of listening to them before you learn to ignore the lyrics and let them blend in the background. That said, if you are looking for songs to listen over and over again, here's a bunch:

  • The least controversial song in this list are The greatest show on Earth and Ghost Love Score, both by Nightwish. They have long instrumental-only sections, and they are epic enough to give you an extra push while working.
  • Both Heldenzeit and Guten Tag by the German band "Wir sind Helden" are the perfect example of a great band that you discover long after they have disbanded. If you are a geek, the videoclip for Analogpunk (performed by the singer of "Wir sind Helden") is full of easter eggs.
  • The theme of "Revolutionary Girl Utena", Rinbu Revolution, is really good. There are not that many series where seeing the opening over and over is a plus, but Utena manages it.

Honorable mentions

I feel John Butler's "Ocean" deserves a spot in this list. It didn't make it into the official selection simply because I couldn't decide which version to include. I'm partial to the live version because it's the first one I heard, but the 2012 studio version is not bad at all.

Blog update!

It is tradition to start every new year with a blog post lamenting why I haven't posted more. Instead, I have decided to kickstart 2020 with a list of the changes I've made to the blog to ensure I write more, why I've made them, and what interesting tools I've found along the way.

A big problem in my blog has always been how difficult it is to actually get something published. As I've mentioned in the past, my blog is powered by a bunch of command-line tools and Bash. This works fine when I want to work from home, but makes it very difficult when I want to blog something spontaneously: writing a post involves SSHing into my server, and there's exactly one computer from which I can do that. Converting an entry to the final HTML is not hard, either, but is friction enough that I need to be really motivated to get into it.

Enter 2020. I am more and more concerned about the state of the modern web, where "the internet" has become a synonym for Facebook, Google, and not much more. At the same time, I realize that I'm part of the problem: I may not be putting content in Facebook, but I'm not really putting content anywhere. The little content I'm putting out is not particularly useful, either. Clearly, something had to change.

And thus, a plan for 2020 was born. In order to simplify blogging, I have now thrown away my custom blog engine and moved to Pelican. I've also embraced Markdown as document format, meaning I no longer have to worry about things looking ugly after I've written them down. All my previous content has been migrated from .html to .md using Pandoc.

On the content generation side, I've also decided to try something new. Rather than wait until inspiration strikes, I'll try to blog weekly about small problems and how I solved them. This will often involve talking about Bash and Python, so I'll have to pay special attention to other topics that could be interesting.

In the meantime, here are some changes you'll notice from the migration:

  • Some entries will look a bit different. My custom footnote CSS no longer works with Markdown, so I'll probably substitute them with regular, boring footnotes.
  • A couple entries with custom html will look weird for a while. It will take a bit to get them looking like before, and I'd rather avoid delaying the update until then.
  • The RSS feed will probably break a little bit. Seeing as the RSS will now be generated by Pelican, I imagine your RSS reader will panic a little bit.

Next in the pipeline: a showcase of my now-almost-defunct blog engine.

Bad App!

Random story from a random Android App: the "Photo Manager" app that I was using in my phone was updated a couple weeks ago. Opening my photos now requires the following steps:

  1. Tap the icon to open the app.
  2. Deny access to my location, because you don't need that to show me photos.
  3. Deny access to my calendar, because you don't need that either.
  4. Get sent back to the main screen, because the app will not run without this information.

This is a typical marketing tactic to try and sell my personal data for a higher price, but I was surprised at how brazen it was: most apps would still work, as selling me bad ads is better that selling none, but apparently the cost of me having their app installed is too high. Or maybe it was bad error handling. There's no way to know.

I was ready to uninstall it (which I did) and call it a day, but then I looked a bit deeper. It turns out that I was wrong, and the app is not developed by some obscure adware company in an effort to catch some low-hanging fruit. Instead, it was (probably) sold to a company first, which then repacked it with ads in an effort to catch some low-hanging fruit. Do you have an app you'd like to sell them? Here's a link. I'm willing to bet this specific app was sold around January 2019, as that would explain why they have gotten (almost) nothing but bad reviews for a year straight.

I don't really have a deeper point. I was just surprised at how quickly the app went to hell, and thought entrepreneurial people would appreciate it as a case study on what not to do.

What traveling every other week taught me

I travel a lot. In the last two years I've taken easily over 100 trains (with half of those trips lasting 7hs or more), 20 overnight buses (12hs in each direction), two intercontinental flights, and I even biked to work once.

I would have to be an idiot to travel this much without learning anything. And while the jury is still out on whether I'm an idiot, I did learn some tips and tricks that I'd like to share with you.

Mentality

Before you even leave your place, it is important to put yourself in the right state of mind. So close your eyes, breath deeply, and tell yourself:

"I don't know how, why, or when, but of this I am certain: someone is going to fuck it up. I have made my peace with this, and I will not let it ruin my day."

You would be surprised of how useful this mentality is. It will lower your blood pressure, make you less angry, and more importantly, will naturally lead you to "safer" choices: if you already assume your future plane will be delayed due to acts of nature, you won't book that risky 30-min airplane connection.

Bag

The secret to a good trip (or, at least, a less miserable one) is to be prepared, and your bag is where it's at. Unlike common wisdom, I'm going to suggest you get a small-ish one. How small? Enough to fit underneath the seat in front of you in a plane: boarding a plane is stressful enough without having to fight for overhead storage, and the last you want is traveling without your gear because the plane is full and your big bag was sent to cargo. And traveling light is always good.

A controversial opinion: check your allowed bag dimensions and weight, and stick to them. I know neither passengers nor airlines give a damn, but once in a blue moon an employee decides to check and it will probably happen in your trip (see previous section). I know of a bus company that makes a non-insignificant amount of extra money simply by enforcing their rules.

If you are traveling internationally and/or by plane, I recommend you also get a travel document holder like these ones. Keeping all of your documents in one place (plane tickets, ID, Passport, itinerary, emergency money, credit card, ...) will simplify your travel, and can be taken in and out of your bag in a second. I recommend one that fits A4 pages, since most tickets are printed nowadays at home.

Gear

If your have an overnight trip, then your list should start with...

  • Earplugs and sleep mask: they take almost no space, are very cheap, and are ridiculously helpful for overnight trips.
  • Water bottle: nothing fancy, just enough for when you wake up at night with a dry mouth thanks to the AC.
  • Good travel pillow: notice that I said a good pillow. Forget about that U-shaped garbage they sell in airports - if it doesn't close at the front, you'll wake up several times either when your head falls forward or when the pillow slides away. I got one from this list, and I'm quite happy with my choice.

For long trips in general, I also like to have a good set of headphones. Over-ear (and, even better, noise canceling) are my favorites because they block outside noise by default allowing me to use a lower volume setting, a small act for which my hearing will be thankful 20 years from now. They can be bulky, however, so I encourage you to shop around for the right model for you.

Seating

First-timers will always take the window seat. This is a perfectly reasonable choice: they want to enjoy the view. Veterans, on the other hand, know that the hallway seats are where it's at: windows lose their charm after about an hour, but standing up and walking whenever you want never gets old. And unless your plane/bus/train is full, other passangers would rather try other rows than voluntarily sitting between the wall and someone they don't know.

You should also seriously consider taking your shoes off. You can find some light slippers to bring along, but at this point a warning is mandatory: you must ensure (and I shouldn't even have to say it) that you are wearing clean socks and that your feet don't stink. Don't be that guy!

Finally, boredom is your enemy. Forget that difficult novel, your work notebook, and that expense report you've swearing you'll start once you have free time. Bring a book you like, that series you've been meaning to watch, or pretty much anything you already know you'll enjoy.