Skip to content

Instantly share code, notes, and snippets.

@rikvanderkemp
rikvanderkemp / Example.md
Created September 21, 2022 13:31
Loading multiple parameters from the AWS parameter store and using them in terraform

Let's say you have the following parameters defined in the AWS parameter store:

/production/worker/SOME_PARAM_1
/prodcution/worker/SOME_PARAM_2

Instead of using multiple data blocks you can use aws_ssm_parameters_by_path to load them all at once. \ But using them is another thing. To be able to use them easily, you can remap this data into your own object.

@rikvanderkemp
rikvanderkemp / ssh-known-hosts-mgmt.sh
Created February 25, 2021 11:37 — forked from ctnpull/ssh-known-hosts-mgmt.sh
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com > /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -H -F github.com
@rikvanderkemp
rikvanderkemp / Lenovo Thinkpad X1 Carbon Extreme (gen2).md5
Created October 20, 2020 15:27
Setting up the Lenovo Thinkpad X1 Carbon Extreme (gen2) for usage with Linux
These are my findings of helpful changes to make to Linux (I use Manjaro) to get the most out of this laptop,
# Kernel Modules
install acpi_call:
```
sudo pacman -S linux54-acpi_call
```
#!/bin/env bash
curl -LO "https://github.com/BurntSushi/ripgrep/releases/download/11.0.2/ripgrep-11.0.2-i686-unknown-linux-musl.tar.gz"
tar xvf ripgrep-11.0.2-i686-unknown-linux-musl.tar.gz
cp ripgrep-11.0.2-i686-unknown-linux-musl/rg /usr/local/bin/
@rikvanderkemp
rikvanderkemp / fix_video.sh
Created August 7, 2019 13:13
Installing ffmpeg for Vivaldi on Manjaro (Arch)
# Disclaimer: Works on my machine
# Also, I am aware there is an AUR package, but it seemed out of date.
# From http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/ download the latest version of the ffmpeg codes
# at the time of writing chromium-codecs-ffmpeg_76.0.3809.87-0ubuntu0.19.04.1_amd64.deb
# For the sake of sanity create a temp folder first ;-)
# Download latest package
$ curl -O http://security.ubuntu.com/ubuntu/pool/universe/c/chromium-browser/chromium-codecs-ffmpeg_76.0.3809.87-0ubuntu0.19.04.1_amd64.deb
@rikvanderkemp
rikvanderkemp / gist:090499da85307e8df20a0e1a4501e997
Created July 27, 2019 12:02
Check incoming IPs on 443 or 80
netstat -tn 2>/dev/null | grep :443 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
netstat -tn 2>/dev/null | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | head
@rikvanderkemp
rikvanderkemp / fonts.conf
Created February 2, 2019 13:05
Font config for emojis
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match>
<test name="family">
<string>sans-serif</string>
</test>
<edit mode="prepend" binding="strong" name="family">
<string>Noto Color Emoji</string>
</edit>
@rikvanderkemp
rikvanderkemp / gist:d91b2fa03d87f9ad18ae6d8753799342
Created June 20, 2018 08:42 — forked from carlosmcevilly/gist:2221249
fix git commit with wrong email address in git config, before pushing
If:
- you add and commit with the wrong email address in git, and
- your remote has a hook set up to prevent you from pushing with the bad address
Then you need to amend the author of your commit before push can succeed:
1. fix your email address in git config:
$ git config user.name "Your Name"

Keybase proof

I hereby claim:

  • I am rikvanderkemp on github.
  • I am rvdk (https://keybase.io/rvdk) on keybase.
  • I have a public key whose fingerprint is 8F6B 9393 4239 CFD8 F6B2 3E6C DFE9 2AD7 6A37 D05A

To claim this, I am signing this object:

@rikvanderkemp
rikvanderkemp / content.rake
Created August 2, 2016 17:04
Capistrano - Load a Mysql dump from a host to local machine
import 'config/local.rb'
namespace :content do
desc "Fetch database from target environment"
task :pull do
on roles(:web) do |host|
file_name = "content-#{fetch(:stage)}-" + Time.now.to_i.to_s
execute "mysqldump --opt -Q #{fetch(:database_name)} > db.sql"