Skip to content

Instantly share code, notes, and snippets.

View GIJack's full-sized avatar

GI Jack GIJack

View GitHub Profile
@GIJack
GIJack / misc.py
Last active August 30, 2021 19:17
Python Utility Functions
def slugify(in_text):
'''return a slug. Remove spaces, and lowercase'''
out_text = in_text.strip()
out_text = out_text.lower()
out_text = out_text.replace(" ","")
return out_text
import sys
def os_supported():
@GIJack
GIJack / lsblk.py
Last active October 24, 2023 06:35
get drive/disk information in python
import json
import subprocess
def byte2str(in_string):
'''convert bytes into string'''
output = str(in_string.strip())
output = output.lstrip("b")
output = output.strip("\'")
return output
@GIJack
GIJack / repo-add.sh
Last active August 17, 2021 20:25
Add additional remote repository with git
REPO_URL="ssh://[email protected]/repository.git"
git config --add remote.all.url $REPO_URL
### Keybase proof
I hereby claim:
* I am gijack on github.
* I am gi_jack (https://keybase.io/gi_jack) on keybase.
* I have a public key ASA_KtSFPNUuGafnwz1CeQtaBIrCakYLTKtcr6vAI2qBDwo
To claim this, I am signing this object:
@GIJack
GIJack / prompt.sh
Last active December 1, 2019 17:27
Color PS1 Prompts
#Red Root Prompt
PS1='[\[\e[0;31m\]\u@\h \[\e[1;34m\]\w\[\e[m\]] \[\e[1;31m\]\$\[\e[m\] '
# Just red hash#
PS1='[\u@\h \w]\[\e[1;31m\]\$\[\e[m\] '
@GIJack
GIJack / sshd_config
Last active November 24, 2019 20:47
OpenSSH sshd cipher suites
# Specify cipher suite manually
KexAlgorithms [email protected],diffie-hellman-group-exchange-sha256,curve25519-sha256,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512
Ciphers [email protected],aes256-ctr,aes192-ctr,aes128-ctr,[email protected],[email protected]
MACs [email protected],[email protected],[email protected]