Skip to content

Instantly share code, notes, and snippets.

View artburkart's full-sized avatar
💭
why

Arthur Burkart artburkart

💭
why
  • Coinbase
  • somewhere rainy, probably
View GitHub Profile

Keybase proof

I hereby claim:

  • I am artburkart on github.
  • I am artburkart (https://keybase.io/artburkart) on keybase.
  • I have a public key ASB73UEdBQZyOWG1_3u68txBcSBXj3KoXpXySbBrl-qWgwo

To claim this, I am signing this object:

@artburkart
artburkart / gist:15b62f1a741eef0f74492860ab9dee9d
Last active December 30, 2020 16:21
Hammerspoon ShiftIt replacement (50% window tiling, maximize, change display)
-- https://www.hammerspoon.org/go/#window-sizing
-- https://stackoverflow.com/questions/54151343/how-to-move-an-application-between-monitors-in-hammerspoon
-- https://github.com/fikovnik/ShiftIt/issues/296#issuecomment-438386501
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "r", function()
hs.reload()
end)
hs.alert.show("Config loaded")
hs.window.animationDuration = 0
units = {
@artburkart
artburkart / README.md
Last active July 15, 2019 10:24
creating self-signed cert openssl

Create private key and signing request:

openssl genrsa 4096 > privatekey.pem
openssl req -new -key privatekey.pem -out csr.pem -config config.ini

The output looks like this:

@artburkart
artburkart / password_command.sh
Created March 2, 2019 21:23
Command I sometimes use for generating passwords
#!/usr/bin/env bash
openssl rand -base64 100 | tr -dc A-Za-z0-9 | head -c32
@artburkart
artburkart / showperms.sh
Created October 1, 2018 05:44
Display perms on file as number
#!/usr/bin/env bash
# https://askubuntu.com/questions/152001/how-can-i-get-octal-file-permissions-from-command-line#152003
stat -c "%a %n" /usr/bin
stat -c "%a %n" *
@artburkart
artburkart / alert.js
Created September 14, 2018 07:27
alert.js
alert('testing xss vulnerability');
@artburkart
artburkart / route-eth0
Last active June 8, 2018 17:15
Persisting advmss across reboots
#!/bin/bash
# This takes advantage of the code in /etc/sysconfig/network-scripts/ifup-routes
# handle_file () {
# . $1
# routenum=0
# while [ "x$(eval echo '$'ADDRESS$routenum)x" != "xx" ]; do
# eval $(ipcalc -p $(eval echo '$'ADDRESS$routenum) $(eval echo '$'NETMASK$routenum))
# line="$(eval echo '$'ADDRESS$routenum)/$PREFIX"
# if [ "x$(eval echo '$'GATEWAY$routenum)x" != "xx" ]; then
@artburkart
artburkart / ipsec-go-vici-example.go
Created April 25, 2018 22:50
ipsec-go-vici-example.go
package main
import (
"github.com/bronze1man/goStrongswanVici"
"github.com/davecgh/go-spew/spew"
"strings"
)
type Status map[string]map[string]string
@artburkart
artburkart / sts-example.js
Created February 24, 2018 06:17
Using aws-sdk npm package with DefaultProviderChain
const AWS = require('aws-sdk');
// Gets copy of default provider chain
const chain = AWS.CredentialProviderChain.defaultProviders.slice(0);
// Inserts additional check for specific profile in ~/.aws/credentials file
chain.splice(2, 0, () => new AWS.SharedIniFileCredentials({profile: 'readonly_user'}));
// Creates credential resolver that uses my custom provider chain
const credentialProvider = new AWS.CredentialProviderChain(chain);
@artburkart
artburkart / influx_crash.log
Created August 3, 2017 19:23
influx crash log
This file has been truncated, but you can view the full file.
Ran this query through Grafana:
SELECT mean("thread_cache_needed") AS "Thread Cache Needed" FROM (SELECT 100 - (("threads_created" / "connections") * 100) AS "thread_cache_needed" FROM "mysql" WHERE $timeFilter AND "host" = 'ip-10-20-0-127.ec2.internal' fill(null)) WHERE $timeFilter GROUP BY time($__interval) fill(null)
InfluxDB Log:
...snip.....
[I] 2017-08-03T18:13:12Z SELECT mean(thread_cache_needed) AS "Thread Cache Needed" FROM (SELECT 100 - ((threads_created / connections) * 100) AS thread_cache_needed FROM simplisafe.autogen.mysql WHERE time > 1500514212972ms AND time < 1500522389529ms AND host = '10.0.0.1') WHERE time > 1500514212972ms AND time < 1500522389529ms GROUP BY time(30s) service=query