Skip to content

Instantly share code, notes, and snippets.

@devnall
devnall / newscript.sh
Created February 9, 2021 01:59 — forked from aaronNGi/newscript.sh
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts
@devnall
devnall / Makefile
Last active February 4, 2020 16:46
Makefile `help` boilerplate
.DEFAULT_GOAL:=help
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
TARGET_MAX_CHAR_NUM=20
@devnall
devnall / svimrc
Last active October 24, 2018 15:53
Config for Safari sVim extension
" Settings
let newtaburl = "https://www.duckduckgo.com/";
let homeurl = "https://www.duckduckgo.com/";
map "shift+d" scrollHalfPageDown
map "shift+u" scrollHalfPageUp
let blacklists = ["*://mail.google.com/*"]
" Unmap defaults
unmap "e"
unmap "shift+e"
@devnall
devnall / cvim.rc
Last active November 14, 2018 15:58
cVim config
set smoothscroll
set completeonopen
set linkanimations
set defaultnewtabpage
set noautofocus
let defaultengine = "duckduckgo"
let blacklists = ["*://mail.google.com/*","*://*.feedly.com/*","*://*.youtube.com/*","*://*.rememberthemilk.com/*","*://*.inputclub.com/*","*://*.trello.com/*","http://localhost/*","https://hackertyper.net/*"]
@devnall
devnall / keybase_verify
Created November 3, 2016 20:36
Verifying my keybase.io identity
### Keybase proof
I hereby claim:
* I am devnall on github.
* I am devnall (https://keybase.io/devnall) on keybase.
* I have a public key whose fingerprint is 664F 4475 61D7 139C 74A7 8B93 B0F1 C8FC C791 E64A
To claim this, I am signing this object:
@devnall
devnall / default.kbd.json
Last active October 21, 2016 07:42
Default layer for my Infinity Ergodox keymap
[
[
{
"x": 3.5,
"c": "#53682b",
"t": "#ffffff"
},
"#\n3",
{
"x": 10.5
In reply to @ZachWeiner's "If lightning never strikes in the same place, how long until lightning can’t strike anywhere?"
Lightning bolt diameter is roughly that of a quarter or half dollar <http://www.stormwise.com/striking.htm>
Quarter diameter = 462.2mm^2
Half dollar diameter = 735.9mm^2
Averaged diameter of the two = 599.05mm^2
Earth surface area (per Wolfram Alpha) = 2.6e41mm^2
Lightning strikes the earth at a rate of roughly 100 times/sec <http://www.ask.com/science/many-times-per-day-lightning-strike-earth-66d5e236ffaa2aca>
@devnall
devnall / yrpriority.sh
Created May 25, 2014 21:33
Yum Repo Priorities
#!/bin/bash
# A one-liner to display the priority values of the repos on a RHEL/CentOS box
# Assumes installation of the Priorities plugin for yum (see http://wiki.centos.org/PackageManagement/Yum/Priorities)
sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo|sort -k3n
@devnall
devnall / gist:6581047
Created September 16, 2013 13:59
Top 50 404's in access_log in descending order.
zcat access_log*.gz | cat access_log - | awk '$9 == "404" {print $7}' |sort|uniq -c|sort -rn| head -n 50
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.19370138645172119</real>
<key>Green Component</key>
<real>0.15575926005840302</real>