Skip to content

Instantly share code, notes, and snippets.

View heywoodlh's full-sized avatar
:octocat:
Trapped in Vim

Spencer Heywood heywoodlh

:octocat:
Trapped in Vim
View GitHub Profile
@heywoodlh
heywoodlh / wp-replace-sql-url
Last active January 14, 2017 14:02
sql script that finds old URL in database and replaces it with new URL
UPDATE wp_options SET option_value = replace(option_value, 'http://travelspective.com', 'http://localhost/tsbuild/build') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://travelspective.com', 'http://localhost/tsbuild/build');
UPDATE wp_posts SET post_content = replace(post_content, 'http://travelspective.com', 'http://localhost/tsbuild/build');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://travelspective.com', 'http://localhost/tsbuild/build');
@heywoodlh
heywoodlh / weblogin.sh
Created May 8, 2017 00:57
Simple bash script that logs user into desired website
#!/usr/bin/env bash
help_message() {
echo "Usage: $0 'username' 'password' 'https://urltologin.com'"
}
if [ -z $1 ]
then
help_message
exit 2
@heywoodlh
heywoodlh / headless-vbox.sh
Created May 8, 2017 14:40
headless-vbox script
#!/usr/bin/env bash
#Requirements:
# 1. ssh needs to be running on vm
# 2. VM_NAME and USER variable need to be set
#Set these variables (VM_NAME should equal the name of your virtualbox vm, USER should equal the name of your vm username)
VM_NAME=""
@heywoodlh
heywoodlh / clean-up.ps1
Created May 8, 2017 14:42
simple powershell that downloads tools for cleaning up Windows desktop, runs them and then removes them
<# REMEMBER TO SetExecutionPolicy Unrestricted -Force #>
<# Download tech tools #>
#!/usr/bin/env bash
IP=$(sudo arp-scan --localnet --numeric --quiet --ignoredups | grep -E '([a-f0-9]{2}:){5}[a-f0-9]{2}' | awk '{print $1}')
echo $IP | fmt -w 1
#!/bin/bash
################################
# OS X Install ISO Creater #
# #
# Author: shela #
################################
#######################################
# Declarations
@heywoodlh
heywoodlh / generic-portforward.sh
Last active August 22, 2017 20:51
Simple port forwarding script via SSH
#!/usr/bin/env bash
PORT='80'
SSH_PORT='22'
USERNAME='root'
HOSTNAME='myserver.com'
if ssh -p "$SSH_PORT" -t -t -L 9000:127.0.0.1:"$PORT" "$USERNAME"@"$HOSTNAME" &
then
SSH_PID=$(echo $!)
sleep 5
@heywoodlh
heywoodlh / account-lookup.ps1
Created August 31, 2017 16:02
Active Directory Account Lookup
$domainServer = 'ad1.mydomain.com'
$user = Read-Host -Prompt 'Last Name: '
get-aduser -f {SurName -eq $User}
@heywoodlh
heywoodlh / lynis.sh
Last active September 12, 2017 03:05 — forked from foozmeat/lynis.sh
Script to run lynis and notify you if something needs attention
#!/bin/sh
#set -x
EMAIL=l.spencer.heywood@gmail.com
. /etc/apache2/envvars
/usr/sbin/lynis -c -Q -q --profile /etc/lynis/default.prf
# Check to ensure we're still at 100%
@heywoodlh
heywoodlh / facebook-search.py
Created September 15, 2017 16:43
Facebook Search
#!/usr/bin/env python3
import sys
import requests
from bs4 import BeautifulSoup as bs
try:
firstname = sys.argv[1]
except IndexError:
print('Usage: ' + sys.argv[0] + ' firstname lastname')
sys.exit(1)