Skip to content

Instantly share code, notes, and snippets.

View Jkotheimer's full-sized avatar
🎃

Jack Kotheimer Jkotheimer

🎃
View GitHub Profile
@Jkotheimer
Jkotheimer / ssh_key_manager
Created January 26, 2021 09:07
A simple ssh key manager. Must be an authorized user to add new keys. Auto flushes after 1 month by crontab
#!/usr/bin/bash
#
# @date 1/26/2021
# @author Jack Kotheimer
#
# A simple ssh key manager
#
# Interface for adding a new ssh public key
# Wipes all keys in ~/.ssh/authorized_keys2 once a month with a crontab passing "
# !!MAKE SURE YOUR MASTER KEY IS STORED SAFELY IN ~/.ssh/authorized_keys!!
@Jkotheimer
Jkotheimer / run.sh
Created December 19, 2020 01:55
A deployment mechanism for Docker-based web servers.
#!/usr/bin/env bash
# run.sh
#
# @author: Jack Kotheimer
# @date: 12/5/2020
#
# The main functionality of the script is listed just below in the '_help' function, but if you have any questions about
# the functionality or implementation of this script, feel free to send me a message via email at [email protected]
#
# Enjoy!
@Jkotheimer
Jkotheimer / php-httpd-config
Created June 28, 2020 01:42
A quick and easy script to get Apache HTTPD and PHP7 configured and running on Arch Linux.
#!/usr/bin/bash
# If the user does not have elevated privileges, do that now
[[ $(whoami) != 'root' || $EUID != 0 ]] && {
sudo "$0" "$@"
exit $?
}
function uncomment {
sudo sed -i "/${1}/s/^#//g" ${2}
@Jkotheimer
Jkotheimer / aur-get
Created April 18, 2020 23:23
Simple installer for AUR packages
#!/bin/bash
[ -z $1 ] && echo "No package name specified" && exit 1
# If the package does not exist in the aur, exit with an error
[ "$(curl -I -s "https://aur.archlinux.org/packages/${1}" | head -n 1 | cut -d$' ' -f2)" = 404 ] && {
echo "Could not locate package: ${1}"
exit -1
}
@Jkotheimer
Jkotheimer / .vimrc
Last active November 5, 2020 01:37
My basic vim configuration as a start
" General config
set history=500
command! W execute 'w !sudo tee % > /dev/null' <bar> edit!
set noswapfile
set nobackup
set nowb
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
GREEN='\[\033[0;32m\]'
BLUE='\[\033[0;36m\]'
YELLOW='\[\033[0;33m\]'
NC='\[\033[00m\]'
# If not running interactively, don't do anything
case $- in