Skip to content

Instantly share code, notes, and snippets.

@kenny-evitt
kenny-evitt / dnsmasq-commands
Created February 4, 2015 02:11
dnsmasq commands
# List DHCP leases
cat /var/lib/misc/dnsmasq.leases
@kenny-evitt
kenny-evitt / find-command-examples
Last active April 12, 2017 21:00
`find` command examples
# Find all files ending with ".swp"
find . -name \*.swp -type f
# Find all files ending with ".swp" and delete them
find . -name \*.swp -type f -delete
# Find all files, not in hidden directory, that contain the pattern "TRANDESCID" and also any of the patterns "41", "42", "45", and "50"
find . -not -path '*/\.*' -type f -exec grep -iq TRANDESCID {} \; -exec grep -il -e 41 -e 42 -e 45 -e 50 {} \;
@kenny-evitt
kenny-evitt / zfs-commands
Last active August 29, 2015 14:13
ZFS commands
# List snapshots
sudo zfs list -t snapshot
# List differences since snapshot
sudo zfs diff snapshot snapshot_or_filesystem_or_pool
# Send+receive an incremental stream between two snapshots
sudo sh -c 'zfs send -i tank1@snapshot2 tank1@snapshot3 | zfs receive tank2'
@kenny-evitt
kenny-evitt / run-git-command-for-all-repos.sh
Created December 1, 2014 20:26
Run Git command for all repositories in a directory
#!/bin/sh
if [ ! "$1" = "" ] ; then
if [ "$GITREPO" = "" -a -d "/c/@Kiln" ] ; then
GITREPO="/c/@Kiln"
fi
if [ "$GITREPO" != "" ] ; then
echo "Git repositories found in $GITREPO"
@kenny-evitt
kenny-evitt / user.keymap
Last active September 30, 2015 21:15
Light Table user keymap
;; User keymap
;; -----------------------------
;; Keymaps are stored as a set of diffs that are merged together together
;; to create the final set of keys. You can modify these diffs to either add
;; or subtract bindings.
;;
;; Like behaviors, keys are bound by tag. When objects with those tags are active
;; the key bindings are live. Keys can be bound to any number of Light Table commands,
;; allowing you the flexibility to execute multiple operations together. To see a list
;; of all the commands you can execute, start typing a word related to the thing you
@kenny-evitt
kenny-evitt / HTML5 boilerplate
Last active July 7, 2018 16:36
HTML5 boilerplate, HTML skeleton
<!-- Adopted from The real HTML5 boilerplate – CSS Wizardry – CSS, OOCSS, front-end architecture, performance and more, by Harry Roberts at http://csswizardry.com/2011/01/the-real-html5-boilerplate/ -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title></title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
@kenny-evitt
kenny-evitt / C# class equality operators and methods
Created August 27, 2014 13:34
Template for simple equality implementation for C# classes
// Public operators
public static bool operator ==(SomeClass item1, SomeClass item2)
{
if (System.Object.ReferenceEquals(item1, item2))
return true;
if (((object)item1 == null) || ((object)item2 == null))
return false;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Solarized Colors</title>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body id="home">
@kenny-evitt
kenny-evitt / simple-html-table.html
Last active May 9, 2016 17:18
Simple in-line-styled HTML table
<!-- Styles adapted from http://purecss.io/tables/ -->
<table style="border-collapse: collapse; border-spacing: 0; empty-cells: show; border: 1px solid #cbcbcb; line-height: 1.5;">
<thead style="background: #e0e0e0; color: #000; text-align: left; vertical-align: bottom;">
<tr>
<th style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Data value
</th>
<th style="border-left: 1px solid #cbcbcb; border-width: 0 0 0 1px; font-size: inherit; margin: 0; overflow: visible; border-left-width: 0;">
Description
@kenny-evitt
kenny-evitt / PowerShell-commands.ps1
Last active August 29, 2015 14:02
PowerShell commands
# Prepend 'f ' to all of the files in the current directory with a '.jpg' extension.
Dir *.jpg | Rename-Item -NewName { "f " + $_.Name }
# Prepend 'f ' to all of the files in the current directory with a '.gif' or '.jpg' extension.
Get-ChildItem .\* -Include *.gif, *.jpg | Rename-Item -NewName { "f " + $_.Name }