Skip to content

Instantly share code, notes, and snippets.

View dwallraff's full-sized avatar

Dave Wallraff dwallraff

View GitHub Profile
@dwallraff
dwallraff / install_powershell.sh
Created January 15, 2020 16:29
Install powershell and PowerCLI (Powershell VMware Components) on linux
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –
sudo curl -o /etc/apt/sources.list.d/microsoft.list https://packages.microsoft.com/config/ubuntu/18.04/prod.list
sudo apt-get update
sudo apt-get install powershell
pwsh
pwsh> Install-Module -Name VMware.PowerCLI
@dwallraff
dwallraff / makes_changes_to_a_docker_image.md
Created January 15, 2020 16:22
How to makes changes to a docker image and save it to a file for export
  1. docker run -it <image name> bash
  2. make changes
  3. docker ps -a to find the name of your container
  4. docker commit <container name> <image name>
  5. `docker save | tar zcf .tgz
@dwallraff
dwallraff / remove_known_hosts.js
Created December 3, 2019 18:57
Remove known hosts keys for Secure Shell App - credit to @leogaggl
// Stolen from https://www.gaggl.com/2015/07/chromeos-removing-ssh-known_hosts-from-chromebook/
CTRL + Shift + J
term_.command.removeAllKnownHosts();
@dwallraff
dwallraff / net_raw_k8s.sh
Last active October 1, 2019 19:31
Remove NET_RAW from your k8s securityContext
# Sample conf to remove NET_RAW access from k8s pods
# Prevent ARP spoofing clusters
# https://blog.aquasec.com/dns-spoofing-kubernetes-clusters
apiVersion: v1 kind: Pod metadata:
name: security-context-demo
spec:
containers:
- name: test
image: alpine
@dwallraff
dwallraff / quick_ca.md
Last active October 1, 2020 01:20
Quick and simple 'CA' signed cert

Quick and simple 'CA' signed cert (and learn some useful openssl commands)

This will NOT set up a 'proper' CA.
This will NOT be a trusted CA.
But it will give you a cert to use as your 'trusted CA' if needed.


Step 1

First, we need to create a new cert and key. This will be your new CA cert, so change the -subj values to something more appropriate.

@dwallraff
dwallraff / yubikey_ssh.sh
Created August 14, 2019 20:43
Set up for ssh to use gpg-agent for using yubikey for ssh key
export GPG_TTY=$(tty)
gpg-connect-agent updatestartuptty /bye
unset SSH_AGENT_PID
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
@dwallraff
dwallraff / surprising_bash_vars.md
Created May 13, 2019 02:41
Seven Surprising Bash Variables - @ianmiell

Seven Surprising Bash Variables - zwischenzugs

Continuing in the series of posts about lesser-known bash features, here I take you through seven variables that bash makes available that you may not have known about.


PROMPT_COMMAND

You might already know that you can manipulate your prompt to show all sorts of useful information, but what fewer people know is that you can run a shell command every time your prompt is displayed.

@dwallraff
dwallraff / ssh_config.sh
Created April 12, 2019 14:51
ssh config samples
### Notes and stuffs for ssh config
### Basics
# IdentityFile ~/.ssh/default
# ServerAliveInterval 240
# Include configs/*
### Port forwarding
# Host server

"Knowledge is powerful, be careful how you use it!"

A collection of inspiring lists, manuals, cheatsheets, blogs, hacks, one-liners, cli/web tools, and more.

@dwallraff
dwallraff / update_tarball_password.sh
Last active February 27, 2019 08:08
Update encrypted tarballs with new 1password tarball password
#! /usr/bin/env bash
#-- Dave Wallraff
# First things first, I'm the realest...
shopt -s extglob
mkdir -p working_dir
# https://gist.github.com/oneohthree/f528c7ae1e701ad990e6
function slugify {