Skip to content

Instantly share code, notes, and snippets.

@samson4649
samson4649 / sm-ipmi-pwr.sh
Last active March 6, 2020 12:28
Used to control super micro servers power state via the IPMI controller remotely
#!/bin/bash
##############################################################################
# _________ _____ .__ #
# / _____/__ ________ ___________ / \ |__| ___________ ____ #
# \_____ \| | \____ \_/ __ \_ __ \ / \ / \| |/ ___\_ __ \/ _ \ #
# / \ | / |_> > ___/| | \/ / Y \ \ \___| | \( <_> ) #
# /_______ /____/| __/ \___ >__| \____|__ /__|\___ >__| \____/ #
# \/ |__| \/ \/ \/ #
# Authored by: Samuel Lock (github.com/samson4649) #
@samson4649
samson4649 / ansible-secrets.sh
Created March 7, 2020 03:19
used to search through ansible variables and vault secrets in configuration directory
#!/bin/bash
#############################################################################
# #
# _ _ _ _ ____ _ #
# / \ _ __ ___(_) |__ | | ___ / ___| ___ ___ _ __ ___| |_ ___ #
# / _ \ | '_ \/ __| | '_ \| |/ _ \ \___ \ / _ \/ __| '__/ _ \ __/ __| #
# / ___ \| | | \__ \ | |_) | | __/ ___) | __/ (__| | | __/ |_\__ \ #
# /_/ \_\_| |_|___/_|_.__/|_|\___| |____/ \___|\___|_| \___|\__|___/ #
# #
#!/bin/bash
###########################
# _ ____ ____ __ ____ ___ __ __ _ ___ _ _
# | |/ /\ \ / / \/ | | _ \ / _ \| \/ | / \ |_ _| \ | |
# | ' / \ \ / /| |\/| | | | | | | | | |\/| | / _ \ | || \| |
# | . \ \ V / | | | | | |_| | |_| | | | |/ ___ \ | || |\ |
# |_|\_\ \_/ |_| |_| |____/ \___/|_| |_/_/ \_\___|_| \_|
#
# ____ ____ _ ___ _ _
@samson4649
samson4649 / create_hotspot.sh
Created August 14, 2020 07:40
Bash hotspot creation script - has some bugs but i use internally when needed.
#!/bin/bash
if (( $(id -u) != 0 )); then
echo "Non root user detected - need to run with root privileges. Exiting..."
exit 99
fi
### start functions
function _clean(){
@samson4649
samson4649 / ssh-mod-conf.sh
Last active September 9, 2020 04:30
SSH config management file to enable and disable ssh configs on the fly
#!/bin/bash
##################################
#
# SSH Mod Config Script
# v1.2
#
# @github.com/samson4649
#
#
@samson4649
samson4649 / dockerme.sh
Last active August 14, 2021 07:24
setup docker and docker-compose
#!/bin/bash
#### install docker-ce ####
# https://docs.docker.com/engine/install/debian/
# update packages and install requirements
apt update && \
sudo apt-get install -yy \
apt-transport-https \
ca-certificates \
curl \
@samson4649
samson4649 / go-update.sh
Created March 30, 2022 23:22
GoLang Latest Installer
#!/bin/bash
# check that root is running
if [ "${EUID}" -ne 0 ]; then
echo "This script needs to be run as root. Exiting..."
exit 1
fi
# get current version of go
current=$(go version | cut -d' ' -f3)
@samson4649
samson4649 / tailscale-exitnode
Last active August 9, 2022 06:58
Tailscale wrapper to quickly change exit node configuration
#!/bin/bash
# colours
GREEN='\033[0;32m'
NC='\033[0m'
CONFIG_PATH=~/.config/.tsen
function _usage(){
echo -e "\nUsage: ${0} [--exit-node <tailscale_node_name>] [--clear | --none]\n"
#requires -version 2
<#
PowerSploit File: PowerView.ps1
Author: Will Schroeder (@harmj0y)
License: BSD 3-Clause
Required Dependencies: None
#>