Skip to content

Instantly share code, notes, and snippets.

View vlj91's full-sized avatar

Vaughan Jones vlj91

View GitHub Profile
@vlj91
vlj91 / aws-interface.sh
Last active July 8, 2016 08:47
aws-interface
#!/bin/bash -l
set -ex
if [[ $UID -ne 0 ]]; then
echo "Please run as the root user" 2>&1
exit 1
fi
## Gather required information
awsregion=$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/.$//')
@vlj91
vlj91 / xcat-install.sh
Last active March 23, 2021 23:05
xCAT install (CentOS 7)
#!/bin/bash
cat << EOF > /etc/yum.repos.d/xCAT-core.repo
[xcat-2-core]
name=xCAT 2 Core packages
baseurl=http://xcat.org/files/xcat/repos/yum/2.13/xcat-core
enabled=1
gpgcheck=1
gpgkey=http://xcat.org/files/xcat/repos/yum/2.13/xcat-core/repodata/repomd.xml.key
EOF
@vlj91
vlj91 / xcat-centos7-image.sh
Created February 22, 2018 11:48
xCAT CentOS7 image generation
#!/bin/bash
yum install -y -e0 wget
mkdir -pv /opt/vm
pushd /opt/vm
wget http://centos.serverspace.co.uk/centos/7/isos/x86_64/CentOS-7-x86_64-Everything-1708.iso
copycds CentOS-7-x86_64-Everything-1708.iso
genimage centos7.4-x86_64-netboot-compute
packimage centos7.4-x86_64-netboot-compute
popd
@vlj91
vlj91 / bootstrap_puppet.sh
Created March 16, 2018 21:08
bootstrap_puppet.sh
#!/bin/bash -xe
@vlj91
vlj91 / kube-pod-secret.yaml
Created April 21, 2018 01:58
kube-pod-secret.yaml
---
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
env:
@vlj91
vlj91 / kickstart.sh
Last active July 12, 2018 00:32
kickstart.sh
#!/bin/bash
mirror="http://optus.net/centos/7/os/x86_64"
ks_url="https://gist.githubusercontent.com/vlj91/1e3c367eb14b00e78abad6df52257591/raw/663b5297a46f07329ff170aa4e64e374703fc03b/centos7.ks"
mkdir -pv /boot
curl "${mirror}/isolinux/initrd.img" > /boot/initrd.img
curl "${mirror}/isolinux/vmlinuz" > /boot/vmlinuz
curl "${ks_url}" > /boot/kickstart.ks
@vlj91
vlj91 / centos7.ks
Last active July 12, 2018 00:46
centos7.ks
# SCAP Security Guide OSPP/USGCB profile kickstart for Red Hat Enterprise Linux 7 Server
# Version: 0.0.2
# Date: 2015-11-19
#
# Based on:
# http://fedoraproject.org/wiki/Anaconda/Kickstart
# https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-kickstart-syntax.html
# http://usgcb.nist.gov/usgcb/content/configuration/workstation-ks.cfg
# Text or Graphical
text
@vlj91
vlj91 / keybase.md
Created February 7, 2019 23:41
keybase.md

Keybase proof

I hereby claim:

  • I am vlj91 on github.
  • I am vlj91 (https://keybase.io/vlj91) on keybase.
  • I have a public key ASDJo6mLMZliNfPYVXlRwxJeyqd2sTn9w2h2gJ2dOTM7uwo

To claim this, I am signing this object:

@vlj91
vlj91 / update_ecr_image_scan.rb
Last active November 3, 2019 03:13
Update all AWS ECR repositories to use image scanning on push, and run an initial scan
#!/usr/bin/env ruby
require 'aws-sdk-ecr'
ecr = Aws::ECR::Client.new
ecr.describe_repositories.repositories.map(&:repository_name).each do |repo|
# set to scan on image push, this only affects newly pushed images
ecr.put_image_scanning_configuration(
repository_name: repo,
image_scanning_configuration: {
@vlj91
vlj91 / qgroundcontrol-install.sh
Created July 28, 2020 10:15
qgroundcontrol-install.sh
# building qgroundcontrol for raspberry pi 4
# steps:
# 1. compile QT for raspberry Pi:
# - the version of QT that comes with debian doesn't compile
# QGC correctly, so we compile a newer version
# - this can take up to 8 hours even with 4 cores
# 2. compile qtlocation
# 3. compile qgroundcontrol using qt5.12.8
# this assumes a desktop environment is present to actually run qgc once it's compiled