Skip to content

Instantly share code, notes, and snippets.

View mmyers1474's full-sized avatar

Matthew Myers mmyers1474

View GitHub Profile
config_host: If present the apache virtual host configuration files will be read from a remote server rather than a local path.
config_path: Specifies the path to the folder containing the apache virtual host configuration files.
dump_urls: Reads apache virtual host configuration files and outputs a list of browser compatible urls.
test_urls: Reads a list of browser compatible urls like produced by dump_urls from a file and tests them.
use_proxy: Flag indicating if we want to use a proxy server or not.
proxy_url: The URL for the proxy to use.
@mmyers1474
mmyers1474 / gist:27486a410ff03909db11b995ccf2f71e
Created July 24, 2017 02:41
Colors and Cursor Movements
Specific tput sub-commands are discussed later.
Direct
Call tput as part of a sequence of commands:
tput setaf 1; echo "this is red text"
Use ; instead of && so if tput errors the text still shows.
Shell variables
@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
#!/bin/bash
#================================================================
#% SYNOPSIS
#+ ${SCRIPT_NAME} [-hv] [-o[file]] args ...
#%
#% DESCRIPTION
#% This is a script template
#% to start any good shell script.
#%
#% OPTIONS
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
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%
=======
@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=""
@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.
" 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 ----------------------------------
# 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