Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am lucashalbert on github.
  • I am lhalbert (https://keybase.io/lhalbert) on keybase.
  • I have a public key whose fingerprint is 56BF 565F DCA9 7EAB D929 707E 0247 2564 C93D 8196

To claim this, I am signing this object:

#!/bin/bash
####################################################################################
#
# Author: Lucas Halbert <https://www.lhalbert.xyz>
# Date: 01.23.2018
# Last Edited: 01.23.2018
# Version: 2018.01.23
# Description: Performs a backup of the entire slapd DIT. Can be run from cron
# License: BSD 3-Clause License
#
@lucashalbert
lucashalbert / ssh-reagent.sh
Last active August 6, 2018 16:55
Function to add to bashrc to remap ssh-agent after disconnect
# Function intended to remap an SSH agent socket after reconnection
function ssh-reagent() {
# find new ssh-agent socket
SSH_AUTH_SOCK=$(find /tmp/ssh-* -user `whoami` -name agent\* -printf '%T@ %p\n' 2>/dev/null | sort -k 1nr | sed 's/^[^ ]* //' | head -n 1)
# Check if SSH_AUTH_SOCK is a socket and if it is a symbolic link
if [ -S "${SSH_AUTH_SOCK}" ] && [ ! -h "${SSH_AUTH_SOCK}" ]; then
# Map SSH_AUTH_SOCK to Canonical Socket in ~/.ssh/
echo "Mapping ${SSH_AUTH_SOCK} to ~/.ssh/ssh_auth_sock as a symbolic link"
ln -sf ${SSH_AUTH_SOCK} ~/.ssh/ssh_auth_sock
@lucashalbert
lucashalbert / slapd-post-upgrade.sh
Last active January 29, 2019 17:05
Post upgrade script to run after recompiling OpenLDAP server
#!/bin/bash
####################################################################################
#
# Author: Lucas Halbert <https://www.lhalbert.xyz>
# Date: 06/12/2018
# Last Edited: 01/29/2019
# Version: 2019.01.29
# Description: Moves necessary schema and LDIF files from old slapd instance to
# newly compiled instance. Fixes permissions as necessary for slapd
# to run.
@lucashalbert
lucashalbert / delete-all-confluence-cloud-spaces.sh
Last active January 29, 2019 17:12
Deletes all iterable spaces in Confluence Cloud using the RESTful API. Requires the jq json utility.
#!/bin/bash
####################################################################################
#
# Author: Lucas Halbert <https://www.lhalbert.xyz>
# Date: 01/25/2019
# Last Edited: 01/25/2019
# Version: 2019.01.25
# Description: Leverage the Confluence Cloud RESTful API to batch delete all
# iterable spaces.
# License: BSD 3-Clause License
@lucashalbert
lucashalbert / generate-salted-sha512-hash.py
Created January 29, 2019 17:15
Script to generate a salted sha512 hash
#!/usr/bin/python
import sys;
import getpass;
import crypt;
import uuid;
password = getpass.getpass("New Password: ");
salt = uuid.uuid4().hex [0:8];
<#
Author: Lucas Halbert <contactme@lhalbert.xyz>
Date Written: 08/18/2017
Date Modified: 08/31/2017
Version: 0.3
Description: Imports a CSV file with names and emails into a specified distribution group
Revision History:
08/31/2017 c0.3 - Add Try/Catchs and logging to script.
@lucashalbert
lucashalbert / Windows10Decrapifier.ps1
Last active March 19, 2019 13:43
A Windows 10 Decrapifier Script
<#
.SYNOPSIS
Decrapify Windows 10 by uninstalling default crapware and disable Telemetry services
.DESCRIPTION
Uninstall stupid useless garbage that Microsoft ships with Windows 10 by default.
.NOTES
Uninstall stupid useless garbage that Microsoft ships with Windows 10 by default.
@lucashalbert
lucashalbert / Hardened Vanilla Cisco Configuration
Last active November 8, 2023 08:47
A Hardened Vanilla Cisco Config for use on switches
en
conf t
crypto key zeroize
no ip finger
no service tcp-small-servers
no service udp-small-servers
no service config
no ip source-route
no service pad
service tcp-keepalives-in
@lucashalbert
lucashalbert / Chrome-thisisunsafe.ahk
Created March 5, 2019 19:47
AutoHotKey script to send the string "thisisunsafe" when navigating to an "unsafe" page in Chrome.
; AutoHotKey script to send the string "thisisunsafe" when navigating to an "unsafe" page in Chrome.
#F5::Send, thisisunsafe