Skip to content

Instantly share code, notes, and snippets.

View raffraffraff's full-sized avatar

Paul Rafferty raffraffraff

  • Dublin, Ireland
View GitHub Profile
@raffraffraff
raffraffraff / appimage-to-deb.sh
Last active January 11, 2023 11:56
AppImage2Deb
#!/bin/bash
# About: This script turns AppImages into regular old .deb files which install the app to /opt/${APP_NAME} and handle icons and .desktop file
fatal() {
echo $@
exit 1
}
[[ -x $(which fakeroot) ]] || fatal "Missing fakeroot. Run 'sudo apt-get install fakeroot'"
@raffraffraff
raffraffraff / docker-build-interactive
Last active June 21, 2020 09:15
Interactive Dockerfile testing
# Run the FROM image interactively with the current directory mounted to /build_dir
# Eg, for python:3.8-alpine...
docker run -it -v /path/to/build_dir:/build_dir --entrypoint=/bin/sh python:3.8-alpine
# Once inside the container interactively, set up some functions that enable the shell to 'run' the Dockerfile
FROM() {
echo FROM $*
}
ENV() {
@raffraffraff
raffraffraff / k3d_complete
Last active December 20, 2021 17:44
bash completion for k3d
# Bash completion script for k3d, because I couldn't find one. Do what you want with it.
# If you're using zsh, this script should work as long as you have these lines in .zshrc:
#
# autoload bashcompinit
# bashcompinit
# source /path/to/your/bash_completion_file
#
# functions to grab k3d clusters info [would be nice if k3d list had a simple mode for grabbing names]
@raffraffraff
raffraffraff / telegraf_prometheus_dog_statsd_bug.sh
Last active June 11, 2019 07:45
Reproduce Telegraf issue #5962
# PREP:
mkdir -p /tmp/telegraf_debug/{prometheus,statsd,telegraf}
# RUN TELEGRAF AGENT
cat <<EOF > /tmp/telegraf_debug/telegraf/telegraf.conf
[agent]
interval = "10s"
flush_interval = "10s"
debug = true
logfile = "/tmp/telegraf_debug/telegraf/telegraf.log"
@raffraffraff
raffraffraff / multisshrun
Created January 28, 2017 13:27
Run a script on remote hosts in batches
#!/bin/bash
# Name: multisshrun
# Purpose: Runs a script on remote hosts over ssh, in defined batch sizes
help() {
cat <<EOF
$(basename ${0}) accepts a host list via stdin and expects a script name as an argument
It runs the script on all host in batches, controlled by -j or --jobs (default=4)
@raffraffraff
raffraffraff / ubuntu-kernel-upgrade.sh
Last active June 26, 2020 15:18
Install latest ubuntu kernel
#!/bin/bash
# Author: Paul Rafferty <[email protected]>
# Purpose: Finds, downloads and installs the latest upstream kernel for Ubuntu
# Note: If your host requires proprietary modules (eg: virtualbox, nvidia, fglrx, bcmwl etc) then
# you require the extra modules package which is not available here. You can try to uninstall
# these modules first before installing the upstream kernel. Otherwise, don't proceed - your
# new kernel probably won't boot.
# GIMME RIGHT NOW: curl -Ls https://goo.gl/VwBSVD | bash