Skip to content

Instantly share code, notes, and snippets.

@dstapp
dstapp / gist:4d0848a91f0357eb4a3b4af07d0ce1b1
Created March 13, 2020 08:23
shameless hrcloud2 code rip for faux code generator test
<?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/';
@dstapp
dstapp / gogs
Created August 6, 2016 12:13
Gogs FreeBSD rc.d script
#!/bin/sh
#
# PROVIDE: gogs
# REQUIRE: networking syslog
# KEYWORD:
. /etc/rc.subr
name="gogs"
rcvar="gogs_enable"
@dstapp
dstapp / setup_osx.sh
Last active January 11, 2022 23:15
OS X setup script (currently 10.11)
#!/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)"
@dstapp
dstapp / zfs-backup.sh
Created March 28, 2016 18:50
Simple backup script utilizing rsync and ZFS snapshots
#!/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.
@dstapp
dstapp / OwncloudCaddyfile
Last active December 8, 2020 08:43
Caddy ownCloud Gist
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
@dstapp
dstapp / caddy
Last active December 27, 2019 21:41
FreeBSD Caddy init script
#!/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
@dstapp
dstapp / download_podcasts.sh
Created January 1, 2016 16:35
A bash script for automatically downloading new podcast episodes and pretty-printing new files. Works on Linux and BSD/OS X
#!/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)