<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rasmus Larsson</title><link>https://rasmuslarsson.se/</link><description>Recent content on Rasmus Larsson</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 17 Mar 2024 10:00:00 +0200</lastBuildDate><atom:link href="https://rasmuslarsson.se/index.xml" rel="self" type="application/rss+xml"/><item><title>Homelab Part 3: Domains</title><link>https://rasmuslarsson.se/post/homelab-3-proxy/</link><pubDate>Sun, 17 Mar 2024 10:00:00 +0200</pubDate><guid>https://rasmuslarsson.se/post/homelab-3-proxy/</guid><description>&lt;p&gt;The next part in setting things up is getting domains sorted. Since I have everything on the same IP address I created a wildcard subdomain pointing to my homelab. This way I can add any names without having to update the nameserver all the time.&lt;/p&gt;
&lt;h2 id="caddy"&gt;Caddy&lt;/h2&gt;
&lt;p&gt;Normally I would use nginx as a reverse proxy but Caddy has been up and coming and I was a bit excited to see how it would work. Getting it set up was incredibly simple.&lt;/p&gt;</description></item><item><title>Homelab Part 2: Authentication with LDAP and OAuth</title><link>https://rasmuslarsson.se/post/homelab-2-auth/</link><pubDate>Sun, 10 Mar 2024 10:00:00 +0200</pubDate><guid>https://rasmuslarsson.se/post/homelab-2-auth/</guid><description>&lt;p&gt;An annoying part about hosting services myself is managing passwords and logins for everything. Every service is a new user account with a separate password for security. Giving someone else access to a couple of services means setting up the same amount of user accounts for that person.&lt;/p&gt;
&lt;p&gt;The simple solution to this is centralized authentication. This is commonly solved with LDAP (Lightweight Directory Access Protocol) or with OAuth depending on the methods of authentication. There is also OpenID Connect (OIDC) which is an additional layer on top of OAuth which allows services to create users and access rights on the fly.&lt;/p&gt;</description></item><item><title>Homelab Part 1: Database Backend</title><link>https://rasmuslarsson.se/post/homelab-1-postgresql/</link><pubDate>Sun, 03 Mar 2024 10:00:00 +0200</pubDate><guid>https://rasmuslarsson.se/post/homelab-1-postgresql/</guid><description>&lt;p&gt;Before I can set up any services I will need to have some method of authentication and for that I need somewhere to store user information. This could technically be a simple SQLite database but since PostgreSQL is useful for other things I might as well start here.&lt;/p&gt;
&lt;h2 id="preparing-postgresql"&gt;Preparing PostgreSQL&lt;/h2&gt;
&lt;p&gt;What is really nice about adding a stack in Portainer is how it is just a docker-compose file that can be copy-pasted directly into the interface. This also makes it easy to keep related services up to date in the same file.&lt;/p&gt;</description></item><item><title>Homelab Part 0: Docker on Raspberry Pi</title><link>https://rasmuslarsson.se/post/homelab-0-docker/</link><pubDate>Sun, 25 Feb 2024 22:11:46 +0200</pubDate><guid>https://rasmuslarsson.se/post/homelab-0-docker/</guid><description>&lt;p&gt;This weekend I set up a new homelab. Basically a way for me to &lt;a href="https://github.com/awesome-selfhosted/awesome-selfhosted"&gt;self-host&lt;/a&gt; some services that I use while running my own personal tech playground.&lt;/p&gt;
&lt;p&gt;I already have this setup with a Raspberry Pi 3 where I have a few things set up in an old school fashion of running services like daemons and running everything behind an Apache2 server. There are some benefits to this in that the setup is pretty straightforward and simple to understand without layers and abstractions but the downside is the maintenance. Upgrading services is a chore and a very manual process.&lt;/p&gt;</description></item><item><title>Bitsy, a tiny game engine</title><link>https://rasmuslarsson.se/post/bitsy/</link><pubDate>Sun, 07 Jan 2024 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/bitsy/</guid><description>&lt;p&gt;This weekend I have played around a bit with &lt;a href="https://bitsy.org/"&gt;Bitsy&lt;/a&gt;, a
small and simple game engine. The editor is easy to grasp and though the
limited scope of the engine itself might seem limiting there are some very
interesting examples of games made with this.&lt;/p&gt;
&lt;p&gt;Personally I did not have as much patience or sense of narrative to create
something as engaging as some other things out there. But I did make a small
thing just for fun where you are &lt;a href="https://rasmuslarsson.se/stuck_in_a_room_with_a_cat.html"&gt;stuck in a room with a cat&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Implicit frameworks</title><link>https://rasmuslarsson.se/post/implicit-frameworks/</link><pubDate>Thu, 17 Nov 2022 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/implicit-frameworks/</guid><description>&lt;p&gt;These are some thoughts based on &lt;a href="https://berk.es/2022/09/06/frameworks-harm-maintenance/"&gt;&amp;ldquo;Using a Framework will harm the maintenance of your software&amp;rdquo;&lt;/a&gt; and the discussions from the related &lt;a href="https://news.ycombinator.com/item?id=33185010"&gt;Hacker News thread&lt;/a&gt;. One of the &lt;a href="https://news.ycombinator.com/item?id=33185383"&gt;top responses&lt;/a&gt; included the following quote which summarizes an important point neatly.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Every sufficiently complex framework-free application contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of a framework.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;That even when a framework has been explicitly avoided, or a minimalistic framework used, an implicit framework will eventually develop based on the culture around the codebase. There is a &amp;ldquo;way of doing things&amp;rdquo; that emerge in any company culture which becomes the framework. This might not be a heavy ORM, forced MVC structure, OOP principles or some other scary three letter acronym. But instead of over-generalized solutions of &amp;ldquo;one size fits all&amp;rdquo; it will be a series of undocumented and glued together ad-hoc solutions created to solve one specific problem at a time.&lt;/p&gt;</description></item><item><title>Unicode BOM and Excel</title><link>https://rasmuslarsson.se/post/bom/</link><pubDate>Sun, 30 Oct 2022 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/bom/</guid><description>&lt;p&gt;If you have tried generating CSV files that include non-ascii characters you will have noticed that these show up as weird and double letters such as Ã¥ Ã¤, and Ã¶ for the Swedish letters Å, Ä, and Ö respectively.&lt;/p&gt;
&lt;p&gt;When this happens in web pages there is a mismatch between the declared and actual encoding of the page. This could for example happen if you create a page encoded in Unicode but not sent as such. The above example would have been easily solved by including a simple &lt;code&gt;Content-Type: text/html; charset=utf-8&lt;/code&gt; header in the response to instruct the browser how to interpret the file if that was the case.&lt;/p&gt;</description></item><item><title>If you are using "and" you are writing bad code</title><link>https://rasmuslarsson.se/post/and-bad-code/</link><pubDate>Sun, 15 Aug 2021 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/and-bad-code/</guid><description>&lt;p&gt;Mostly everyone would agree that blindly writing SOLID code just for the sake of it does more harm than good. Just look at any example of the &amp;ldquo;enterprise editions&amp;rdquo; for &lt;a href="https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition"&gt;FizzBuzz&lt;/a&gt; or &lt;a href="https://gist.github.com/lolzballs/2152bc0f31ee0286b722"&gt;Hello World&lt;/a&gt;. This is not to say that SOLID, KISS, DRY and so on are not useful guidelines for improving code quality and general practice. The practice that best aligns with the project goals is pretty much always the best option.&lt;/p&gt;</description></item><item><title>Solving the median of two sorted arrays in O (n log (m + n))</title><link>https://rasmuslarsson.se/post/median-of-two-sorted-arrays/</link><pubDate>Sun, 01 Aug 2021 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/median-of-two-sorted-arrays/</guid><description>&lt;p&gt;I have been doing a bit of HackerRank and LeetCode challenges to practice and avoid skill rot since I do not do as much low level programming as I used to. While going over the discussions for one of these challenges [1] I noticed a lot of people bragging about their simple solutions while also missing the entire point of the excercise.&lt;/p&gt;
&lt;p&gt;The problem is described like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.&lt;/p&gt;</description></item><item><title>Work faster with a simple to-do process</title><link>https://rasmuslarsson.se/post/simple-todo/</link><pubDate>Sun, 02 May 2021 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/simple-todo/</guid><description>&lt;h2 id="how-i-manage-my-work-to-not-lose-focus-and-stay-on-track"&gt;How I manage my work to not lose focus and stay on track.&lt;/h2&gt;
&lt;p&gt;Wether I am working on a large project or am just starting out on something small and new I eventually end up with too many ideas for new features or improvements. Like pulling on a thread a small bug reveals something else that needs fixing or while implementing a new feature there is something else that would be really cool.&lt;/p&gt;</description></item><item><title>Creating a new user on MySQL</title><link>https://rasmuslarsson.se/post/sql-create-and-grant/</link><pubDate>Mon, 20 Apr 2020 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/sql-create-and-grant/</guid><description>&lt;p&gt;Creating a new user should be a lot simpler than it is. I always forget one or two things and need to look up the exact syntax whenever I need this to make sure that everything is included properly.&lt;/p&gt;
&lt;p&gt;This is the full command used to create a new superuser in one line with full access to all tables and ability to create new users as well. The following command essentially creates a new root user that is allowed to connect from any host so use this with caution.&lt;/p&gt;</description></item><item><title>How to rely on third-party CDNs in a secure way</title><link>https://rasmuslarsson.se/post/securely-using-cdns/</link><pubDate>Sun, 27 Oct 2019 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/securely-using-cdns/</guid><description>&lt;p&gt;Instead of using dependency managers and packaging tools like Webpack or Bower (or even NPM) for web resources it is tempting to instead just link directly to the resources you need.&lt;/p&gt;
&lt;p&gt;But except for avoiding complexity and having to learn something new like dependency management or semantical versioning schemes this also opens up some attack vectors.&lt;/p&gt;
&lt;p&gt;For example, if the third-party you are loading your resources from is compromised an attacker might replace your Bootstrap plugin with a key listener to steal your users passwords. If the domain name is hi-jacked the JavaScript library you depend on can suddenly be used to mine Bitcoin using your visitors computers.&lt;/p&gt;</description></item><item><title>Consolidating images with perceptual hashing</title><link>https://rasmuslarsson.se/post/perceptual-hash/</link><pubDate>Tue, 05 Feb 2019 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/perceptual-hash/</guid><description>&lt;p&gt;I have a lot of photos spread out over multiple devices and platforms from over the years. These are pictures from Facebook, old camera photos, Google Photos and so on. And most of these are duplicates, copied from one device to several different platforms and backups, all with very subtle differences depending on what platform they have been processed by.&lt;/p&gt;
&lt;p&gt;Most of these have some matter of export functions for photos. But it is still a manual and tedious process to sort and combine them to a single set of photos that includes everything but also does so without duplicates.&lt;/p&gt;</description></item><item><title>Resolutions for 2019</title><link>https://rasmuslarsson.se/post/2019-aspirations/</link><pubDate>Tue, 01 Jan 2019 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/2019-aspirations/</guid><description>&lt;p&gt;A couple of years ago I wrote a post with a short summary of my resolutions for the upcoming year. Things that I wanted to achieve or improve. I never followed up on it or even considered how it went or if anything should change for the next year. In terms of goal planning it was a catastrophic failure.&lt;/p&gt;
&lt;p&gt;What I should have done was to (1) made sure that my resolutions were measurable and (2) actually followed up on the progress of my goals to make sure I was on track. I did neither of these.&lt;/p&gt;</description></item><item><title>My blog setup</title><link>https://rasmuslarsson.se/post/hugo/</link><pubDate>Mon, 01 May 2017 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/hugo/</guid><description>&lt;p&gt;I am trying to get back into blogging. Mostly as a way of documenting my
side-projects which I am otherwise awful at. Previously this has been a writing
exercise for me (and still is) but I hope to switch focus to more code and small
projects.&lt;/p&gt;
&lt;p&gt;The blog is powered by Hugo, a static site generator which basically converts
text files to this site. Those text files could be hosted on GitHub as it
was before were it was set up according to the official Hugo guide. That setup
used a continuous deployment tool (Wercker) to automatically regenerate and
re-upload my site whenever there was a content change.&lt;/p&gt;</description></item><item><title>An efficient work environment in Gnome Shell</title><link>https://rasmuslarsson.se/post/gnome-shell/</link><pubDate>Sun, 26 Feb 2017 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/gnome-shell/</guid><description>&lt;p&gt;At work or at home I mainly use a Ubuntu + Gnome Shell setup for getting work done. While Gnome Shell has its limitations it can be dramatically improved with the right extensions. At least for now I don&amp;rsquo;t know any better option.&lt;/p&gt;
&lt;p&gt;With my current setup I have support for multiple desktops which is useful for switching contexts between e.g. communication and development. The multiple desktops are also a benefit for laptop work as I am otherwise limited to a single screen for workspace.&lt;/p&gt;</description></item><item><title>On password security</title><link>https://rasmuslarsson.se/post/password-security/</link><pubDate>Sat, 30 Jan 2016 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/password-security/</guid><description>&lt;p&gt;&lt;img src="https://rasmuslarsson.se/media/lastpass.png" alt="LastPass"&gt;&lt;/p&gt;
&lt;p&gt;Passwords are probably the biggest security risk that users face today. Most assume that a secure password is &lt;em&gt;at least 8 characters long, contain upper case and lower case letters as well as at least one digit&lt;/em&gt;. Problem is that this leads to passwords like &lt;em&gt;Password1&lt;/em&gt;. But the &lt;em&gt;real&lt;/em&gt; problem is that users believe that this password is so secure, since it technically follows the requirements for a &amp;ldquo;secure&amp;rdquo; password, that it can safely be used everywhere.&lt;/p&gt;</description></item><item><title>Authenticating ejabberd users with Symfony2 and FOSUserBundle</title><link>https://rasmuslarsson.se/post/symfony2-jabber-authentication/</link><pubDate>Sun, 17 Jan 2016 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/symfony2-jabber-authentication/</guid><description>&lt;p&gt;I&amp;rsquo;ve been trying to set up an XMPP server since MSN went out of style (i.e. since forever). However, managing users is a bit of a hassle and normally the two alternatives are to either create users manually or allow them to register through the client. The first is tedious and the second is not very user-friendly.&lt;/p&gt;
&lt;p&gt;But with ejabberd there&amp;rsquo;s also support for MySQL databases. Which means that I can write a simple registration service where users can manage their accounts themselves. All it takes is updating their information in the database. The downside is that ejabberd only supports plaintext password storage on external database connections which is insanely unsafe for numerous reasons.&lt;/p&gt;</description></item><item><title>Resolutions for 2016</title><link>https://rasmuslarsson.se/post/2016-resolutions/</link><pubDate>Fri, 01 Jan 2016 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/2016-resolutions/</guid><description>&lt;p&gt;Inspired by &lt;a href="http://matt.might.net/articles/programmers-resolutions/"&gt;&amp;ldquo;12 resolutions for programmers&amp;rdquo;&lt;/a&gt; I decided to write a post on my own aspirations this year. I may or may not expand on this over the upcoming months. We&amp;rsquo;ll see.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Eat healthier&lt;/li&gt;
&lt;li&gt;Play more games&lt;/li&gt;
&lt;li&gt;Learn a new language&lt;/li&gt;
&lt;li&gt;Read more books&lt;/li&gt;
&lt;li&gt;Start using a password manager&lt;/li&gt;
&lt;li&gt;Create something in an unfamiliar language (Clojure or Go maybe?)&lt;/li&gt;
&lt;li&gt;Get better at math&lt;/li&gt;
&lt;li&gt;Attend more &lt;a href="http://www.foocafe.org/"&gt;lectures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Try Dvorak&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Advent of Code</title><link>https://rasmuslarsson.se/post/advent-of-code/</link><pubDate>Wed, 02 Dec 2015 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/advent-of-code/</guid><description>&lt;p&gt;&lt;a href="http://was.tl/"&gt;Eric Wastl&lt;/a&gt; put together a programming challenge advent calendar. There&amp;rsquo;s a new holiday themed coding challenge every day up until Christmas. So far they only take a couple of minutes to solve which is perfect for some daily exercise.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://rasmuslarsson.se/media/advent-of-code.png" alt="Advent of Code"&gt;&lt;/p&gt;
&lt;p&gt;Link for the curious: &lt;a href="http://adventofcode.com/"&gt;http://adventofcode.com/&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Hello world revisited</title><link>https://rasmuslarsson.se/post/hello-world-revisited/</link><pubDate>Sun, 26 Jul 2015 10:11:46 +0200</pubDate><guid>https://rasmuslarsson.se/post/hello-world-revisited/</guid><description>&lt;p&gt;So I finally made the jump to a static blog.&lt;/p&gt;
&lt;p&gt;I have been contemplating this move for quite some time now. Mostly it&amp;rsquo;s been a
consideration between &lt;a href="http://blog.getpelican.com/"&gt;Pelican&lt;/a&gt; (Python) and
&lt;a href="http://jekyllrb.com/"&gt;Jekyll&lt;/a&gt; (Ruby). Where Jekyll has been more tempting with
the huge ecosystem around &lt;a href="http://octopress.org/"&gt;Octopress&lt;/a&gt; to benefit from.&lt;/p&gt;
&lt;p&gt;The downside with Jekyll, and Octopress especially, is that I have to keep an
entire framework of blog generating software around. This was a lesser problem
with Pelican which was smaller, but still a limitation.&lt;/p&gt;</description></item><item><title>Projects</title><link>https://rasmuslarsson.se/page/projects/</link><pubDate>Sat, 25 Jul 2015 05:16:01 +0200</pubDate><guid>https://rasmuslarsson.se/page/projects/</guid><description>&lt;p&gt;Some of my projects and where to find them. Maybe images?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://rasmuslarsson.se/media/destruktiv.png" alt="Destruktiv"&gt;&lt;/p&gt;</description></item><item><title>Reading List</title><link>https://rasmuslarsson.se/page/reading-list/</link><pubDate>Sat, 25 Jul 2015 05:16:01 +0200</pubDate><guid>https://rasmuslarsson.se/page/reading-list/</guid><description>&lt;p&gt;This is a list of things I think everyone interested in programming or just
software craftmanship in general should read. It&amp;rsquo;s a work in progress which
I will be improving on whenever I got the time.&lt;/p&gt;
&lt;p&gt;Inspired by Jeff Atwoods &amp;ldquo;&lt;a href="http://blog.codinghorror.com/recommended-reading-for-developers/"&gt;Recommended Reading for Developers&lt;/a&gt;&amp;rdquo;. (His list is
way better than mine by the way, so check it out.)&lt;/p&gt;
&lt;p&gt;In no particular order.&lt;/p&gt;
&lt;h2 id="books"&gt;Books&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;The Pragmatic Programmer: From Journeyman to Master&lt;/strong&gt;&lt;br&gt;
by Andrew Hunt and David Thomas (&lt;a href="http://www.amazon.com/gp/product/020161622X/ref=as_li_qf_sp_asin_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=9325&amp;amp;creativeASIN=020161622X&amp;amp;linkCode=as2&amp;amp;tag=rasmlars-20"&gt;Amazon&lt;/a&gt;)&lt;/p&gt;</description></item><item><title>How to license your software properly</title><link>https://rasmuslarsson.se/post/licenses/</link><pubDate>Tue, 09 Jun 2015 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/licenses/</guid><description>&lt;p&gt;&lt;em&gt;(Disclaimer: I am not a lawyer, everything in this post is probably wrong)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Too many times I&amp;rsquo;ve stumbled across a really useful library or framework that is ridiculously prohibitively licensed. The thing is that most people are simply oblivious to what the license entails and just slap on a GPLv3 (because everyone is using GPLv2, and of course you want the latest version.. right?).&lt;/p&gt;
&lt;p&gt;The problem with GPL is that it includes a copyleft. This means that any distributed work that uses &lt;em&gt;anything&lt;/em&gt; licensed under GPL is required to be released under a GPL license as well. The reason for this is to force organizations that are developing proprietary software to release their improvements back into the wild.&lt;/p&gt;</description></item><item><title>What deployment tools can do for you</title><link>https://rasmuslarsson.se/post/deployment-tools/</link><pubDate>Wed, 21 Jan 2015 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/deployment-tools/</guid><description>&lt;p&gt;I restarted work on one of my older hobby projects. Though I&amp;rsquo;m not really sure what my end goal is yet I got a vague idea of what I want to build and it&amp;rsquo;s nice to have something of my own to code on.&lt;/p&gt;
&lt;p&gt;While setting this project up I took some extra time to make sure I got deployments automated from the start. Proper configuration and use of tools saves &lt;strong&gt;a lot&lt;/strong&gt; of time but it also takes several hours to a day or two to set up, depending on the project of course.&lt;/p&gt;</description></item><item><title>How I set up Pelican for blogging pt. 2</title><link>https://rasmuslarsson.se/post/pelican-blogging-pt-2/</link><pubDate>Sun, 21 Sep 2014 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/pelican-blogging-pt-2/</guid><description>&lt;p&gt;So the whole point of running a static website (besides that it&amp;rsquo;s cool) is the performance aspect. And I personally think that if you&amp;rsquo;re doing something for performance you might as well go all the way. So here&amp;rsquo;s how I optimized my static website.&lt;/p&gt;
&lt;p&gt;First downloading the plugins and themes I would require to the folder for my configuration files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone https://github.com/getpelican/pelican-plugins ~/Projects/Pelican/plugins
git clone https://github.com/getpelican/pelican-themes ~/Projects/Pelican/themes
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then adding them to the main configuration file by adding these lines to the bottom.&lt;/p&gt;</description></item><item><title>How I set up Pelican for blogging pt. 1</title><link>https://rasmuslarsson.se/post/pelican-blogging-pt-1/</link><pubDate>Sun, 10 Aug 2014 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/pelican-blogging-pt-1/</guid><description>&lt;p&gt;No, this blog still uses &lt;del&gt;WordPress&lt;/del&gt; (now Hugo!) because of its convenvience and ease of use. But I needed a way to document my personal server that I use for Mumble, IRC and my small projects and I decided to test out static blog generators for that.&lt;/p&gt;
&lt;p&gt;Normally people use &lt;a href="http://octopress.org/"&gt;Octopress&lt;/a&gt; (based on &lt;a href="http://jekyllrb.com/"&gt;Jekyll&lt;/a&gt;) which labels itself as &amp;ldquo;A blogging framework for hackers&amp;rdquo; which is cool and all but I really don&amp;rsquo;t like Ruby and I had heard a lot of good stuff about &lt;a href="http://blog.getpelican.com/"&gt;Pelican&lt;/a&gt; so I went with that.&lt;/p&gt;</description></item><item><title>On two factor authentication</title><link>https://rasmuslarsson.se/post/two-factor-authentication/</link><pubDate>Fri, 07 Feb 2014 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/two-factor-authentication/</guid><description>&lt;p&gt;I&amp;rsquo;m studying computer security this term and it has a way of making you very paranoid about security matters, and recent articles like &lt;a href="https://medium.com/p/24eb09e026dd"&gt;this&lt;/a&gt; and &lt;a href="http://arstechnica.com/security/2014/01/how-i-almost-lost-my-500000-twitter-username-jb-and-my-startup/"&gt;this&lt;/a&gt; really doesn&amp;rsquo;t help either. Therefore I&amp;rsquo;ve decided to set up two-factor authentication everywhere possible to help protect myself to some degree for the uselessness of passwords.&lt;/p&gt;
&lt;p&gt;Two-factor authentication essentially means that you use two authentication factors to log in instead of only one. An authentication factor is one of three things, something you &lt;em&gt;know&lt;/em&gt;, something you &lt;em&gt;have&lt;/em&gt; or something you &lt;em&gt;are&lt;/em&gt;. A password is a good example of the first, while a card or cell phone is in the second category.&lt;/p&gt;</description></item><item><title>On Vagrant</title><link>https://rasmuslarsson.se/post/on-vagrant/</link><pubDate>Fri, 31 Jan 2014 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/on-vagrant/</guid><description>&lt;p&gt;Vagrant enables a developer to isolate their project to a dedicated virtual machine while still coding in the same environment they use for other projects. You can essentially edit your project files in Windows and access the result through Windows while everything is running on Linux without having to do any of the tedious work of setting up and installing a virtual machine.&lt;/p&gt;
&lt;p&gt;The cool thing about Vagrant is how the configuration file for the project can be redistributed with the rest of the code base to give other developers access to an exact replica of the original development environment.&lt;/p&gt;</description></item><item><title>Fucking sudo</title><link>https://rasmuslarsson.se/post/fucking-sudo/</link><pubDate>Mon, 13 Jan 2014 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/fucking-sudo/</guid><description>&lt;p&gt;I stumbled across &lt;a href="http://www.reddit.com/r/programming/comments/1sqnj7/416d65726963612043616e20436f646520/ce0jnoq"&gt;this comment&lt;/a&gt; a while ago and though it was pretty funny, so I wrote a basic one liner to add the &amp;ldquo;feature&amp;rdquo; to my shell. Basically what it does is allowing you to write &amp;ldquo;fucking&amp;rdquo; instead of &amp;ldquo;sudo&amp;rdquo; for the humorous effect of it, example below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ make install
No.
$ fucking make install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here&amp;rsquo;s the code for setting it up. The specified configuration file needs to be changed for it to work in other shells than bash.&lt;/p&gt;</description></item><item><title>Automatically setting height of textarea to height of its contents on page load</title><link>https://rasmuslarsson.se/post/automatically-setting-height-of-textarea-to-its-contents-on-page-load/</link><pubDate>Fri, 23 Aug 2013 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/automatically-setting-height-of-textarea-to-its-contents-on-page-load/</guid><description>&lt;p&gt;jQuery makes everything so ridiculously simple. To make sure a textarea is automatically resized so it fits its content one could calculate the amount of rows of text and the approximate height of the font and set the height of the textarea to the product of that. Or you could set the height to the scroll size with jQuery and JavaScript.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;script&amp;gt;
$(function() {
$('textarea').height($('textarea').prop('scrollHeight'));
});
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Admittedly, it&amp;rsquo;s not a complete solution if you need it on a page with more than one textarea though. Then it goes from a one-liner to a three-liner.&lt;/p&gt;</description></item><item><title>Is [language] worth learning?</title><link>https://rasmuslarsson.se/post/is-language-worth-learning/</link><pubDate>Mon, 29 Jul 2013 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/is-language-worth-learning/</guid><description>&lt;p&gt;This is a really short response to a question I&amp;rsquo;ve stumbled across twice today, &amp;ldquo;Is [language] worth learning?&amp;rdquo; All languages have some worth, but they are all good in different areas. It all depends on what you want to do and how much you want to learn about programming.&lt;/p&gt;
&lt;p&gt;C is very good if you want to learn how computers work without delving into the inaccessible mess that is assembly programming. However, it takes quite a bit of effort and understanding to do a lot with C.&lt;/p&gt;</description></item><item><title>How to put checkboxes in Bootstrap dropdowns</title><link>https://rasmuslarsson.se/post/how-to-put-checkboxes-in-bootstrap-dropdowns/</link><pubDate>Fri, 26 Jul 2013 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/how-to-put-checkboxes-in-bootstrap-dropdowns/</guid><description>&lt;p&gt;&lt;a href="http://twitter.github.io/bootstrap/"&gt;Bootstrap&lt;/a&gt; is an extremely useful set of tools which, I personally believe, everyone should know about and use for their own internal projects. It&amp;rsquo;s ridiculous what a time saver it is, especially combined with &lt;a href="http://fortawesome.github.io/Font-Awesome/"&gt;Font Awesome&lt;/a&gt; to get over 360 free, scalable icons to use with Bootstrap.&lt;/p&gt;
&lt;p&gt;Bootstrap also have these amazing JavaScript tools which, for instance, allows you to place a dropdown menu on virtually any element. The only problem with these are that you can&amp;rsquo;t really put forms in them, since the dropdown closes when you click on it. So I looked over Stack Overflow and Google and found all sorts of elaborate solutions to it, some where pretty good, others not so much.&lt;/p&gt;</description></item><item><title>An alternative for SQL pagination</title><link>https://rasmuslarsson.se/post/sql-pagination/</link><pubDate>Fri, 05 Jul 2013 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/sql-pagination/</guid><description>&lt;p&gt;I was reading up on improving the performance on MySQL when I found an article and stumbled on a really cool alternative to using offset when generating pagination results from the database.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;On the query side, instead of using &lt;code&gt;LIMIT&lt;/code&gt; with &lt;code&gt;offset&lt;/code&gt;, you can select one more row than you need, and when the user clicks the &amp;ldquo;next page&amp;rdquo; link, you can designate that final row as the starting point for the next set of results. For example, if the user viewed a page with rows 101 through 120, you would select row 121 as well; to render the next page, you&amp;rsquo;d query the server for rows greater than or equal to 121, limit 21.&lt;/p&gt;</description></item><item><title>Building a template engine in PHP</title><link>https://rasmuslarsson.se/post/a-template-engine-in-php/</link><pubDate>Wed, 22 May 2013 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/a-template-engine-in-php/</guid><description>&lt;p&gt;Possibly the most common sign of bad code is tight coupling, especially between logic and presentation. It might seem like a good idea to print out the HTML while the data is being generated, but it more often than not leads to a big incoherent mess of tangled code. It also causes other issues, like what happens if an unexpected error occurs in the middle of the page? By then half the page has already been outputted and it might be too late to handle the error nicely.&lt;/p&gt;</description></item><item><title>Bear riddle</title><link>https://rasmuslarsson.se/post/bear-riddle/</link><pubDate>Sat, 23 Feb 2013 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/bear-riddle/</guid><description>&lt;p&gt;I love riddles, this is probably my favorite one since it seems very irrational but is pretty easily solved by logical deduction. Can you solve it?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A bear walks one mile south, one mile east and one mile north and is then back at its original position.&lt;/p&gt;
&lt;p&gt;What color is the bear?&lt;/p&gt;
&lt;/blockquote&gt;</description></item><item><title>How to combine multiple commits into one</title><link>https://rasmuslarsson.se/post/git-squash/</link><pubDate>Mon, 19 Nov 2012 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/post/git-squash/</guid><description>&lt;p&gt;If you&amp;rsquo;re using Git you know how powerful it is as a CVS tool. But when Git is used as a deployment tool to be able to quickly revert changes if needed it may cause some headaches when deploying major features. There&amp;rsquo;s a trade off between having one giant commit and working with Git the preferred way of using small, incremental commits when deploying in this way. If there&amp;rsquo;s a critical problem with the new feature it will need to be reverted quickly which could become quite annoying if there are a lot of commits. While on the other hand it more or less defeats the purpose of using a CVS if you&amp;rsquo;re never working with your history, so to solve that I present the wonderful part of Git that is known as rebasing.&lt;/p&gt;</description></item><item><title>About</title><link>https://rasmuslarsson.se/page/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rasmuslarsson.se/page/about/</guid><description>&lt;p&gt;This blog is mostly set up as a writing exercise for me, I hope to improve my writing by forcing myself to write semi-regularly and in front of an audience. It also serves as a way for me to create an online presence and show of some of my work. I try to keep my posts short and worthwile, the first bit is easy.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://rasmuslarsson.se/rasmus.png" alt="Rasmus"&gt;&lt;/p&gt;</description></item></channel></rss>