Skip to content

Instantly share code, notes, and snippets.

View amigus's full-sized avatar

Adam Migus amigus

View GitHub Profile
@amigus
amigus / exec
Created September 18, 2022 20:10
PowerShell on Linux hack to allow SSH to 'exec' itself when using `ProxyJump`
#!/bin/sh
# PowerShell on Linux hack to allow SSH to "exec" itself when using `ProxyJump`
# It must be in the path and named `exec` to work
case "$(basename $0)" in exec) $* ;; *) exec $* ;; esac
@amigus
amigus / bak.sh
Last active May 15, 2022 05:08
A script that creates a script that backs up the '/etc' folder. To use it, run `/etc/bak` after running the script below, as root.
#!/bin/sh
cat<<EOF>>/etc/bak.exclude
./etc/.pwd.lock
./etc/machine-id
./etc/mtab
./etc/multipath/bindings
./etc/openldap/schema
./etc/os-release
./etc/resolv.conf
@amigus
amigus / install-nvidia-driver.sh
Last active April 3, 2022 06:50
A script that signs the NVIDIA Linux driver before installing it
#!/usr/bin/env bash
# The NVIDIA Linux driver will not load under Secure Boot unless it is signed.
# This script signs the driver using a sign-signed certificate.
# The certificate must be loaded into the UEFI via `mokutil`.
# See https://docs.oracle.com/en/learn/sboot-module/index.html#enrolling-the-certificate-into-the-uefi-secure-boot-key-database
cert="${INSTALL_NVIDIA_DRIVER_CERT_DIR:-${INSTALL_NVIDIA_DRIVER_DIR}}cert.der"
key="${INSTALL_NVIDIA_DRIVER_CERT_DIR:-${INSTALL_NVIDIA_DRIVER_DIR}}cert.key"
if test ! -r "${cert}"; then
@amigus
amigus / get_k8s_cert.sh
Created February 16, 2022 16:33
A bash script that requests and approves a certificate from a Kubernetes cluster.
#!/bin/sh
program=$(basename $0)
DEFAULT_NAMESPACE="default"
DEFAULT_DIRECTORY=.
DEFAULT_BITS=2048
usage() {
cat<<EOF
@amigus
amigus / profile.ps1
Last active November 21, 2023 06:32
My PowerShell Profile
<# My $PROFILE; https://gist.github.com/amigus/26cfb6cc8578ef783668c0b9346bd26c #>
$ConfigDirectory = Get-Item $PROFILE | Select-Object -ExpandProperty DirectoryName
#region $env:Path
<#
The PSPaths.ps1 file is a list of expressions that evaluate to folder names e.g.
$env:USERPROFILE + '\.local\bin'
#>
foreach ($DirectoryExpression in Get-Content "${ConfigDirectory}\PSPaths.ps1") {
@amigus
amigus / launch.json
Created April 2, 2021 19:57
VSCode launch.json file to launch Ansible AWX running in it's container
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: AWX",
"type": "python",
"request": "launch",
@amigus
amigus / dot.bashrc
Last active January 8, 2022 02:44
My .bashrc
# The .bashrc adam at migus.org uses
test -s "$HOME/.config/envman/load.sh" && . "$HOME/.config/envman/load.sh" # For envman
javadir=/usr/lib64/jvm/javadir-openjdk; test -d $javadir && export JAVA_HOME=$javadir; unset javadir
mvndir="${HOME}/share/apache-maven-3.6.3"; test -d $mvndir && export MAVEN_HOME=$mvndir; unset mvndir
viexe=$(which vim); test -x $viexe && export EDITOR=$viexe; unset viexe
export LIBVIRT_DEFAULT_URI=qemu:///system
case "$-" in *i*) ;; *) return ;; esac # interactive
@amigus
amigus / onename verification
Created July 18, 2016 01:48
to be verified by onename and added to the blockchain
Verifying that +amigus is my blockchain ID. https://onename.com/amigus