Skip to content

Instantly share code, notes, and snippets.

Avatar

Owen Wood Evildethow

View GitHub Profile
@Evildethow
Evildethow / purge-old-kernels
Created Aug 7, 2018
Purge old kernels on Linux Mint / Ubuntu
View purge-old-kernels
#!/bin/bash
OLDCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
CURKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
LINUXPKG="linux-(image|headers|ubuntu-modules|restricted-modules)"
METALINUXPKG="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
OLDKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
YELLOW="\033[1;33m"
RED="\033[0;31m"
ENDCOLOR="\033[0m"
View keybase.md

Keybase proof

I hereby claim:

  • I am evildethow on github.
  • I am evildethow (https://keybase.io/evildethow) on keybase.
  • I have a public key whose fingerprint is E6BA BF18 FB42 F612 4341 125B E2FA DC4C 4D89 84F9

To claim this, I am signing this object:

View create-global-user-pass-credentials.sh
#!/usr/bin/env bash
set -o nounset -o errexit -o pipefail
usage() {
cat <<EOM
Usage:
$(basename $0) [OPTIONS]
$(basename $0) [ -j | --jenkins-url | -d | --desc | -c | --cred-id | -cu | --cred-user | -cp | cred-pass | -u | --user-id | -p | --password
| -h | --help ]
@Evildethow
Evildethow / create-ssh-node.sh
Last active Oct 2, 2020
Jenkins: Create SSH node, using bash and curl
View create-ssh-node.sh
#!/usr/bin/env bash
set -o nounset -o errexit -o pipefail
usage() {
cat <<EOM
Usage:
$(basename $0) [OPTIONS]
$(basename $0) [ -j | --jenkins-url | -n | --node-name | -s | -d | --desc | --slave-home | -e | --executors | -sh | --ssh-host | -sp | --ssh-port
| -c | --cred-id | -l | --labels | -u | --user-id | -p | --password | -h | --help ]
You can’t perform that action at this time.