This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* (C) Copyright 2015 A.B. Carroll <[email protected]>. MIT or BSD License - your choice. | |
*/ | |
class Utility { | |
/** | |
* Converts either a array of integers or string of comma-separated integers to a natural english range, such as "1,2,3,5" to "1-3, 5". It also supports |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Written by A.B. Carroll <[email protected]> | |
# Use as: | |
# sleepcountdown HOUR MIN SEC "Optional Prefix" | |
# Example: | |
# sleepcountdown 00 00 10 "Time until next run: " | |
# echo "Done with first countdown!" | |
# sleepcountdown 01 00 05 "Time until next run: " | |
# echo "Done with second countdown!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
countsheep(){ | |
hr=$1 | |
min=$2 | |
sec=$3 | |
if [ -z "$4" ] | |
then | |
prefix="" | |
else | |
prefix="$4" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// A.B. Carroll, <[email protected]> | |
// "Do whatever the fuck you want license" | |
// Generates a 'statistics chunk' for use in pronounceable word generation | |
// It's a one-time generation, so it doesn't need to be fast. | |
$file = file('/usr/share/dict/american-english'); | |
$patterns = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# rtunnel-auto: (C) Copyright 2014-2015 A.B. Carroll <[email protected]> | |
# | |
# On the remote server | |
# AllowTcpForwarding must be configured in order for tunneling to work. | |
# If LOCAL_HOST is an IP address that is local to the server this script | |
# is running on, it can be set to either 'yes' or 'local'. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Beginnger | |
sudo apt-get install vim netselect-apt | |
# Basics | |
sudo apache2-utils autossh bc beep btrfs-tools cryptsetup curl dnsutils dos2unix e2fsprogs file ftp git hexedit hfsprogs htop iftop iotop iptraf less links lrzsz lvm2 md5deep mercurial nmap ntp parted patch pax putty-tools pv rsync screen sudo sysstat tmux tree vim wget whois xz-utils | |
# Paritioning, File System & FS Encryption | |
sudo apt-get install lvm2 cryptsetup e2fsprogs hfsprogs btrfs-tools | |
# Monitoring |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
packages=( | |
# > > System utilities | |
netselect-apt sudo rcconf parted | |
# > > Internet Services, Programming | |
nginx | |
php5-fpm php5-cli | |
mysql-server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* A.B. Carroll, public domain */ | |
function str_distance_array($needle, $haystack) { | |
$confidence_map = []; | |
foreach ($haystack as $h) { | |
if(strlen($needle) < strlen($h)) { | |
$normalize = strlen($needle); | |
} else { | |
$normalize = strlen($h); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This clears the LESS.js cache, since it aggressively caches @import statements. | |
* Credit: Attaboy, https://gist.github.com/attaboy/1346280 | |
* Additional key checks and debugging output by A.B. Carroll. (http://github.com/nezzario) | |
* License: Assumed MIT/BSD-like license, please give credit where credit is due. | |
*/ | |
less.env = 'development'; | |
console.log("If you are seeing this in a production environment you are likely doing something wrong or forgot to remove the destroyLessCache() script."); |