Skip to content

Instantly share code, notes, and snippets.

@dprandzioch
dprandzioch / zfs-backup.sh
Created Mar 28, 2016
Simple backup script utilizing rsync and ZFS snapshots
View zfs-backup.sh
#!/usr/bin/env bash
#
# zfs-backup.sh
#
# Simple backup script utilizing rsync and ZFS snapshots.
#
# rsync must be installed both on the server and the client.
# ssh must be installed on the client.
# bash must be installed on the server.
@dprandzioch
dprandzioch / OwncloudCaddyfile
Last active Dec 8, 2020
Caddy ownCloud Gist
View OwncloudCaddyfile
owncloud.dev.local:80 {
root /usr/local/www/owncloud/
fastcgi / 127.0.0.1:9000 php
rewrite {
regexp /index.php/.*
to /index.php?{query}
}
log /usr/local/www/owncloud.log
@dprandzioch
dprandzioch / setup_osx.sh
Last active Sep 26, 2020
OS X setup script (currently 10.11)
View setup_osx.sh
#!/bin/bash
# Homebrew requires Xcode CLI tools to be installed. OS X provides stubs for CLI tools
# that trigger the CLI tools installer when called. So we call `git` to start the installation.
git
echo "Press any key when Xcode CLI tools installation is complete..."
read
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@dprandzioch
dprandzioch / download_podcasts.sh
Created Jan 1, 2016
A bash script for automatically downloading new podcast episodes and pretty-printing new files. Works on Linux and BSD/OS X
View download_podcasts.sh
#!/usr/bin/env bash
# The following script parses podcast feeds and downloads all podcast episodes listed in
# the feed if they don't exist within the target path. The target directory will be created
# if it does not exist.
[ -x "$(command -v wget)" ] || (echo "wget is not installed" && exit 1)
[ -x "$(command -v sed)" ] || (echo "sed is not installed" && exit 1)
[ -x "$(command -v xargs)" ] || (echo "xargs is not installed" && exit 1)
@dprandzioch
dprandzioch / gist:4d0848a91f0357eb4a3b4af07d0ce1b1
Created Mar 13, 2020
shameless hrcloud2 code rip for faux code generator test
View gist:4d0848a91f0357eb4a3b4af07d0ce1b1
<?php
// / -----------------------------------------------------------------------------------
// / The follwoing code checks for required core files and terminates if they are missing.
if (!file_exists(realpath(dirname(__FILE__)).'/securityCore.php')) die ('<body>ERROR!!! HRC2AppCore21, Cannot process the HRCloud2 Security Core file (securityCore.php).'.PHP_EOL.'</body></html>');
else require_once (realpath(dirname(__FILE__)).'/securityCore.php');
// / -----------------------------------------------------------------------------------
// / -----------------------------------------------------------------------------------
// / The following code sets the global variables for the session.
$AppDir = $InstLoc.'/Applications/';
@dprandzioch
dprandzioch / caddy
Last active Dec 27, 2019
FreeBSD Caddy init script
View caddy
#!/bin/sh
#
# PROVIDE: caddy
# REQUIRE: networking
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable caddy:
# caddy_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable caddy
@dprandzioch
dprandzioch / gogs
Created Aug 6, 2016
Gogs FreeBSD rc.d script
View gogs
#!/bin/sh
#
# PROVIDE: gogs
# REQUIRE: networking syslog
# KEYWORD:
. /etc/rc.subr
name="gogs"
rcvar="gogs_enable"