Skip to content

Instantly share code, notes, and snippets.

View dsibilly's full-sized avatar

Duane Sibilly dsibilly

View GitHub Profile
@dsibilly
dsibilly / observium_agent_setup.sh
Created February 15, 2022 07:09 — forked from d-a-n/observium_agent_setup.sh
Observium Agent Setup Guide
# CONFIG
SNMP_COMMUNITY=public
SYSCONTACT=dan
SYSLOCATION=Berlin
# get packages
apt-get install snmpd xinetd vim
mkdir -p /opt/observium && cd /opt
@dsibilly
dsibilly / dead_and_bloodied.js
Created January 27, 2021 00:39
Roll20 API script for automatically marking tokens as bloodied or dead
/**
* dead_and_bloodied.js v1.0
* Duane Sibilly <duane@sibilly.com>
*
* Description: Listens for token bar changes to identify when tokens are
* bloodied (reduced to half HP or less) and dead (reduced to 0 HP or less.)
*/
on('ready', () => {
const barNumber = 1, // Set this to the bar you're using for HP: 1, 2, or 3
barObject = { // This represents the bar as an abstract object
@dsibilly
dsibilly / sources.list
Created December 31, 2018 18:47
Ubuntu 18.04 Full sources.list
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic multiverse
#!/usr/bin/env bash
USER_DIR=/home/steam
ARK_DIR=$USER_DIR/Ark1
SAVE_DIR=$USER_DIR/Ark1/ShooterGame/Saved
STEAMCMD=./steamcmd.sh
STEAMCMD_DIR=$USER_DIR/steamcmd
TEMP_DIR=$USER_DIR/Saved
mv $SAVE_DIR $TEMP_DIR
@dsibilly
dsibilly / keybase.md
Last active September 30, 2021 02:47
keybase.md

Keybase proof

I hereby claim:

  • I am dsibilly on github.
  • I am valthonis (https://keybase.io/valthonis) on keybase.
  • I have a public key ASCQbjkocs07jGszg15MHdTMmFXTrH7IPO3gpVExDe0wuQo

To claim this, I am signing this object:

@dsibilly
dsibilly / niceLog.py
Last active August 29, 2015 14:06
Print line numbers and time in Python 3
#!/usr/bin/env python3
from datetime import datetime
from inspect import currentframe, getframeinfo
def niceLog(msg):
frameinfo = getframeinfo(currentframe().f_back)
print(" ".join([frameinfo.filename, "Line", str(frameinfo.lineno), datetime.now().strftime("%Y-%m-%d %H:%M:%S"), msg]))
@dsibilly
dsibilly / destinyCodes.js
Last active August 29, 2015 14:06
Automatically redeem known codes for Bungie's Destiny
/**
* destinyCodes.js
* Automatically redeem known codes for Bungie's Destiny
* Duane Sibilly <duane@sibilly.com>
*
* USAGE: Login to your account on bungie.net, and navigate to the code
* redemption page at http://www.bungie.net/en/User/coderedemption. Open your
* browser's JavaScript console (Chrome: Ctrl-Shift-J), and paste the contents
* of this file into the console. Hit enter. You can safely ignore the alert
* message that pops up for any codes you've already redeemed.
@dsibilly
dsibilly / gist:3036625
Created July 3, 2012 00:30
Add git branch info to your prompt (only in git-controlled directories!)
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working direct
ory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(par
se_git_dirty)]/"
}
@dsibilly
dsibilly / api.js
Created June 30, 2012 04:25 — forked from fwielstra/api.js
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');
@dsibilly
dsibilly / gist:2992412
Created June 26, 2012 01:00
Node.js clustered HTTP server example
(function () {
'use strict';
var cluster = require('cluster'),
http = require('http'),
os = require('os'),
/*
* ClusterServer object