Skip to content

Instantly share code, notes, and snippets.

@john-auld
john-auld / hyperv_vmware_player.md
Created September 8, 2019 20:12
Windows 10 laptop with Hyper-V and VMWare Player

Use VMWare Player for External NAT and DHCP

External Switch binding

Bind the external virtual switch to VMnet8.

DHCP file

@john-auld
john-auld / jenkins_java.md
Created September 5, 2019 12:32
Jenkins java options

Jenkins temp directory configuration

If a new installation of Jenkins fails to start on CentOS 7, check the temp directory configuration.

JENKINS_JAVA_OPTIONS=-Djava.io.tmpdir=/var/lib/jenkins/tmp

	Executing: /usr/bin/java -Djava.io.tmpdir=/var/lib/jenkins/tmp
@john-auld
john-auld / minikube-win10-hyper-v.md
Last active September 2, 2019 21:55
Minikube on Windows 10 with Hyper-V

Brief notes on using minikube on Windows 10 Professional

Assumming that Hyper-V is setup and working, with a virtual switch named "External".

Downloads

Minikube

kubectl

@john-auld
john-auld / ssh-agent-windows10.md
Created June 7, 2019 11:10
SSH Agent for Visual Studio Code on Windows 10

Using ssh-agent with Visual Studio Code on Windows 10

Enable the ssh-agent service

To enable SSH Agent automatically on Windows, start PowerShell as an Administrator and run the following commands:

# Make sure you're running as an Administrator
Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
@john-auld
john-auld / ansible-dump-digital-ocean-dns-zone.yml
Created June 3, 2019 14:58
Ansible playbook to dump a DNS Zone hosted by Digital Ocean to a BIND style zone file.
---
#
# Dump DNS Zone file from a zone hosted by Digital Ocean
#
- hosts: localhost
connection: local
gather_facts: false
vars:
oauth_token: "redacted-api-key-from-digital-ocean"
@john-auld
john-auld / pam_open_session_System_error.md
Created May 20, 2019 09:00
Centos 7 Pam session error - user account expired

PAM session fail for users with an expired account

sudo whoami
sudo: pam_open_session: System error
sudo: policy plugin failed session initialization

Check if the password for the account has expired

@john-auld
john-auld / netcat-udp-connectivity-test.md
Last active April 17, 2019 09:50
UDP Connectivity check

No connectivity

nc -u -z -w 3 8.8.8.8 54 && echo OK || echo failed
failed

With connectivity

nc -u -z -w 3 8.8.8.8 53 && echo OK || echo failed
OK
@john-auld
john-auld / screen.md
Created April 16, 2019 15:42
Linux screen command

Create named screen

screen -S screen-name

Detach screen

Ctrl+a d

List screens

screen -ls

Attach screen

@john-auld
john-auld / git-commands.md
Last active April 16, 2019 12:52
Useful git commands

check if local branch is up to date

git remote show origin

tidy up local branches that have been deleted from the origin

git fetch --prune

@john-auld
john-auld / s3_delete_bucket.py
Created April 3, 2019 12:22
Delete S3 bucket containing versions
'''
Delete a bucket that contains versions.
Author: John Auld
'''
import boto3
my_bucket = 'replace-with-aws-s3-bucket-name'
delete_bucket = False
delete_versions = False