About Olof Larsson

This author has not yet filled in any details.
So far Olof Larsson has created 28 blog entries.
12 12, 2019

Quick Window Positioning

By |2019-12-12T13:16:12+00:00December 12th, 2019|Uncategorized|0 Comments

About three years ago I switched OS from Windows to MacOS. One thing that surprised me was the MacOS lacks a built in feature for quick window positioning. On Windows you can use the Windows key (CMD on MacOS?) and the arrow keys to place the window quickly. The first solution I found was the free and Open Source application "Spectacle": https://www.spectacleapp.com/ It's since been abandoned by the author but there's the active fork "Rectangle": [...]

12 12, 2019

The single letters are yours

By |2019-12-12T05:57:23+00:00December 12th, 2019|Uncategorized|0 Comments

Have you noticed that most terminal commands are at least two letters long? This is certainly the case for built in unix commands: https://en.wikipedia.org/wiki/List_of_Unix_commands Two letter examples: ls, cd, cp, mv, rm. Three letter examples: pwd, cat, kill, awk, cut. Longer examples: alias, chmod, chown, crontab, time, xargs. There is no single letter command to be found among the built in ones. But what if we widen our search to non built in ones? https://formulae.brew.sh/analytics/install-on-request/365d/ [...]

11 12, 2019

Do you cd .. a lot?

By |2019-12-11T14:35:16+00:00December 11th, 2019|Uncategorized|1 Comment

If you have multiple software repositories, how do you move between them? Possibly you have all repositories checked out into the same parent directory? Do you cd .. a lot? [crayon-5df665f502204805371992/] Save some time by making a new "go-to-repository-command". Let's call this command "r". Mine looks like this: [crayon-5df665f502209592125521/] It's basically a copy paste from this Stack Overflow thread: https://stackoverflow.com/questions/38737675/different-directory-for-bash-completion I followed these two Stack Overflow threads to add ZSH compatibility (used by some colleagues): [...]

16 11, 2019

Tweaking Git Push

By |2019-11-16T16:24:11+00:00November 16th, 2019|Uncategorized|0 Comments

I recently investigated what terminal commands I used the most. Turns out "git push" is a common one. With that in mind it could make sense to investigate and solve some pain points I have with "git push". Pushing Tags I commonly have to do both "git push" and "git push --tags" after a release. Ideally I would want it to push tags always at the same time. My first attempt at a solution was [...]

16 11, 2019

What commands are you running?

By |2019-11-16T16:24:14+00:00November 16th, 2019|Uncategorized|2 Comments

As a software developer I use the terminal a lot. As I look for ways to save time and become more efficient it would make sense to reflect upon my terminal usage. I couldn't say with certainty which commands I use the most. I've hammered them into the spinal cord. Luckily there is the bash history. Making a "historytop" command is relatively simple. This command prints your top ten most used commands. [crayon-5df665f5036d3410692310/] Breakdown of [...]

21 03, 2019

IT Project Sanity Checklist

By |2019-03-22T08:26:02+00:00March 21st, 2019|Uncategorized|0 Comments

From my perspective as a software developer, a tool you could use to avoid some pitfalls when starting a new IT project. Sum up the points below. Higher score is better. "Keep it Simple" [#1] The lines of code would ... (+1) ... decrease (-1) ... increase TIP: Simplify and remove. You aren't gonna need it. Every line of code adds to the maintenance cost. [#2] The amount of version numbers to keep updated would [...]

2 02, 2018

Daily Droplet Backups to DigitalOcean Spaces

By |2018-02-02T15:03:41+00:00February 2nd, 2018|Uncategorized|0 Comments

In this article I explain how to setup daily backups of Droplets to Spaces at DigitalOcean. More than Weekly It should be noted that DigitalOcean provides a weekly backup system for Droplets. You may click a checkbox and get backups for the price of +20% of the droplet. Personally I want to backup daily. With that in mind I came up with this backup system that backs up to DigitalOcean spaces. There is however nothing [...]

2 02, 2018

The SSH Who Cried Wolf

By |2018-02-02T15:11:14+00:00February 2nd, 2018|Uncategorized|0 Comments

Disclaimer: This article lowers the security of your SSH client connection and leaves you vulnerable to man in the middle attacks. For that I take no responsibility. If you follow the steps below you do so at your own risk. TLDR Add the following to your ~/.ssh/config file to make SSH shut up: [crayon-5df665f503b88305015791/] Wolf! Wolf! The wolf is performing a MITM attack! Have you ever seen this message when attempting to SSH somewhere? [crayon-5df665f503b8d186661718/] In [...]

22 12, 2017

ProGuard with Maven and PluginManagement

By |2017-12-22T17:31:07+00:00December 22nd, 2017|Uncategorized|0 Comments

I recently made use of ProGuard to reduce the size of a jar through tree shaking. Tree shaking is basically the art of holding the software upside down in the roots and shaking it so that you only keep the classes and methods you need. There is a Maven plugin called proguard-maven-plugin that allows you to run ProGuard from your Maven build with ease. How to use this plugin in a way that cooperates well [...]

12 10, 2017

Some Git sugar for your .bashrc

By |2017-10-12T10:15:33+00:00October 12th, 2017|Uncategorized|0 Comments

I'm one of those people that use Git command line quite a lot and have not really adopted any Git GUI clients. To make make life in the terminal more efficient I have added some sugar to my .bashrc. Make "g" an alias for "git" [crayon-5df665f503eca661604890/] The first line creates the alias "g" for "git". Sadly tab completion stops working and the second line takes care of readding that. At the time of writing I'm [...]