Skip to content

Instantly share code, notes, and snippets.

View mjmenger's full-sized avatar

Mark Menger mjmenger

View GitHub Profile
@mjmenger
mjmenger / pull-request-limit.md
Last active March 23, 2021 20:33
Docker Tricks

Find out what your Docker Hub pull limit is and how much is remaining

TOKEN=$(curl "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq -r .token)

curl --head -H "Authorization: Bearer $TOKEN" https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest 2>&1 | grep RateLimit
@mjmenger
mjmenger / idea.md
Last active February 24, 2021 02:50
airgapped-git

you have two environments with source control repositories that need to be synchronized, but they are air-gapped from each other.
On the source system,

git bundle create <bundlefilename> <branchname>

get a copy of the created file named bundlefilename to the target system through whatever means appropriate.

On the target system,

@mjmenger
mjmenger / secrets.md
Last active December 12, 2022 19:26
Volterra stunts

Generate local cert

openssl pkcs12 -nokeys -in <p12-file> -out <name>.crt

will be prompted for password used on the Volterra Console

Generate local key file

openssl pkcs12 -nocerts -nodes -in <p12-file> -out <name>.key

will be prompted for password used on the Volterra Console

@mjmenger
mjmenger / README.md
Last active January 30, 2021 17:18
dirt4 logitech g920

In Dirt 4 my Logitech G920 stopped working. By "stopped working" I mean that the throttle was consistently at 100% and menu navigation was impossible due to a scrolling issue.

After some searching and integrating various suggestions, I made a couple of changes to the xml file that drives how Dirt 4 interprets the G920 input. This fix isn't perfect as some menu navigation was lost in the process and I have to resort to the keyboard. Hopefully, I will be able to fix that in the future. If you have suggestions for improvements, please let me know.

In order to use this file, replace the existing lg_g920.xml in the following location.

<wherever your steam library is installed>\steamapps\common\DiRT 4\input\actionmaps\lg_g920.xml
@mjmenger
mjmenger / createdotenv.sh
Last active February 25, 2022 03:17
terraform cli stunts
# create a .env file for use by the VS Code Rest Client extension
#
# extract the BIG-IP addresses from the Terraform output
export BIGIP_IPS=`terraform output --json | jq -cr '.bigip_mgmt_ips.value[]'`
export BIGIP_USER=admin
# extract the BIG-IP password from the Terraform state
export BIGIP_PASSWORD=`terraform show -json | jq .values.root_module.resources[] | jq -r 'select(.address | contains("random_password")).values.result'`
((i=0))
echo "#.env" > .env
for ip in $BIGIP_IPS; do
@mjmenger
mjmenger / snippet.tmpl
Last active January 21, 2021 01:26
onboard without a secret manager
#!/bin/bash
# BIG-IPS ONBOARD SCRIPT
LOG_FILE=${onboard_log}
if [ ! -e $LOG_FILE ]
then
touch $LOG_FILE
exec &>>$LOG_FILE
@mjmenger
mjmenger / is-bigip-there.rb
Last active August 18, 2021 02:14
Inspec samples
# copyright: 2018, The Authors
title "3-nic example tests"
require_controls 'inspec-bigip' do
control 'bigip-connectivity'
#control 'bigip-licensed'
#control 'bigip-declarative-onboarding'
#control 'bigip-declarative-onboarding-version'
#control 'bigip-application-services'
@mjmenger
mjmenger / extend.md
Last active December 27, 2022 21:29
extend a partition on linux

using parted

parted
(parted) print
(parted) resizepart

partition number? probably get warned about the partition being used... be strong set the end to the biggest number you can think of

@mjmenger
mjmenger / collab.md
Last active October 15, 2020 20:29
collaboration environment setup

https://github.com/cdr/code-server/blob/v3.6.0/doc/install.md

The docker run command below references version 3.6.0 of coder. You can check codercom's docker hub for later versions.

TODO: figure out how to create and specify another user

make certain you change to the project directory before running this command. In addition, the SERVICE_URL and ITEM_URL are optional environment variables that point to the Open VSX Registry.

mkdir -p ~/.coderconfig
@mjmenger
mjmenger / crash.log
Created September 30, 2020 19:19
Terraform crash
This file has been truncated, but you can view the full file.
2020/09/30 19:03:14 [INFO] Terraform version: 0.13.1
2020/09/30 19:03:14 [INFO] Go runtime version: go1.14.7
2020/09/30 19:03:14 [INFO] CLI args: []string{"/home/userhome/.terraform.versions/terraform_0.13.1", "plan"}
2020/09/30 19:03:14 [DEBUG] Attempting to open CLI config file: /home/userhome/.terraformrc
2020/09/30 19:03:14 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/09/30 19:03:14 Loading CLI configuration from /home/userhome/.terraform.d/credentials.tfrc.json
2020/09/30 19:03:14 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/09/30 19:03:14 [DEBUG] ignoring non-existing provider search directory /home/userhome/.terraform.d/plugins
2020/09/30 19:03:14 [DEBUG] ignoring non-existing provider search directory /home/userhome/.local/share/terraform/plugins
2020/09/30 19:03:14 [DEBUG] ignoring non-existing provider search directory /usr/local/share/terraform/plugins