Skip to content

Instantly share code, notes, and snippets.

@commonquail
commonquail / find-skip-vcs-directories.md
Last active August 31, 2015 11:52
Skip VCS directories with find

This command recursively finds every file matching the glob pattern *.* (name.extension) in the working directory, excluding child directories whose names start with ..

This is useful for skipping various VCS directories, for instance.

find . -type d -path './.*' -prune -o -type f -name '*.*' -print
@commonquail
commonquail / mdpp.md
Last active August 28, 2015 04:38
Idea for a Markdown preprocessor

Idea for a Markdown preprocessor

Feature master list:

  • Table of contents
    • {{toc}}?
    • ATX headers
    • two-pass processing for consistent stream
    • Ignore # in code blocks, quotes
  • File transclusion
@commonquail
commonquail / driver-irql-not-less-or-equal.md
Last active May 20, 2017 13:46
Troubleshooting DRIVER_IRQL_NOT_LESS_OR_EQUAL(L1C63x64.sys) on Windows 10

DRIVER_IRQL_NOT_LESS_OR_EQUAL is a famous Blue Screen of Death error, often caused by a bad driver somewhere. The Internet is awash with reports of variants of this error.

This particular variant, L1C63x64.sys, was an occasional occurrence for me on Windows 7, but seemingly only while torrenting.

Upgrading to Windows 10 turned the error from occasional to frequent within the first few days,

The following command generates a 20 character password from all visible ASCII characters (94) except '"|\ (90), which are problematic in some contexts, like embedding in (unversioned) source code, for approximately [128 bits of entropy (9020 = 1.22e+39)][math]:

$ < /dev/urandom tr -dc [:graph:] | tr -d \|\\\'\\\\\" | head -c20 | xsel --clipboard 
@commonquail
commonquail / lso.sh
Created August 4, 2015 12:06
List human readable and octal file permissions for the specified file or files in the current directory
#!/bin/sh
# Lists human readable and octal file permissions for the specified files.
# If no files are specified, lso is invoked for all files in the current
# directory.
arg="$@"
[ "$arg" = '' ] && arg="*"
stat -c '%A %a %n' $arg
@commonquail
commonquail / spot.sh
Created August 4, 2015 12:02
Start Spotify and Blockify from the command line if either is not running
#!/bin/bash
set -o errexit
if ! ps -e | grep -q spotify
then
spotify > /dev/null 2>&1 &
fi
if ! ps -e | grep -q blockify-ui
@commonquail
commonquail / commit-msg-stats.sh
Created August 4, 2015 12:01
Very simple commit message stats
#!/bin/bash
set -o errexit
set -o nounset
[[ $# -eq 1 ]] || {
echo "usage: $0 <author>"
exit 1
}
@commonquail
commonquail / README.md
Last active August 29, 2015 14:24
Notes for filtering IPVanish servers

Server list at https://www.ipvanish.com/api/servers.geojson

No CORS. Copy the JavaScript functions below into the console and confirm. Copy all the (JSON) output in the browser window into the console, into a variable named e.g. everything. Copy the final line, then play arround with the all array.

@commonquail
commonquail / git-restore-branches.sh
Created April 29, 2015 08:13
Restores the branchnames of all merged branches between two revisions
#!/bin/bash
#
# Restores the branchnames of all merged branches
# between two revisions,
# and prints them to stdout.
#
# If the end revision is omitted it defaults to HEAD.
#
# If a branchname already exists,
# it is not moved,