Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jasonrm's full-sized avatar

Jason R. McNeil jasonrm

  • Arizona
  • 06:31 (UTC -07:00)
View GitHub Profile
@jasonrm
jasonrm / salt.md
Last active November 10, 2023 00:58

Salt States

top.sls

base:
  'os:MacOS':
    - match: grain
    - homebrew
  '*':
    - nginx
@jasonrm
jasonrm / nomad-template.hcl
Created October 23, 2023 06:41
Nomad Template Block For Setting All Environment Variables From Nomad Variables
# Ref: https://developer.hashicorp.com/nomad/docs/job-specification/template#nomad-integration
# Ref: https://discuss.hashicorp.com/t/templates-how-to-access-tuple-key-value/53875
job "php" {
# ...
group "php" {
# ...
@jasonrm
jasonrm / gist:b409008ea69dc6b0f121161b87978333
Created January 25, 2019 22:14
Edgerouter traffic-control advanced-queue
set traffic-control advanced-queue queue-type hfq HFQ_UP_LAN host-identifier sip
set traffic-control advanced-queue queue-type hfq HFQ_UP_LAN max-rate 3mbit
set traffic-control advanced-queue queue-type hfq HFQ_UP_LAN subnet 10.76.32.0/24
set traffic-control advanced-queue queue-type hfq HFQ_UP_WIFI host-identifier sip
set traffic-control advanced-queue queue-type hfq HFQ_UP_WIFI max-rate 3mbit
set traffic-control advanced-queue queue-type hfq HFQ_UP_WIFI subnet 10.76.33.0/24
set traffic-control advanced-queue queue-type hfq HFQ_DOWN_LAN host-identifier dip
set traffic-control advanced-queue queue-type hfq HFQ_DOWN_LAN max-rate 3mbit
set traffic-control advanced-queue queue-type hfq HFQ_DOWN_LAN subnet 10.76.32.0/24
@jasonrm
jasonrm / 01-with-traffic-control.md
Last active April 16, 2023 05:19
EdgeRouter Lite 3-Port max-throughput with a single root queue

EdgeRouter

ubnt@ubnt:~$ show version
Version:      v1.9.7+hotfix.3
Build ID:     5013619
Build on:     08/30/17 02:42
Copyright:    2012-2017 Ubiquiti Networks, Inc.
HW model:     EdgeRouter Lite 3-Port
Uptime:       00:49:12 up 49 min,  1 user,  load average: 0.36, 0.52, 0.29
@jasonrm
jasonrm / common.liquidsoap
Last active November 12, 2022 04:28
For use with trunk-recorder & liquidsoap
set("tag.encodings",["UTF-8","ISO-8859-1"])
# Configure Logging
set("log.file",false)
set("log.level",3)
set("log.stdout",true)
set("log.syslog",false)
set("log.syslog.facility","DAEMON")
set("log.syslog.program","liquidsoap-#{STREAMID}")
@jasonrm
jasonrm / reenable.sh
Last active March 13, 2022 17:13
Dell PowerEdge DRAC 5 KVM
# Original : http://en.community.dell.com/support-forums/servers/f/956/t/18394689
# Archive : http://archive.is/8LkJs
I was also facing this issue, but had to jump some more hurdles:
- In the Java Control Panel, add https://<server IP/hostname> to the exception site list. (not related to this issue, but needs to be done though)
- In the Advanced tab (this is on windows) enable the console, so I could check what java version was being used. (I have 5 versions installed)
- Edit the mentioned java.security for the correct version, but, I had to make an additional change. I also had to alter the "jdk.certpath.disabledAlgorithms" parameter, and remove MD5 there. Hence, enable MD5 support.
@jasonrm
jasonrm / md12xx-ses.patch
Last active May 12, 2021 21:52
Force Dell MD1200 / MD1220 enclosures as SES-enabled, e.g. /sys/class/enclosure/
From f9e8eaf3226009531b769635a6114f87da08291b Mon Sep 17 00:00:00 2001
From: "Jason R. McNeil" <jason@mcneil.dev>
Date: Wed, 12 May 2021 01:16:35 -0700
Subject: [PATCH] drivers/scsi/ses: Dell MD12XX enclosures support SES, despite
EncServ=0 as claimed by the device
---
drivers/scsi/ses.c | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
@jasonrm
jasonrm / flip.php
Created September 8, 2019 04:13
Filp a random bit in a string with PHP
<?php
function flip_random_bit(string $str)
{
$charIndex = random_int(0, strlen($str) - 1);
$bitIndex = random_int(0, 8);
$str[$charIndex] = chr(ord($str[$charIndex]) ^ 1 << $bitIndex);
return $str;
}
@jasonrm
jasonrm / default.nix
Last active August 18, 2019 00:42
shell.nix for running jupyter lab
{
pkgs ? import <nixpkgs> { },
}:
with pkgs;
python3.buildEnv.override {
ignoreCollisions = true;
extraLibs = with python3Packages; [
pip
ipykernel
jupyterlab