Skip to content

Instantly share code, notes, and snippets.

@eby
eby / README.md
Last active December 2, 2025 15:53
Scriptable Widget to Show Upcoming Tasks from Craft

Scriptable Widget (Large) for Upcoming Tasks from Craft Docs

This requires the latest Craft that supports API/MCP and the Scriptable app on iOS.

Make sure to edit the configuration settings at the top of the script.

Scriptable is not interactive but you can make it so that when you click on it, it opens Craft tasks view.

Edit the widget, choose open url, and enter craftdocs://openAllTasks

@eby
eby / self.nginxconf
Last active February 21, 2020 19:43
Evergreen Selfcheck Login for Nginx
# Presumes workstations have been created
# Set the homepage of the kiosk browser to selfchecks.mylibrary.org/location
server {
listen 443 ssl http2;
server_name selfchecks.mylibrary.org;
include shared/ssl.conf;
location /branch1 {
allow 192.168.1.0/24;
@eby
eby / ansible-fact.sh
Last active April 26, 2024 17:58
Get OS version for an inventory with ad-hoc ansible
# The setup command allows filtering facts
# More info: https://docs.ansible.com/ansible/latest/modules/setup_module.html
# inventory_file = path to inventory file (if not normal role layout)
# host_group = group to query. use all for all hosts
ansible -i inventory_file host_group -m setup -a 'filter=ansible_distribution_version'
# For a Ubuntu Bionic Host the distribution facts look like this:
# "ansible_distribution": "Ubuntu",
# "ansible_distribution_file_parsed": true,
# "ansible_distribution_file_path": "/etc/os-release",
@eby
eby / service-checklist.md
Created September 23, 2016 20:26 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@eby
eby / reboot.sh
Created September 14, 2016 13:10
Force Remote Reboot
# Same result as hard reset via button so use accordingly
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
@eby
eby / hpacucli-check.sh
Created April 5, 2016 15:21
Bash script to check HP Smart Array / drive status in cron
#!/bin/bash
###
# FILE: hpacucli-check.sh (03-Dec-2013)
# LICENSE: GNU/GPL v3.0
# AUTHOR: Olaf Reitmaier Veracierta <[email protected]>
# USAGE: Check the status of the logical drives on a HP Server
# with hpacucli (HP Array Configuration Utility Client)
# installed, syslog and send an email with errors.
##
@eby
eby / docstore.nginx.conf
Last active March 20, 2016 01:27
Docstore Sample Nginx Config
# Redirect all traffic to SSL
server {
listen [::]:80;
listen 80;
server_name docstore.yourdomain.org;
return 301 https://$server_name$request_uri;
}
# SSL Server based off https://cipherli.st/ and H5BP
server {
# Listen on IPv6/4
@eby
eby / nginx-spamhaus-droplist.sh
Last active September 12, 2017 06:31
cron to download and format spamhaus list for nginx - from:http://www.mybbstuff.com/thread-61.html
#!/bin/bash
# A Nginx Shell Script To Block Spamhaus Lasso Drop Spam IP Address
# Run this script once a day and drop all spam network IPs (netblock) with http 403 client error.
# The script will get executed every day via /etc/cron.daily (make sure crond
# is running).
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <http://cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
server {
[...]
## Block SQL injections
set $block_sql_injections 0;
if ($query_string ~ "union.*select.*\(") {
set $block_sql_injections 1;
}
if ($query_string ~ "union.*all.*select.*") {
@eby
eby / keybase.md
Created July 6, 2015 21:43
keybase

Keybase proof

I hereby claim:

  • I am eby on github.
  • I am eby (https://keybase.io/eby) on keybase.
  • I have a public key whose fingerprint is D259 4350 9280 4178 1DF4 371E AA61 9E22 65DC D696

To claim this, I am signing this object: