Monthly Archives: October 2017

Read environment variables from files in bash

In the Docker world it’s increasingly common to send secrets through files instead of environment variables by appendingĀ _FILE to the regular environment variable name.

Here’s a bash function which reads such files and updates the corresponding environment variable with the file contents.

Example usage:

Change date format in Chrome

Yeah, you can’t. You’ll have to change the locale Chrome is running in. And if you’re on Linux you can’t do it in the browser – it looks at your environment variables.

So if you want your dates in nice ISO-8601 standard (or if you want to run Chrome in Swedish but the rest of your OS in English) you have to set up the environment just for Chrome.

Said and done, I changed my application launcher to run

/bin/sh -c 'LANGUAGE=sv_SE.UTF-8 && /usr/bin/google-chrome-stable'