Skip to content

Instantly share code, notes, and snippets.

View aauren's full-sized avatar

Aaron U'Ren aauren

  • Sony Interactive Entertainment
  • Austin, TX
View GitHub Profile
@aauren
aauren / static_build.sh
Created January 6, 2016 23:02
Create Static Build of the_silver_searcher
#!/bin/bash
GENTOO_REPO="/var/portage/repos/gentoo"
WORK_DIRECTORY="/var/tmp/portage/"
LIBPCRE_VERSION="8.38"
XZ_UTILS_VERSION="5.2.2"
LIBPCRE_WORK_DIR="${WORK_DIRECTORY}/dev-libs/libpcre-${LIBPCRE_VERSION}/work/pcre-${LIBPCRE_VERSION}"
XZ_UTILS_WORK_DIR="${WORK_DIRECTORY}/app-arch/xz-utils-${XZ_UTILS_VERSION}/work/xz-${XZ_UTILS_VERSION}"
foo() {
@aauren
aauren / gist:c8a5513ba1cc5d734994
Last active August 29, 2015 14:14
Linux Desktop Window Switching
#!/usr/bin/env bash
# Creates a dialog using Zenity that lists all of your open windows and then switches to whatever window matches your input
# Requires Zenity, wmctrl, and xdotool packages
WINDOW_TITLES=$(wmctrl -l | grep -v "\-1" | sed -r 's/([^ ]+ +){3}(.*)/\2/g')
WINDOW_SELECTION=$(zenity --entry --title="Choose a Window" --text="${WINDOW_TITLES}")
DESKTOP_NUMBER=$(wmctrl -l | grep -v "\-1" |grep -m 1 ${WINDOW_SELECTION} | sed -r 's/^[^ ]+ +([^ ]+) .*/\1/g')
@aauren
aauren / gist:b4e868ad05bf79ceaf45
Last active August 29, 2015 14:07
Salt Command To Check For Open HTTPS Ports + Find Domain Name If Apache
# Command to find all servers and show whether they have an SSL port open or not
salt '*' cmd.run "if netstat -an 2>/dev/null |grep -qE '.*(443|8443)+[ \t]+.*LISTEN[ \t]*$'; then echo '+++SSL Port Found+++'; apachectl -S 2>&1 |grep -E '(:443|port 443)'; else echo '---SSL Port Not Found---'; fi"
# Same command as above, except only display servers with an open SSL port
salt '*' cmd.run "if netstat -an 2>/dev/null |grep -qE '.*(443|8443)+[ \t]+.*LISTEN[ \t]*$'; then echo '+++SSL Port Found+++'; apachectl -S 2>&1 |grep -E '(:443|port 443)'; else echo '---SSL Port Not Found---'; fi" |tac | sed '/---SSL Port Not Found---/,+1 d' |tac

Keybase proof

I hereby claim:

  • I am aauren on github.
  • I am aauren (https://keybase.io/aauren) on keybase.
  • I have a public key whose fingerprint is 6B92 8F4D 7407 9721 1C17 5C61 AFC0 2E39 CAA4 A6E1

To claim this, I am signing this object:

@aauren
aauren / gist:4157632
Created November 27, 2012 22:33
PowerShell Grep Equivilent
function Select-StringSpecial {
param(
[string] $query
)
Begin {
# Executes once before first item in pipeline is processed
}
Process {
# Executes once for each pipeline object
$args = @{}
@aauren
aauren / movie_move.sh
Created March 24, 2012 00:00 — forked from rothgar/movie_move.sh
Script for moving movie files
#!/bin/bash
#
# Usage: movie_move.sh directory_name
#
# Moves all files in the specified directory into
# subdirectories of the same name, minus the file
# extension.
if [ $# -ne 1 ]; then
echo "Usage: ./filestodirs directory_name"
@aauren
aauren / gist:2159881
Created March 22, 2012 17:10
Regex for Justin
echo "A Bug's Life (1990).mp4" | sed 's/\(.*\)\s([0-9]*)\..*/"\1"/'
With the extension:
echo "A Bug's Life (1990).mp4" | sed 's/\(.*\)\s([0-9]*)\.\(.*\)/"\1.\2"/'
Aaron's better way of creating the file:
echo "A Bug's Life (1990).mp4" | sed 's/\s([0-9]\+)//'
Aaron's better way of creating the folder:
echo "A Bug's Life (1990).mp4" | sed 's/\s([0-9]\+).*//'