Skip to content

Instantly share code, notes, and snippets.

View mmyers1474's full-sized avatar

Matthew Myers mmyers1474

View GitHub Profile
@mmyers1474
mmyers1474 / gist:c957768560fdb3afaf11e203ef909a96
Last active September 8, 2016 05:57
VIM Status Line workspace
hi User1 guifg=#000000 guibg=#880c0e
hi User2 guifg=#000000 guibg=#C0C0C0
hi User3 guifg=#C0C0C0 guibg=#0000FA
hi User4 guifg=#112605 guibg=#aefe7B
hi User5 guifg=#051d00 guibg=#7dcc7d
hi User7 guifg=#ffffff guibg=#880c0e gui=bold
hi User8 guifg=#ffffff guibg=#5b7fbb
hi User9 guifg=#ffffff guibg=#810085
hi User0 guifg=#ffffff guibg=#094afe
####################################################
#### Configuration Examples
####################################################
#### Automatic port knocking example.
Host myserver
User sysop
Host myserver.com
ProxyCommand bash -c '/usr/bin/knock %h 1000 2000 3000 4000; sleep 1; exec /bin/nc %h %p'
# vim: set sw=5 ts=5 sts=5 et tw=100 foldmarker={{,}} foldlevel=0 foldmethod=marker nospell nohl:
# Global options {{
Host *
ControlMaster auto
ControlPath ~/.tmp/control:%h:%p:%r
ServerAliveInterval 300
ServerAliveCountMax 2
StrictHostKeyChecking no
IdentitiesOnly yes
" Doug Black
+-- 5 lines: " Colors -------------------------------------
+-- 5 lines: " Misc ---------------------------------------
+-- 9 lines: " Spaces & Tabs ------------------------------
+-- 8 lines: " UI Layout ----------------------------------
+-- 5 lines: " Searching ----------------------------------
+-- 8 lines: " Folding ------------------------------------
+-- 9 lines: " Line Shortcuts -----------------------------
+-- 21 lines: " Leader Shortcuts ---------------------------
+-- 7 lines: " Powerline ----------------------------------
@mmyers1474
mmyers1474 / set-status-line.sh
Created November 1, 2016 14:43
Set a static, non-scrolling status line somewhere on the display
#!/bin/sh
# usage: no_scroll_line top|bottom 'non-scrolling line content' command to run with args
#
# Set up a non-scrolling line at the top (or the bottom) of the
# terminal, write the given text into it, then (in the scrolling
# region) run the given command with its arguments. When the
# command has finished, pause with a prompt and reset the
# scrolling region.
@mmyers1474
mmyers1474 / vhost_check
Created May 5, 2017 22:56
My VHost Checking Shell Script
#!/bin/bash
#[[ "${HOME}/bin/shelldev.sh" ]] && source "${HOME}/bin/shelldev.sh"
declare -a vhosts
declare noclr=$'\e[39m'
declare runner="........................................";
declare list_hosts="no"
declare hosts_list="no"
declare config_isremote="no"
declare config_host=""
Launcher Shortcuts:
=======
Main Console:
ConEmu64 -Dir %USERPROFILE% -Config MainConsole -Icon .\Tools\msys2-64\msys2.ico -Title "Main Console" -Monitor 1 -Quake -NoSingle -run {MSYS2 Shell}
Target:
"C:\Program Files\ConEmu\ConEmu64.exe" -Config MainConsole -Icon .\Tools\msys2-64\msys2.ico -Title "Main Console" -Monitor 1 -Quake -NoSingle -run {MSYS2 Shell}
Start in: %USERPROFILE%
=======
ssh -D 8123 -f -C -q -N sammy@example.com
Explanation of arguments
-D: Tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025-65536)
-f: Forks the process to the background
-C: Compresses the data before sending it
-T Disable pseudo-tty allocation
-q: Uses quiet mode
-N: Tells SSH that no command will be sent once the tunnel is up
#!/bin/bash
#================================================================
#% SYNOPSIS
#+ ${SCRIPT_NAME} [-hv] [-o[file]] args ...
#%
#% DESCRIPTION
#% This is a script template
#% to start any good shell script.
#%
#% OPTIONS
@mmyers1474
mmyers1474 / script-template.sh
Last active March 22, 2020 09:33
Robust Shell Script Template
#!/bin/bash
#===============================================================================
# HEADER
#==============================================================================
# IMPLEMENTATION
#% name bash_template
#% title Bash Shell Template
#% version 0.0.1
#% checksum 5926ed74eb9baf0dc74b08e2e9be26a0
#% author Matthew Myers