Skip to content

Instantly share code, notes, and snippets.

View GhostofGoes's full-sized avatar

Chris Goes GhostofGoes

  • New Mexico, USA
  • 04:58 (UTC -06:00)
View GitHub Profile
# Set colored terminal prompt as "hostname:current directory$ "
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
# Niceities
alias cd..="cd .."
alias rm="rm -i" # Interactive mode delete
alias hs="cd ~/ && ls"
alias up="cd .."
alias home="cd ~/"
alias root="sudo su"
# Set colored terminal prompt as "hostname:current directory$ "
# Not sure if this works on centos yet
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
# Niceities
alias cd..="cd .."
alias rm="rm -i" # Interactive mode delete
alias hs="cd ~/ && ls"
alias up="cd .."
alias home="cd ~/"
# Set colored terminal prompt as "hostname:current directory$ "
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
# Niceities
alias cd..="cd .."
alias rm="rm -i" # Interactive mode delete
alias hs="cd ~/ && ls"
alias up="cd .."
alias home="cd ~/"
alias root="sudo su"
@GhostofGoes
GhostofGoes / fedora-bashrc
Created April 8, 2018 19:38
.bashrc file for Fedora
# Set colored terminal prompt as "hostname:current directory$ "
# Not sure if this works on centos yet
# PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
# Niceities
alias cd..="cd .."
alias rm="rm -i" # Interactive mode delete
alias hs="cd ~/ && ls"
alias up="cd .."
alias home="cd ~/"
# Install latest version Python package from a git repo (e.g. if they haven't pushed to pypi)
python3 -m pip install --user git+ssh://git@github.com/DannyCork/python-whois.git
# Install network security tools
sudo apt install tcpdump tshark wireshark snmp snmp-mibs-downloader wireshark-doc nmap
# Install tools that aren't bundled with Ubuntu
sudo apt install cloc ipcalc mtr htop atop glances iftop iptraf nethogs
# Count lines of code
cloc ./*
@GhostofGoes
GhostofGoes / python-snippets.py
Last active November 22, 2021 11:47
Various useful snippets of Python code I've picked up over the years. Python 3 is assumed unless stated otherwise.
#!/usr/bin/env python3
"""
Sources
* https://github.com/GhostofGoes/ADLES
"""
import logging
import logging.handlers
import sys
import os
# Source: http://www.hanselman.com/blog/ABetterPROMPTForCMDEXEOrCoolPromptEnvironmentVariablesAndANiceTransparentMultiprompt.aspx
setx prompt "[%computername%] $d$s$t$_$p$_$_$+$g"
@GhostofGoes
GhostofGoes / latex_customizations.tex
Last active September 14, 2018 00:47
Various useful aliases, customizations, settings, packages, and such for LaTeX I've used over the years.
\documentclass[14pt]{extarticle}
% --------------------------------------------------------------------------
% Package imports
\usepackage{enumitem}
\usepackage{pdfpages}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
@GhostofGoes
GhostofGoes / homework_template.tex
Created September 14, 2018 00:49
Template I used for doing my Math and CS homework in LaTeX
\documentclass[10pt,twoside]{article}
\usepackage{multicol}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb}
\usepackage{color,graphicx,overpic}
\usepackage{hyperref}
\usepackage{polynom}
\usepackage[export]{adjustbox}
@GhostofGoes
GhostofGoes / evil.py
Created September 14, 2018 02:20
Evil python
import sys
for m in sys.modules.keys():
if not m.startswith('__') and '.' not in m:
sys.modules[m] = None