This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ~/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 ./* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: http://www.hanselman.com/blog/ABetterPROMPTForCMDEXEOrCoolPromptEnvironmentVariablesAndANiceTransparentMultiprompt.aspx | |
setx prompt "[%computername%] $d$s$t$_$p$_$_$+$g" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[14pt]{extarticle} | |
% -------------------------------------------------------------------------- | |
% Package imports | |
\usepackage{enumitem} | |
\usepackage{pdfpages} | |
\usepackage{calc} | |
\usepackage{ifthen} | |
\usepackage{geometry} | |
\usepackage{amsmath,amsthm,amsfonts,amssymb} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
PY2 = sys.version_info[0] == 2 | |
if PY2: | |
import _winreg as winreg | |
else: | |
import winreg | |
try: | |
reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) | |
ps_key = winreg.OpenKey(reg, r'SOFTWARE\Microsoft\PowerShell') | |
except OSError: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function TabExpansion($line, $lastWord) { | |
$lastBlock = [regex]::Split($line, '[|;]')[-1].TrimStart() | |
$aliases = @("pipenv") + @(Get-Alias | where { $_.Definition -eq "pipenv" } | select -Exp Name) | |
$aliasPattern = "($($aliases -join '|'))" | |
if($lastBlock -match "^$aliasPattern ") { | |
$Env:_PIPENV_COMPLETE = "complete-powershell" | |
$Env:COMMANDLINE = "$lastBlock" | |
(pipenv) | ? {$_.trim() -ne "" } | |
Remove-Item Env:_PIPENV_COMPLETE | |
Remove-Item Env:COMMANDLINE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Provides same functionality as the Unix "which" command | |
function which($commandName) | |
{ | |
(Get-Command $commandName).Definition | |
} | |
# Shortens a filesystem path to singe-characters [used by prompt()]. | |
function shorten-path([string] $path) { | |
$loc = $path.Replace($HOME, '~') |
OlderNewer