Skip to content

Instantly share code, notes, and snippets.

@travispaul
travispaul / patch-salt_grains_core.py.patch
Created May 11, 2018 15:45
sysutils/salt/patches/patch-salt_grains_core.py
$NetBSD$
Prevent crash on NetBSD and OpenBSD when no swap is configured.
https://github.com/saltstack/salt/pull/47600
--- salt/grains/core.py.orig 2018-05-11 13:12:38.000000000 +0000
+++ salt/grains/core.py
@@ -450,11 +450,13 @@ def _bsd_memdata(osdata):
mem = __salt__['cmd.run']('{0} -n hw.physmem64'.format(sysctl))
grains['mem_total'] = int(mem) // 1024 // 1024
@travispaul
travispaul / test.sh
Last active August 3, 2019 15:20
Setting a default value for $@ (sh vs dash vs ksh vs bash)
#!/bin/sh
#!/bin/ksh
#!/usr/pkg/bin/dash
#!/usr/pkg/bin/bash
somefn() {
local args="${@:-something}"
echo "Value of \$args: $args"
}
@travispaul
travispaul / cmusfm.diff
Created April 7, 2020 17:43
cmusfm.diff
diff --git a/cmusfm/Makefile b/cmusfm/Makefile
index 91e348ef57..ed103aec35 100644
--- a/cmusfm/Makefile
+++ b/cmusfm/Makefile
@@ -1,31 +1,31 @@
# $NetBSD: Makefile,v 1.1 2014/06/05 21:26:12 leot1990 Exp $
-DISTNAME= cmusfm-0.2.0
+DISTNAME= cmusfm-0.3.3
CATEGORIES= audio
@travispaul
travispaul / provider.tf
Last active May 11, 2022 14:08
Example Terraform configuration using Vultr object store for state backend.
# https://www.vultr.com/docs/vultr-object-storage
terraform {
# Even though this example is using Vultr's object storage, the AWS_ACCESS_KEY
# and AWS_SECRET_ACCESS_KEY environment variables need to be defined.
# The values can be obtained from the object storage page at my.vultr.com
backend "s3" {
bucket = "your-bucket-name-here"
key = "/path/in/bucket/terraform.state"
endpoint = "ewr1.vultrobjects.com"
region = "us-east-1"
@travispaul
travispaul / Response.md
Created February 15, 2024 16:17
HX-Location

The HX-Location response header looks something like this, the response body is empty:

hx-location: {
  "path":"/foo",
  "target":"#main",
  "select":"#content",
  "values": {
    "allowedPaths":["/foo/1"],
 "notification":"Foo 1 has been created"