Skip to content

Instantly share code, notes, and snippets.

Avatar

Toby McLaughlin jarpy

View GitHub Profile
View respawn.lua
local function groupIsDead(groupName) -- a certain bug hasn't been fixed, so I have to use this instead.
if (Group.getByName(groupName) and ( Group.getByName(groupName):isExist() == false or #Group.getByName(groupName):getUnits() < 1)) or not Group.getByName(groupName) then
return true
end
return false
end
if groupIsDead('TEST1') then
mist.respawnGroup('TEST1', true)
end
@jarpy
jarpy / gist:08b2364f577dfcfddb0fd645af6f67bd
Last active Dec 23, 2019
Disable MS Office keyboard shortcut.
View arch-bootstrap
#!/bin/bash
set -xeuo pipefail
function install() {
pacman --sync --noconfirm $@
}
luks_volume_uuid=$(blkid --match-tag UUID --output value /dev/nvme0n1p2)
ping -c1 google.com || dhclient eno1
@jarpy
jarpy / java-process
Created Dec 5, 2018
Investigation of puppet-logstash#381
View java-process
Failure:
/bin/java -Dfile.encoding=UTF-8 -Djava.awt.headless=true -XX:+DisableExplicitGC -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:CMSInitiatingOccupancyFraction=75 "-Xms1g -Xmx1g" -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -noverify -Djruby.compile.invokedynamic=false -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main -X-C /usr/share/logstash/lib/pluginmanager/main.rb install logstash-filter-translate
@jarpy
jarpy / 301
Created Nov 26, 2018
Docker Hub Errors 2018-11-26
View 301
$ while docker pull alpine; do echo; done
Using default tag: latest
latest: Pulling from library/alpine
Digest: sha256:621c2f39f8133acb8e64023a94dbdf0d5ca81896102b9e57c0dc184cadaf5528
Status: Image is up to date for alpine:latest
Using default tag: latest
latest: Pulling from library/alpine
Digest: sha256:621c2f39f8133acb8e64023a94dbdf0d5ca81896102b9e57c0dc184cadaf5528
Status: Image is up to date for alpine:latest
View docker-compose.yml
version: '3.5'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.3.2
ports:
- "9200:9200"
environment:
ES_JAVA_OPTS: "-Xmx2g -Xms2g"
View football-score-protector.js
// ==UserScript==
// @name Replace lots of terms on an AJAX'd page
// @include *
// @grant none
// ==/UserScript==
(function() {
var replaceArry = [
[/([^0-9])[0-9]([^0-9])/g, '$1🎲$2'],
[/^[0-9]$/, '🎲'],
View aws-mfa.sh
export AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID_PRE_AUTH"
export AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY_PRE_AUTH"
unset AWS_SESSION_TOKEN
arn=$(aws sts get-caller-identity --output text --query Arn | sed 's|:user/|:mfa/|')
json=$(aws sts get-session-token --serial-number $arn --token-code $mfacode)
export AWS_ACCESS_KEY_ID="$(echo $json | jq -r .Credentials.AccessKeyId)"
export AWS_SECRET_ACCESS_KEY="$(echo $json | jq -r .Credentials.SecretAccessKey)"
export AWS_SESSION_TOKEN="$(echo $json | jq -r .Credentials.SessionToken)"
View puppet5-resource-default-parse-order-repro.sh
#!/bin/bash
cat >repro.pp <<EOF
file { '/tmp/resource-default-test-0':
ensure => file,
}
File {
owner => 'nobody',
}
@jarpy
jarpy / docker-compose.yml
Created Oct 13, 2017
logstash-docker Arcsight module
View docker-compose.yml
---
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${TAG}
environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1']
ports: ['127.0.0.1:9200:9200']
networks: ['stack']
kibana: