Skip to content

Instantly share code, notes, and snippets.

@Evildethow
Evildethow / purge-old-kernels
Created August 7, 2018 22:17
Purge old kernels on Linux Mint / Ubuntu
#!/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"

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:

#!/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 March 25, 2022 23:25
Jenkins: Create SSH node, using bash and curl
#!/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 ]