Skip to content

Instantly share code, notes, and snippets.

View consolewitch's full-sized avatar

Steppin' Razor consolewitch

View GitHub Profile
My mastodon account: https://pdx.social/web/@ConsoleWitch
@consolewitch
consolewitch / borg_cookie_company.txt
Last active September 12, 2021 05:01
cookie clicker save
@consolewitch
consolewitch / .vimrc
Last active April 21, 2022 02:58
vim configuration
" Set leader key for quick commands
let mapleader = " "
" encode "to sixty four" and "from sixty four"
vnoremap <leader>tsf c<c-r>=system('base64', @")<cr><esc>
vnoremap <leader>fsf c<c-r>=system('base64 --decode', @")<cr><esc>
" Show line numbers
set number
@consolewitch
consolewitch / .tmux.conf
Last active April 21, 2022 03:07
tmux.conf
# splitting panes with | and -
bind | split-window -h
bind - split-window -v
# enable mouse scrolling through backlog
#set -g mouse on
# Set vi as the default editor
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
@consolewitch
consolewitch / pipeline.groovy
Created February 6, 2020 01:47
jenkins scripted pipeline for review.
properties([
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '60',
numToKeepStr: ''
)
),
@consolewitch
consolewitch / example.groovy
Created January 2, 2020 07:05
a working jenkins pipeline with some helpful examples
properties([
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '',
artifactNumToKeepStr: '',
daysToKeepStr: '60',
numToKeepStr: ''
)
),
pipelineTriggers([githubPush()])
@consolewitch
consolewitch / mongo-entrypoint.sh
Last active March 25, 2019 20:26
A really stupid entrypoint script from the mongo docker container version 3.2.3
#!/bin/bash
set -e
# if parameters that start with '-' were passed to the script via the CMD directive then concat
# them to the string 'mongod'
if [ "${1:0:1}" = '-' ]; then
set -- mongod "$@"
fi
# if the last conditional statement was triggered or if we're running without any parameters
@consolewitch
consolewitch / main.yaml
Created July 17, 2018 22:18
ansible role (tasks/main.yaml) to install k8s on an ubuntu server.
---
- name: "Disable swap"
command: "swapoff -a"
- name: "Remove swap from fstab"
lineinfile:
path: /etc/fstab
state: absent
regexp: '^.*(\t| )swap(\t| )sw(\t| ).*$'
@consolewitch
consolewitch / var_rename.py3
Last active June 7, 2018 00:54
In a shell / ansible / packer stack find and replace var names.
import re
import fileinput
import sys
old_caps_underscored_var=sys.argv[1]
old_lower_underscored_var=old_caps_underscored_var.lower()
old_lower_dashed_var=old_lower_underscored_var.replace("_","-")
new_caps_underscored_var=sys.argv[2]
new_lower_underscored_var=new_caps_underscored_var.lower()
@consolewitch
consolewitch / deploy_k8s_manifests.yaml
Last active May 18, 2018 18:37
deploy Kubernetes manifests with ansible (broken)
# This is *a* way to deploy kubernetes manifests with ansible but it doesn't currently work very well..
# the python library that ansible uses to call kubernetes isn't up to date. See the following link for details
# https://github.com/ansible/ansible/issues/36676#event-1510125400
#- name: "install requirements for ansible k8s_raw module"
# pip:
# name: "{{ item.name }}"
# version: "{{ item.version }}"
# state: present with_items:
# - { name: "openshift", version: "0.5.0" }