config

How to use the Lightbend Config library in a Scala or Java application

Table of Contents1 - Adding the Lightbend Config dependency2 - A Scala application that uses Lightbend Config3 - The Lightbend Config configuration file4 - Discussion

If you want to use Lightbend Config configuration files in your Scala or Java application, here’s a quick example of how to configure and use Lightbend Config in your application. In this case I’m specifically using Scala and SBT.

How to manually specify the custom location of a Typesafe Config configuration file alvin May 12, 2018 - 6:19pm

If you need to manually specify the custom location of a Lightbend Config configuration file when running a Scala or Java application, I can confirm that this java command setting works:

java -Dconfig.file=my_app.conf [the rest of your app parameters]
     -------------------------

In my case I read the Lightbend Config file like this in my Scala application:

Notes on how to configure HTTPS/SSL with Nginx (on a Linode Ubuntu server) alvin March 23, 2017 - 1:50pm
Table of Contents1 - Summary2 - New Linode Server3 - Update Everything4 - Ubuntu Firewall5 - Add a New User6 - Disabling Root Login (sshd_config)7 - Limit Login Attempts (sshd_config)8 - Install Nginx and MySQL9 - Adjust Firewall10 - Nginx Configuration11 - Installing Java on Ubuntu12 - NOT what I used: Let’s Encrypt on Ubuntu 16.0413 - (1) Create a cert (openssl)14 - (2) Create a strong Diffie-Hellman group15 - (3) Configure Nginx to Use SSL16 - Adjust the Nginx Configuration to Use SSL17 - (Alternative Configuration) Allow Both HTTP and HTTPS Traffic18 - Adjust the Firewall19 - Enable the Changes in Nginx20 - Test in Browser21 - Nginx "default_server"22 - Can change to a permanent redirect (301)23 - More Security: Preventing Information Disclosure24 - More Security: Fail2Ban25 - Restricting Access by IP Address26 - See also

Without any introduction or discussion, here are the notes I made while learning how to get HTTPS working with Nginx. These are just for me, but if something helps you, cool.

How to configure Nginx to serve multiple static websites on one server

UPDATE: These days you should put your server configurations in files in the /etc/nginx/sites-enabled directory.

As a short note, if you need to configure Nginx to serve multiple static websites out of one nginx.conf file, I have been using this approach, and it seems to work well:

A sample MacOS Bash startup file (.bash_profile)

In case you need a sample .bash_profile startup file for your MacOS or other Unix/Linux system, I thought I’d share my most recent version here.

If you're not familiar with a .bash_profile file, this is a startup file that is read whenever you open a new Terminal window. It's a special configuration file, and it needs to be placed in your home directory. For instance, on my MacBook Pro, this file is located as /Users/al/.bash_profile.

A Perl configuration file example

Here's some Perl code that I just pulled from a working program that demonstrates how to read a human-readable configuration file in a Perl program: