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
/* | |
setxattrs - bubbaATbubba.org | |
Properly sets sparse bundle extended attributes lost when rsyncing | |
sparse bundle data to a platform that does not support extended | |
attributes. This is only need when restoring/retrieving the | |
bundle. | |
To use, sync/copy all bundle files, then run this tool on the | |
sparse bundle: |
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
--- libhttpd.c 2014-12-10 12:53:07.000000000 -0800 | |
+++ libhttpd.c.patched 2015-02-07 22:44:59.183663432 -0800 | |
@@ -2231,6 +2231,12 @@ | |
if ( strcasecmp( cp, "keep-alive" ) == 0 ) | |
hc->keep_alive = 1; | |
} | |
+ else if ( strncasecmp( buf, "X-Forwarded-For:", 16 ) == 0 ) | |
+ { // Use real IP if available | |
+ cp = &buf[16]; | |
+ cp += strspn( cp, " \t" ); |
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
#include <netdb.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <errno.h> | |
#define CANARY "in_the_coal_mine" | |
struct { | |
char buffer[1024]; |
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
# To set the same options for a block of harddisks, do so with something | |
# like the following example options: | |
# harddisks="/dev/hda /dev/hdb" | |
# hdparm_opts="-d1 -X66" | |
# This is run before the configuration in hdparm.conf. Do not use | |
# this arrangement if you need modules loaded for your hard disks, | |
# or need udev to create the nodes, or have some other local quirk | |
# These are better addressed with the options in /etc/hdparm.conf | |
# |
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 | |
# by Dennis Williamson | |
# 2010-10-06, revised 2010-11-10 | |
# for http://stackoverflow.com/questions/3869072/test-for-non-zero-length-string-in-bash-n-var-or-var | |
# designed to fit an 80 character terminal | |
dw=5 # description column width | |
w=6 # table column width | |
t () { printf "%-${w}s" "true"; } |
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
function npr() { | |
# Usage: npr | |
# autoplays NPR radio stream | |
local day="$(date '+%A')" | |
local date="$(date '+%m-%d-%Y')" | |
case ${day} in | |
Sunday) | |
local program='10' | |
;; |
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/sh | |
# | |
# Originally found here: http://jenders.vox.com/library/post/macports-workaround-for-installing-distcc-31-on-an-intel-mac.html | |
# | |
makefile=/opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/distcc/work/distcc-3.1/Makefile | |
if test -e $makefile; then # user has a half completed installation | |
break |
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
# Allow read-only ZoL commands to be called through sudo without a password. | |
# Cmnd alias specification | |
Cmnd_Alias RO_ZFS = \ | |
/sbin/zfs "", /sbin/zfs help *, \ | |
/sbin/zfs get, /sbin/zfs get *, \ | |
/sbin/zfs list, /sbin/zfs list *, \ | |
/sbin/zpool "", /sbin/zpool help *, \ | |
/sbin/zpool iostat, /sbin/zpool iostat *, \ | |
/sbin/zpool list, /sbin/zpool list *, \ |
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 file sets apt configuration variables for /etc/cron.daily/apt | |
// Values here are the default | |
// RootDir for all configuration files | |
// Dir "/"; | |
// Set apt package cache directory | |
// Dir::Cache "var/cache/apt/"; | |
// Set package archive directory |
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 | |
# Cron every 10 minutes: | |
# 0,10,20,30,40,50 * * * * /usr/local/sbin/ddns-update | |
# | |
# For logging: | |
# $ mkdir /var/log/ddns-update | |
# $ cat << EOF > /etc/logrotate.d/ddns-update | |
# /var/log/ddns-update.log { | |
# rotate 3 |