Skip to content

Instantly share code, notes, and snippets.

@digitalsanity
digitalsanity / exa-wrapper.sh
Created March 25, 2021 16:01 — forked from eggbean/eza-wrapper.sh
Wrapper script for exa to give it nearly identical switches and appearance to ls. Also automatically adds --git switch when in a git repository.
#!/bin/bash
help() {
cat << EOF
Options:
-1 one file per line
-k bytes
-F classify
-R recurse
-r reverse
@digitalsanity
digitalsanity / mautic.dev.conf (Mautic Nginx Configuration)
Created January 26, 2021 06:16 — forked from joglomedia/mautic.dev.conf (Mautic Nginx Configuration)
Mautic Nginx Config (Install using Simple LNMP Installer - https://github.com/joglomedia/deploy) - Open Source Marketing Automation
server {
listen 80;
#listen [::]:80 default_server ipv6only=on;
## Make site accessible from world web.
server_name mautic.dev www.mautic.dev *.mautic.dev;
## Log Settings.
access_log /var/log/nginx/mautic.dev_access.log;
error_log /var/log/nginx/mautic.dev_error.log error;
@digitalsanity
digitalsanity / setup.sh
Created January 4, 2021 22:00 — forked from MakiseKurisu/setup.sh
Proxmox VE 6 GPU Passthrough
#!/bin/bash
# Reference guides:
# https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
# https://pve.proxmox.com/wiki/Pci_passthrough
# https://pve.proxmox.com/wiki/Nested_Virtualization
# Remember to turn on SVM in BIOS and disable CSM
# Update packages
@digitalsanity
digitalsanity / example.js
Created March 29, 2020 19:02 — forked from esjewett/example.js
Example of Reductio/Crossfilter moving average w/ efficient Date calculations for larger data set
// This example data set (not provided) is over 100,000 records. The following code calculates 30-day moving
// averages (over 3 million aggregations) using Crossfilter and the Reductio helper library. It takes about
// 3 seconds for the initial aggregation in Chrome Canary (42.0.2291.0) on a 2.3 GHz Core i7, mid-2012 rMBP.
d3.csv('dataJan-29-2015.csv', function (data) {
//convert the iso timestamps to JS Dates
var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse;
var ymd = d3.time.format("%Y-%m-%d");
data.forEach(function(d) {
@digitalsanity
digitalsanity / wordpress.nginx
Created October 27, 2019 18:56 — forked from LeCoupa/wordpress.nginx
WordPress - Nginx Configuration File (with SSL) --> https://github.com/LeCoupa/awesome-cheatsheets
##
# @server studio
# @host hackisition.com
# @desc nginx host rules
# @author Julien Le Coupanec <julien@gentlenode.com>
##
# HTTP Server
server {
listen 80;
@digitalsanity
digitalsanity / htpc-docker-compose.yml
Created October 12, 2019 19:39
docker-compose for x86_64
version: "3.6"
services:
mariadb:
image: "linuxserver/mariadb"
container_name: "mariadb"
hostname: mariadb
volumes:
- ${USERDIR}/docker/mariadb:/config
ports:
#!/bin/bash
#
# usage update-blacklist.sh <configuration file>
# eg: update-blacklist.sh /etc/ipset-blacklist/ipset-blacklist.conf
#
if [[ -z "$1" ]]; then
echo "Error: please specify a configuration file, e.g. $0 /etc/ipset-blacklist/ipset-blacklist.conf"
exit 1
fi
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
13 2 * * * root /usr/local/sbin/update-blacklist.sh /etc/ipset-blacklist/ipset-blacklist.conf
IPSET_BLACKLIST_NAME=blacklist # change it if it collides with a pre-existing ipset list
IPSET_TMP_BLACKLIST_NAME=${IPSET_BLACKLIST_NAME}-tmp
# ensure the directory for IP_BLACKLIST/IP_BLACKLIST_RESTORE exists (it won't be created automatically)
IP_BLACKLIST_RESTORE=/etc/ipset-blacklist/ip-blacklist.restore
IP_BLACKLIST=/etc/ipset-blacklist/ip-blacklist.list
VERBOSE=yes # probably set to "no" for cron jobs, default to yes
FORCE=yes # will create the ipset-iptable binding if it does not already exist
let IPTABLES_IPSET_RULE_NUMBER=1 # if FORCE is yes, the number at which place insert the ipset-match rule (default to 1)
gpio-keys {
> + compatible = "gpio-keys";
> + #address-cells = <1>;
> + #size-cells = <0>;
#address-cells and #size-cells aren't necessary here.
> + autorepeat;
> +
> + pinctrl-names = "default";