Skip to content

Instantly share code, notes, and snippets.

View ejach's full-sized avatar
💯

Evan J ejach

💯
View GitHub Profile
@ejach
ejach / revtun.sh
Last active September 20, 2022 14:55
Shortcut for making a reverse tunnel on `localhost:7777`
#!/bin/bash
if [[ ! -z $1 ]]; then
while getopts i:h:p: option
do
case "${option}" in
i) identity=${OPTARG};;
h) host=${OPTARG};;
p) port=${OPTARG};;
esac
done
@ejach
ejach / README.md
Last active July 22, 2022 15:35
Organize BitWarden Secure Export and only get Secure Notes

BitWarden Secure Note Organizer

Setup

Running the Program

org.py [-h] -i INFILE [-o OUTFILE]
@ejach
ejach / murk.sh
Last active July 19, 2022 15:58
Kill a program based off the port by PID
#!/usr/bin/env bash
# Usage murk <port_number>
if [[ $# -eq 1 ]]; then
pid_array=( ` lsof -i:$1 -t ` )
pid_array_length=${#pid_array[@]}
if [[ "$pid_array_length" -eq "0" ]]; then
echo "No PID's on that port number have been found"
fi
@ejach
ejach / README.md
Created April 1, 2022 19:43
Remove user from Git Commit History

Note: Running this script rewrites history for all repository collaborators. After completing these steps, any person with forks or clones must fetch the rewritten history and rebase any local changes into the rewritten history.

1 - Before running this script, you'll need:

  • The old email address that appears in the author/committer fields that you want to change
  • The correct name and email address that you would like such commits to be attributed to

These can be found by going to https://github.com/<username>/<repository>/commit/<commit_hash>.patch

2 - Create a fresh, bare clone of your repository:

  git clone --bare https://github.com/<username>/<reponame>.git

Keybase proof

I hereby claim:

  • I am ejach on github.
  • I am ejach (https://keybase.io/ejach) on keybase.
  • I have a public key whose fingerprint is 7591 B050 8D0C 33FA EEB0 7F03 C7B7 C8CE 7DCB C785

To claim this, I am signing this object:

@ejach
ejach / docker-compose.yml
Created October 4, 2021 22:49
Webserver setup for ejach/InventoryApplication
version: '3.8'
services:
db:
image: mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: parts
volumes:
- /your/mount/point:/var/lib/mysql
FROM python:3.8
WORKDIR /
COPY main.py .
CMD ["python", "main.py"]
@ejach
ejach / python_ssh.py
Last active January 28, 2020 16:13 — forked from JonnyWong16/python_ssh.py
Run a SSH command using Python
# 1. Install the paramikio module for python.
# pip install paramiko
# 2. Edit the SSH details below.
import paramiko
import sys
## EDIT SSH DETAILS ##
SSH_ADDRESS = "192.168.1.1"