Skip to content

Instantly share code, notes, and snippets.

View tabletcorry's full-sized avatar

Corry Haines tabletcorry

View GitHub Profile

Keybase proof

I hereby claim:

  • I am tabletcorry on github.
  • I am tabletcorry (https://keybase.io/tabletcorry) on keybase.
  • I have the public key with fingerprint FFD9 5F42 0A26 3E54 6948  2D54 0F9A 98A6 5E3B 2327

To claim this, I am signing this object:

def exists(self, key):
"""Check for existence in cache
:param key: Unique key to check
:type key: str
:rtype: bool
"""
return self.__contains__(key)
@tabletcorry
tabletcorry / fabfile.py
Created July 14, 2011 22:48
Fab decorator issue
from fabric.api import *
import test
@task
def noop():
return
@tabletcorry
tabletcorry / bar-__init__.py
Created July 15, 2011 23:15
Fabric namespace recursion
from fabric.api import *
@task
def bar_noop():
return
@tabletcorry
tabletcorry / log4j
Created January 31, 2012 18:36
logstash output
DEBUG 13:34:50,845 [Giganto] Disconnected from [[#zen_unicast_1#][inet[localhost/127.0.0.1:9300]]]
DEBUG 13:34:50,847 [Giganto] Connected to node [[#zen_unicast_1#][inet[localhost/127.0.0.1:9300]]]
DEBUG 13:34:53,848 [Giganto] ping responses:
--> target [[Grog the God-Crusher][J7ZUBwUcQ12J2J0uIa0eeQ][inet[/72.14.XXX.XX:9302]]{client=true, data=false}], master [null]
DEBUG 13:34:53,849 [Giganto] Disconnected from [[#zen_unicast_1#][inet[localhost/127.0.0.1:9300]]]
DEBUG 13:34:53,851 [Giganto] Connected to node [[#zen_unicast_1#][inet[localhost/127.0.0.1:9300]]]
DEBUG 13:34:56,851 [Giganto] ping responses:
--> target [[Grog the God-Crusher][J7ZUBwUcQ12J2J0uIa0eeQ][inet[/72.14.XXX.XX:9302]]{client=true, data=false}], master [null]
@tabletcorry
tabletcorry / Parser
Created January 31, 2012 22:26
logstash 1.1.0 configs
input {
file {
type => "syslog"
# Wildcards work, here :)
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
}
amqp {
# ship logs to the 'rawlogs' fanout queue.
type => "all"
@tabletcorry
tabletcorry / gist:3374317
Created August 16, 2012 22:51
Multiline on non-dates
multiline {
negate => true
pattern => "^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}"
what => "previous"
type => "kittens"
}
$ bundle exec ruby bin/logstash agent -vvv -e 'input { stdin { type => 'cow' } } output { redis { host => ['localhost', 'localhost:6380'] key => 'logstash' data_type => 'list' } }'
{"message":"Read config","level":"info","file":"agent.rb","line":"310","method":"run"}
{"message":"Start thread","level":"info","file":"agent.rb","line":"313","method":"run"}
Error at line 1, column 79: ":6380] key => logstash data_type => list } }\n"
Error at line 1, column 79: ":6380] key => logstash data_type => list } }\n"
RuntimeError: Invalid Configuration. Check syntax of config file.
parse at /Users/chaines/github/logstash/lib/logstash/config/grammar.rb:552
parse at /Users/chaines/github/logstash/lib/logstash/config/file.rb:28
parse_config at /Users/chaines/github/logstash/lib/logstash/agent.rb:266
run_with_config at /Users/chaines/github/logstash/lib/logstash/agent.rb:368
@tabletcorry
tabletcorry / upgrade-user-2.sh
Last active September 15, 2023 18:39
Mastodon upgrade to nightly. Call upgrade.sh as root
#!/bin/bash
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
set -euxo pipefail
cd /home/mastodon/live
RAILS_ENV=production bundle exec rails db:migrate