Skip to content

Instantly share code, notes, and snippets.

View pocc's full-sized avatar
🏠
Working from home

Ross Jacobs pocc

🏠
Working from home
View GitHub Profile
@pocc
pocc / overwrite-from-master.sh
Created April 15, 2018 02:25
Git force pull to overwrite local files
# Shamelessly stolen from https://gist.github.com/vladimirtsyupko/10964772
git fetch --all
git reset --hard origin/master
git pull origin master
@pocc
pocc / phoNETic-alphabet.txt
Created April 19, 2018 20:10
The phoNETic alphabet for Network Engineers
A - Addressing
B - Broadcast
C - Connection
D - Duplex
E - Ethernet
F - Firewall
G - Gateway
H - Hardware
I - Internet
J - Jitter
@pocc
pocc / workflow.md
Created May 8, 2018 05:19
Versioning and Git Workflow

Semantic Versioning

Details:

Versions are denoted using a standard triplet of integers: MAJOR.MINOR.PATCH. The basic intent is that MAJOR versions are incompatible, large-scale upgrades of the API. MINOR versions retain source and binary compatibility with older minor versions, and changes in the PATCH level are perfectly compatible, forwards and backwards.

@pocc
pocc / original.vimrc
Last active July 23, 2018 17:17
Original vimrc
" Ross Jacobs' original .vimrc
" VUNDLE
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
@pocc
pocc / vimwiki.vimrc
Last active May 21, 2018 04:19
Get a vimwiki up quickly
" *** Get a vimwiki with markdown support up quickly ***
" 1. git clone https://github.com/vimwiki/vimwiki.git ~/.vim/pack/plugins/start/vimwiki
" 2. Paste/append this file to ~/.vimrc
" 3. Change the location of the vimwiki path
"Vimwiki settings
set nocompatible
filetype plugin on
syntax on
@pocc
pocc / whois_host.sh
Created May 30, 2018 20:09
Whois with hostname
whois $(dig +short $1 | tail -n -1)
@pocc
pocc / repo-to-branch.sh
Created June 28, 2018 21:53
Converts a repo to a branch on another repo
#!/bin/bash
# This script will move the files in a repository into a branch in another repository
# arg 1 is file source repo 1, arg 2 is repo 2 that will get a new branch
# arg 3 is repo 1 name, arg 4 is repo 2 name, arg 5 is the branch name
# Get files
cd /tmp
git clone $1
git clone $2
cd $4
@pocc
pocc / inheritance-methods.py
Created July 22, 2018 07:18
Playing around with Python Inheritance
class First(object):
def __init__(self):
super(First, self).__init__()
print("first")
def print_b(self):
print('b')
class Second(First):
def __init__(self):
@pocc
pocc / shark_wrappyr.py
Created August 19, 2018 05:41
Script that takes a pcap and filters and returns the filtered pcap using tshark. Tshark is faster than any python library while still maintaining wireshark syntax.
#!/usr/bin/env python3
# encoding=UTF-8
"""
### SharkWrappyr ###
This script is a python wrapper for tshark that takes a pcap and filters
and returns the filtered pcap. Requires tshark to be installed.
Usage: filtered_pcap = shark_wrappyr(pcap_in, pcap_filters)
"""
import subprocess
@pocc
pocc / test_simple_calculator.py
Created September 2, 2018 01:12
Unittest practice with arithmetic functions
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Unittest practice
This program does basic arithmetic and provides a test class to test it.
# Running
python3 -m unittest test_simple_calculator.py
"""
import unittest