Skip to content

Instantly share code, notes, and snippets.

View notheotherben's full-sized avatar

Benjamin Pannell notheotherben

View GitHub Profile
@notheotherben
notheotherben / README.md
Created September 15, 2022 07:10
Honeycomb.io Syslog Derived Columns

Honeycomb.io Syslog Derived Columns

These derived columns are intended to be used alongside Honeytail to make it easier to visualize and understand your log data in Honeycomb.

error

Makes it easy to visualize errors using Honeycomb's default dashboards

IF(LTE($severity, 3), $message, "")
@notheotherben
notheotherben / starship.toml
Created November 11, 2021 15:28
A Powerline configuration for Starship.rs
format = """
[\uE0B6](fg:#1C4961)[$directory](bg:#1C4961)[\uE0B0](fg:#1C4961 bg:#2F79A1)$git_branch[\uE0B0](fg:#2F79A1 bg:#3A95C7)$git_status[\uE0B0](#3A95C7 bg:#40A9E0)$time[\uE0B0](#40A9E0 bg:none) $all$character """
add_newline = true
[directory]
style = "bg:#1C4961 fg:white"
[git_branch]
format = "[ $symbol$branch ]($style)"
@notheotherben
notheotherben / README.md
Last active April 2, 2020 20:07
COVID-19 F@H AzureVM Template

COVID-19 F@H Azure VM Template

Deploy an Azure VM to help Folding@Home

⚠️ For the latest version, please take a look at the new repo.

This is an Azure VM template which deploys a GPU-enabled VM of your choice to help the Folding@Home project find ways to combat COVID-19. It is expected that the default VM (Standard_NC6_Promo) will cost about $350 per month to run (depending on your choice of region etc) which means that on the stock Azure trial benefit you should be able to get about 2 weeks of runtime before running out of free credits.

@notheotherben
notheotherben / GetRandomDocument.js
Created April 10, 2019 04:50
CosmosDB Random Document Stored Procedure
function getRandomDocument(filterQuery){
var collection = getContext().getCollection();
var result = null;
var count = 0;
var pageSize = 50;
function query(responseOptions) {
return (filterQuery && filterQuery.length) ?
collection.queryDocuments(collection.getSelfLink(), filterQuery, responseOptions, onReadDocuments) :
collection.readDocuments(collection.getSelfLink(), responseOptions, onReadDocuments);
@notheotherben
notheotherben / README.md
Last active December 28, 2022 14:06
PowerShell Configuration

PowerShell Configuration

To setup your PowerShell to match mine, simply run the following commands:

# You may need to run this in an administrative PowerShell instance
Set-ExecutionPolicy Unrestricted

$SetupScript = Invoke-WebRequest https://gist.githubusercontent.com/notheotherben/77ccb460948afd826365e85d226509a7/raw/setup.ps1
$ScriptBlock = [ScriptBlock]::Create($SetupScript.Content)
Invoke-Command -ScriptBlock $ScriptBlock
@notheotherben
notheotherben / README.md
Last active January 21, 2021 16:19
VSCode GCC+WSL Configuration

Build and debug C in VSCode on Windows Subsystem for Linux

This set of launch.json and task.json files allow you to build and debug individual C files from within Windows while using the gcc collection installed within your WSL environment.

Steps

Ensure you have GCC+GDB installed in WSL

sudo apt-get update
sudo apt-get install -y gcc gdb
@notheotherben
notheotherben / README.md
Last active August 27, 2018 07:16
Markdown Here Theme

MarkdownHere Theme

A custom theme for Markdown here

This is a custom set of CSS for MarkdownHere which provides a nicer theme (personal oppinion) than the default.

@notheotherben
notheotherben / README.md
Created February 10, 2017 11:58
PEG Grammar for Command Line Parsing

Command Line Parsing Grammar

This grammar allows you to parse command lines for program execution into their various components - specifically: environment variables, the executable itself and any arguments passed to the executable.

It will take an input like the following:

ENV_X=true ENV_Y="yes please" ./test/my_exec arg1 -f1 "arg with spaces" 'another arg' --flag2 yet\ another\ arg --flag=10
@notheotherben
notheotherben / README.md
Last active September 9, 2021 07:50
Fix Postgres 9.x Sequences

PostgreSQL 9.x Sequence Fixing Script

This script is intended to automatically fix the sequence numbers for all tables in the current database.

This is accomplished through the use of the setval() command, which we provide with the next ID value we wish to make use of. We use the setval(sequence, number, is_called) overload and set is_called = false in conjunction with COALESCE(MAX + 1, 1) to ensure that, with an empty table, the next sequence value is 1 as expected.

@notheotherben
notheotherben / keybase.md
Last active July 19, 2020 18:31
keybase.md

Keybase proof

I hereby claim:

  • I am notheotherben on github.
  • I am spartan563 (https://keybase.io/spartan563) on keybase.
  • I have a public key whose fingerprint is 8C4F FBEC 8CE2 C93F E838 DE7D B808 C16A 3F74 B2C4

To claim this, I am signing this object: