Skip to content

Instantly share code, notes, and snippets.

@steelcowboy
steelcowboy / nvm-bash
Created August 8, 2020 23:58
Demo nvm install in bash
testuser@a8086b20287e:~$ echo $SHELL
/bin/bash
testuser@a8086b20287e:~$ ls -a
. .. .bash_logout .bashrc .mkshrc .profile install.sh
testuser@a8086b20287e:~$ ./install.sh
=> Downloading nvm from git to '/home/testuser/.nvm'
=> Cloning into '/home/testuser/.nvm'...
remote: Enumerating objects: 290, done.
remote: Counting objects: 100% (290/290), done.
remote: Compressing objects: 100% (257/257), done.
@steelcowboy
steelcowboy / go2chef-downgrade.txt
Created August 3, 2020 18:09
Allow Downgrade for Go2Chef
__ _ ___|_ )__| |_ ___ / _|
/ _` / _ \/ // _| ' \/ -_) _|
\__, \___/___\__|_||_\___|_|
|___/
GO2CHEF 2020/08/03 11:04:46 loading config from source go2chef.config_source.http
steelcowboy@asclepius:~/github/paperspigot-docker|dev⚡ ⇒ docker run -it -p 25565:25565 myregistry.com/paperspigot:1.16.1
System Info: Java 11 (OpenJDK 64-Bit Server VM 11.0.8+10) Host: Linux 5.4.0-42-generic (amd64)
Loading libraries, please wait...
[02:58:04 ERROR]: Failed to load properties from file: /opt/minecraft/config/server.properties
[02:58:05 WARN]: Failed to load eula.txt
[02:58:05 INFO]: [STDERR]: You have used the Spigot command line EULA agreement flag.
[02:58:05 INFO]: [STDERR]: By using this setting you are indicating your agreement to Mojang's EULA (https://account.mojang.com/documents/minecraft_eula).
[02:58:05 INFO]: [STDERR]: If you do not agree to the above EULA please stop your server and remove this flag immediately.
[02:58:05 INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', name='PROD'
[02:58:05 INFO]: Found new data pack file/bukkit, loading it automatically
#!/bin/bash
set -x
function join_by { local IFS="$1"; shift; echo "$*"; }
target=/mnt
src=/.snapshots/1/snapshot
paths=(

Goal

Define a nested dictionary in the inventory vars. See this repo for full implementation

vars:
  packages:
    install: []
    remove: []
@steelcowboy
steelcowboy / debug.md
Created May 19, 2020 20:12
CPE Chrome Debug Data

With duplicate resource_name

Recipe: cpe_chrome::default
  * cpe_chrome[Configure Google Chrome] action config[2020-05-19T12:48:19-07:00] INFO: Processing cpe_chrome[Configure Google Chrome] action config (cpe_chrome::default line 18)
[2020-05-19T12:48:21-07:00] DEBUG: Fuzzy matches: []
 (up to date)

The diff

 # Cookbook Name:: cpe_chrome
@steelcowboy
steelcowboy / Postfix Dockerfile
Created January 28, 2019 17:13
Dockerfile to set up Postfix
FROM mailu/postfix:1.6
ARG SASLFILE=/etc/postfix/sasl_passwd
ADD postfix.cf /overrides/postfix.cf
ADD sasl_passwd $SASLFILE
RUN postmap hash:$SASLFILE
RUN chown root:root $SASLFILE $SASLFILE.db && chmod 0600 $SASLFILE $SASLFILE.db
smtp inet n - n - - smtpd
10025 inet n - n - - smtpd
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=reject_unlisted_sender,reject_authenticated_sender_login_mismatch,permit
-o smtpd_reject_unlisted_recipient=no
-o cleanup_service_name=outclean
outclean unix n - n - 0 cleanup
-o header_checks=pcre:/etc/postfix/outclean_header_filter.cf
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
alias_maps =
lmtp_host_lookup = native
message_size_limit = 50000000
milter_default_action = tempfail
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
milter_protocol = 6
mydestination =
mydomain = mysite.com
myhostname = mail.mysite.com
mynetworks = 127.0.0.1/32 [::1]/128 192.168.203.0/24
relayhost = [email-smtp.us-west-2.amazonaws.com]:587
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtp_tls_note_starttls_offer = yes
smtp_tls_protocols = !SSLv2,!SSLv3
smtp_tls_security_level = encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_use_tls = yes