Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@brasey
brasey / Configure systemd-resolved to use a specific DNS nameserver for a given domain.md
Created October 25, 2019 14:38
Configure systemd-resolved to use a specific DNS nameserver for a given domain

Configure systemd-resolved to use a specific DNS nameserver for a given domain

Use case

Given

  • I use a VPN to connect to my work network
  • I'm on a Linux computer that uses systemd-resolved
  • I have a work domain called example.com
  • example.com is hosted by both public and private DNS nameservers
@brasey
brasey / HAProxy behind AWS ELB: how to force HTTPS?.md
Last active March 15, 2019 14:39
HAProxy behind AWS ELB: how to force HTTPS?

HAProxy behind AWS ELB: how to force HTTPS?

What are you trying to solve

You have some nodes in AWS that you want to load balance.

You want to use the magical scaling properties of ELB.

You want to do some things that ELB doesn't do, like force HTTPS (or add headers, or something else).

Keybase proof

I hereby claim:

  • I am brasey on github.
  • I am brasey (https://keybase.io/brasey) on keybase.
  • I have a public key ASDqRt6NR7lb_461Qc5Uf3BQsgR72kIJ8xW80-8c_SgDfAo

To claim this, I am signing this object:

@brasey
brasey / Remove Windows carriage returns.md
Created September 14, 2015 18:26
Remove Windows carriage returns

Remove Windows carriage returns

With vim, all you need is

:e ++ff=dos
@brasey
brasey / Install VMware Workstation on Linux 3.19 kernel.md
Created March 30, 2015 12:50
Install VMware Workstation on Linux 3.19 kernel

Install VMware Workstation on Linux 3.19 kernel

VMware Workstation fails to install on 3.19 kernel. Luckily, VMware is on the ball. Just need to patch and compile to make it work.

Arch Wiki

Copypasta:

Since 3.19 kernel the vmnet module will fail to build.

@brasey
brasey / Where to put files on a Linux system.md
Created January 15, 2015 21:38
Where to put files on a Linux system

Where to put files on a Linux system

How did I only just find this?

man hier
@brasey
brasey / Create kickstart ISO image for RHEL.md
Created January 6, 2015 18:28
Create kickstart ISO image for RHEL

Create kickstart ISO image for RHEL

Notes

I'm mounting the downloaded disk image in a directory called 'cd'.

I'm creating the new disk image in a directory called 'cd.new'.

Steps

@brasey
brasey / Too many authentication failures for username.md
Last active August 29, 2015 14:09
Too many authentication failures for username

Too many authentication failures for username

The problem

I was getting this error when trying to SSH to a brand new CentOS 7 VM I was setting up. I hadn't even done anything yet, so I was confused until I realized I had hit the 'MaxAuthTries' limit configred in /etc/ssh/sshd_config on the VM by issuing a single command.

I have a few (ok, 9) SSH keys in my ~/.ssh directory. When you issue an SSH connection request without specifying which key to use via the -i option, SSH tries to use each key.

The default MaxAuthTries value on a CentOS 7 box is 6.

@brasey
brasey / Masterless Puppet using a Puppetfile.md
Created November 18, 2014 20:58
Masterless Puppet using a Puppetfile

Masterless Puppet using a Puppetfile

The problem

When running Puppet in masterless mode, meaning there is no Puppet Master for the node to connect to, one of the problems you have to solve is how to get all your Puppet modules onto the node. Without going into all the possible ways of doing this, one nice and clean way to solve the problem is to use a Puppetfile.

If you know what a Ruby gemfile is, you can guess what a Puppetfile is. If you don't, think of a very simple list declaring the modules that a node should get, including ways to get those modules. Like this:

forge 'forge.puppetlabs.com'
@brasey
brasey / Generate a Linux password hash suitable for shadow file.md
Last active July 3, 2020 00:56
Generate a Linux password hash suitable for shadow file

Generate a Linux password hash suitable for shadow file

Need

Someone gives me a password to configure for a local Linux user account. We're managing local user accounts with Puppet, which needs a hash just like the one that's in /etc/shadow. Setting the password through manual means is not an option.

Solution

This Python foo: