Skip to content

Instantly share code, notes, and snippets.

View DrSpeedy's full-sized avatar

DrSpeedy

  • United States
  • 08:55 (UTC -05:00)
View GitHub Profile
@DrSpeedy
DrSpeedy / weather.zsh
Created September 19, 2016 08:42
Get weather from the command line
#!/bin/zsh
# Simple function to get weather from command line via curl
# To use either add to zshrc/bashrc, or run the command `source weather.zsh`
export LOC="kalamazoo"
# If no location is provided, weather for $LOC will be returned
function wthr() {
if [ -z "$1" ]; then
echo "$(curl -silent wttr.in/$LOC)"
@DrSpeedy
DrSpeedy / fulgur.md
Created January 30, 2018 05:09
Fulgur Workstation basic rundown

Fulgur Workstation

Maintainer: Brian Wilson doc@wiltech.org

GIT: ssh://git@bitbucket.org:wiltech/fulgur.git

======

Introduction:

Fulgur Workstation is a light-weight highly configurable workstation platform for software and networking development.

Top Level Features:

@DrSpeedy
DrSpeedy / oceanic-next-alphabg.patch
Created April 1, 2018 15:33
OceanicNext vim theme transparent background patch
diff --git a/colors/OceanicNext.vim b/colors/OceanicNext.vim
index 1c496b2..cda25f9 100644
--- a/colors/OceanicNext.vim
+++ b/colors/OceanicNext.vim
@@ -53,10 +53,10 @@ function! <sid>hi(group, fg, bg, attr, attrsp)
exec "hi " . a:group . " guifg=" . a:fg[0]
exec "hi " . a:group . " ctermfg=" . a:fg[1]
endif
- if !empty(a:bg)
- exec "hi " . a:group . " guibg=" . a:bg[0]
@DrSpeedy
DrSpeedy / bash_dialog.conf
Last active April 14, 2018 00:56
Run-time configuration file for bash dialog
#
# Run-time configuration file for bash dialog
# Path: /etc/dialogrc
#
# Types of values:
#
# Number - <number>
# String - "string"
# Boolean - <ON|OFF>
# Attribute - (foreground,background,highlight?)
@DrSpeedy
DrSpeedy / compton.conf
Created April 14, 2018 01:09
Compton configuration based in i3wm with nouavue on Arch Linux
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "xrender";
@DrSpeedy
DrSpeedy / .zshrc
Last active April 21, 2018 10:24
Automatically change working directories in NeoVim via the terminal
# This function calls the script below when loaded by
# the shell inside of neovim. It must be placed somewhere in
# your default shell's rc file e.g. ~/.zshrc
neovim_autocd() {
[[ $NVIM_LISTEN_ADDRESS ]] && neovim-autocd.py
}
chpwd_functions+=( neovim_autocd )
if [ "$USER" = "root" ]; then CARETCOLOR="red"; else CARETCOLOR="yellow"; fi
local return_code="%(?..%{$fg_bold[red]%}:( %?%{$reset_color%})"
PROMPT='
[ %{$fg_bold[orange]%}%n%{$reset_color%}@%{$reset_color%}%{$fg_bold[red]%}%m%{$reset_color%} ]:%{${fg_bold[green]}%}%~%{$reset_color%}$(git_prompt_info)
%{${fg[$CARETCOLOR]}%}➜ %{${reset_color}%}'
RPS1='${return_code} %D - %*'

BASH CHEAT SHEET

Text processing

# Read file without empty lines and new line comments with grep
grep -v '^$\|^\s*\#' /path/to/file.txt
# Read file without empty lines, or any comments even on shared lines
@DrSpeedy
DrSpeedy / unifi-test.cmd
Created May 17, 2021 12:29
Automated Iperf3 Testing For Unifi APs
@echo off
set ui_ctrlr_count=1
set iperf_server_ip="10.42.0.1"
set iperf_server_port=5201
set iperf_server_threads=1
set iperf_server_window_size=64k
for /L %%A in (1,1,%ui_ctrlr_count%) do (
@DrSpeedy
DrSpeedy / superrun.lua
Last active July 30, 2022 13:16
GTAV: Stand Menu Better Super Run
-- DrSpeedy#1852
require 'lib/natives-1627063482'
local srun_enabled = false
local keys = {}
keys['RB'] = 183
menu.toggle(menu.my_root(), 'Super Run', {'srun_enabled'}, '', function(toggle)
srun_enabled = toggle
local is_super_running = false