Skip to content

Instantly share code, notes, and snippets.

View phin3has's full-sized avatar

Brandon E. phin3has

View GitHub Profile
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
@phin3has
phin3has / RM_libreoffice_install_openoffice
Created October 22, 2015 18:17
Removes Libre Office, Installs OpenOffice
apt-get remove --purge libreoffice*
apt-get autoremove
wget http://downloads.sourceforge.net/project/openofficeorg.mirror/4.1.1/binaries/en-US/Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-US.tar.gz?r=http%3A%2F%2Fwww.openoffice.org%2Fdownload%2Findex.html&ts=1445537614&use_mirror=skylineservers
tar -xvfz Apache_OpenOffice_4.1.1_Linux_x86-64_install-deb_en-US.tar.gz
cd en-US/DEBS
dpkg -i *.deb
cd desktop-integration
@phin3has
phin3has / VMware-Workstation-Backup
Last active October 26, 2015 19:55
Backs up Linux Hosted VMware Workstation Machines
#!/bin/bash
# Backs up VM workstations, will suspend if you provide a name (see line 57)
# Written by @awhitehatter, 10-26-15
LOGFILE="/var/log/vmbak.log"
BACKUPD="/path/to/backup"
BACKDIR="$(date +"%d-%m-%y")-bak"
# Backup function
function backup {
@phin3has
phin3has / pingalyzer.py
Created May 24, 2013 19:17
This is the start of my first real Python program "Pingalyzer.py"
import sys, os, re
#in Python3.3 there's a sick module called "ipaddress", Nix hasn't pulled 3.3 into the reps and I don't feel like forcing that on people.
#import ipaddress
logo = '''
____ ____ ____ ____ ____ _ __ __ _____ ___ ____
| \ || \ / | / || | | | || | / _]| \
| o ) | | _ || __|| o || | | | ||__/ | / [_ | D )
| _/| | | | || | || || |___ | ~ || __|| _]| /
| | | | | | || |_ || _ || ||___, || / || [_ | \
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G}%H %{..Y}%m/%d/%y %c:%s"
defscrollback 1024
vbell off
startup_message off
@phin3has
phin3has / whowho.py
Last active July 9, 2018 21:33
Compiles email addresses from a .csv of first and last names
#!/usr/bin/python
__author__ = '@awhitehatter'
__version__= 1.0
'''
WhoWho is script that builds username addresses from CSV imports.
example:
From test.csv:
first_name,last_name
@phin3has
phin3has / scanparser.py
Created December 11, 2018 22:07
Masscan XML Parser
__author__ = '@awhitehatter'
__version__ = '0.1'
import xml.etree.ElementTree as ET
import argparse
import sys
'''
###########################################################################
@phin3has
phin3has / r7-data-scraper.py
Created January 4, 2019 23:54
Rapid7-OpenAPI-DNS Scan extractor
import requests
import json
from pprint import pprint
'''
Author: @awhitehatter
Date: 01/04/2019
Version: 1.0
Description: A script that pulls down latest FDNS and RDNS scans from rapid7, provides the URL
@phin3has
phin3has / stopvps.py
Last active September 26, 2019 19:04
Stop an EC2 instance
#! /usr/bin/python3
import boto3
session = boto3.Session(profile_name='default', region_name='us-west-2')
client = session.client('ec2')
instID = 'ID'
response = client.describe_instance_status(
@phin3has
phin3has / runvps.py
Last active September 26, 2019 19:05
Start an EC2 instance
#! /usr/bin/python3
import boto3
session = boto3.Session(profile_name='default', region_name='us-west-2')
client = session.client('ec2')
instID = 'ID'
response = client.describe_instance_status(