Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
echo 'at=lxd-config msg="Init LXD"'
cat <<EOF | sudo lxd init --preseed
config:
core.https_address: '[::]:8443'
core.trust_password: password
networks:
- config:
ipv4.address: auto
@jwieringa
jwieringa / gonum.md
Created May 6, 2019 18:53
Learning why gonum is bumped to latest

Working off from LDA project on RadiusNetworks/lda#7

What I expect:

  • The go get command sets gonum version in go.mod to gonum revision
  • Running the tests succeed

What I observe:

  • The @revision of go get is ignored
  • The latest version is fetched setting the revision to the last commit on master
  • go test fails
@jwieringa
jwieringa / attributes.rb
Created April 20, 2019 17:55 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
#!/bin/bash
#By installing the Amazon Inspector Agent, you agree that your use is
# subject to the terms of your existing AWS Customer Agreement or other
# agreement with Amazon Web Services, Inc. or its affiliates governing your
# use of AWS services. You may not install and use the
# Amazon Inspector Agent unless you have an account in good standing with AWS.
# Copyright 2016 Amazon Web Services, Inc. or its affiliates. All Rights Reserved.
# Licensed under the terms of your existing AWS Customer Agreement
@jwieringa
jwieringa / vim-ruby-command-t-install.markdown
Created November 8, 2011 16:40
Install Vim with Ruby Interpreter and Command-T on Ubuntu

Summary

The following instructions will install Vim with the Ruby interpreter and Command-T. I keep my vim settings under revision control, thus I have chosen to use Git's submodules and Pathogen to manage Command-T. Depending on your preferences, you may want to setup Command-T differently. I recommend reading through the Command-T Readme

Install dependencies (what my system required), hg, and rake

sudo apt-get install ruby ruby-dev libncurses5-dev mercurial clone build-essential rake

I chose to compile vim with my system Ruby, 1.8.7. It is important that you use the same version to compile both Vim and Command-T. If your using RVM and you want to do the same, before proceeding you will want to:

rvm use system

In a terminal start a server.

$ python -m SimpleHTTPServer 8000

In another terminal set up the cgroups freezer.

@jwieringa
jwieringa / terraform-select-resources.sh
Last active July 5, 2018 18:01
A helper bash script for selectively applying Terraform resources
#!/bin/bash
plan () {
terraform plan \
-out=plan.output \
-target=module.useast1.aws_eip.nateip[3]
}
apply () {
terraform apply plan.output
@jwieringa
jwieringa / infra-secret-management-overview.md
Created May 10, 2018 20:14 — forked from maxvt/infra-secret-management-overview.md
Infrastructure Secret Management Software Overview

Currently, there is an explosion of tools that aim to manage secrets for automated, cloud native infrastructure management. Daniel Somerfield did some work classifying the various approaches, but (as far as I know) no one has made a recent effort to summarize the various tools.

This is an attempt to give a quick overview of what can be found out there. The list is alphabetical. There will be tools that are missing, and some of the facts might be wrong--I welcome your corrections. For the purpose, I can be reached via @maxvt on Twitter, or just leave me a comment here.

There is a companion feature matrix of various tools. Comments are welcome in the same manner.

@jwieringa
jwieringa / gist:c111410d53a74b4bdeea74a837b03af2
Created May 1, 2018 21:47
Amazon linux Package Version Install
# JDK version: Find the pacakge version with:
# $ yum --showduplicates list java-1.8.0-openjdk | expand
# Loaded plugins: priorities, update-motd, upgrade-helper
# Available Packages
# java-1.8.0-openjdk.x86_64 1:1.8.0.71-2.b15.8.amzn1 amzn-main
# java-1.8.0-openjdk.x86_64 1:1.8.0.77-0.b03.9.amzn1 amzn-updates
# java-1.8.0-openjdk.x86_64 1:1.8.0.91-0.b14.10.amzn1 amzn-updates
# java-1.8.0-openjdk.x86_64 1:1.8.0.101-3.b13.24.amzn1 amzn-updates
#
# Example install: yum install <pacakge>-<version_info>.<architecture_info>