Skip to content

Instantly share code, notes, and snippets.

View dsgnr's full-sized avatar

Dan Hand dsgnr

View GitHub Profile
@dsgnr
dsgnr / varnish.vcl
Last active November 3, 2016 05:44
backend default {
.host = "public-IP";
.port = "port-number";
}
acl purge { "localhost"; "127.0.0.1"; "public-IP";}
sub vcl_recv {
<?php
//* Custom Gravatar
function be_custom_avatar_field( $user ) { ?>
<h3>Custom Avatar</h3>
<table>
<tr>
<th><label for="be_custom_avatar">Custom Avatar URL:</label></th>
<td>
@dsgnr
dsgnr / foreach
Created September 1, 2016 20:38
foreach (dirname((__FILE__)) as $filename) {
$path = plugin_dir_pathdirname(dirname(__FILE__)) . 'includes/partials/' . $filename;
if (is_file($path)) {
require $path;
}
}
@dsgnr
dsgnr / wp.sh
Created September 4, 2016 08:23 — forked from phlbnks/wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@dsgnr
dsgnr / upgrade_unifi.sh
Created September 29, 2016 14:11 — forked from stevejenkins/upgrade_unifi.sh
Easy UniFi Controller Upgrade Script for Unix/Linux Systems
#!/bin/sh
# upgrade_unifi.sh
# Easy UniFi Controller Upgrade Script for Unix/Linux Systems
# by Steve Jenkins (stevejenkins.com)
# Version 2.0
# Last Updated July 2, 2016
# REQUIREMENTS
# 1) Assumes you already have any version of UniFi Controller installed
@dsgnr
dsgnr / 0_reuse_code.js
Created January 19, 2017 20:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: dantest
labels: &Labels
app: dantest
spec:
replicas: 1
selector:
@dsgnr
dsgnr / keystroke_clipboard.applescript
Created June 15, 2022 04:27
Type clipboard as keystroke
tell application "System Events"
delay 2
keystroke (the clipboard as text)
end tell
#!/bin/bash
# Configuration Variables
threshold=300 # 5 minutes in seconds.. anything below that means user connected, anything above means disconnected.
connection_info_file=/var/log/wireguard/connected_clients.info
log_file=/var/log/wireguard/wireguard.log
slack_notify=yes
SLACK_CHANNEL="#channel"
SLACK_USERNAME="WireGuard"
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/api_token"