Skip to content

Instantly share code, notes, and snippets.

Avatar
👯‍♀️
OMG

Ian Vaughan IanVaughan

👯‍♀️
OMG
View GitHub Profile
@IanVaughan
IanVaughan / uninstall_gems.sh
Created Jun 9, 2012
Uninstall all rbenv gems
View uninstall_gems.sh
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
View cred-diff
#!/usr/bin/env bash
# Usage
# cred-diff <env> (<branch|ref>|master)
# eg
# cred-diff production master
VAR=$2
REF="${VAR:-master}"
git checkout $REF --quiet
printf .
@IanVaughan
IanVaughan / diff-creds
Last active Jun 25, 2021
Show difference in rails creditials
View diff-creds
#!/usr/bin/env bash
# Usage:
# diff-creds production
git checkout master --quiet
printf .
rails credentials:show --environment $1 > /tmp/prod
printf .
git checkout - --quiet
printf .
@IanVaughan
IanVaughan / README.md
Created Jun 7, 2012
Push branch from one remote into another
View README.md

Push branch from one remote into another

Add remote2 as a remote

$ git remote -v
remote2 git@github.com:repo2.git (fetch)
remote2 git@github.com:repo2.git (push)
origin  git@github.com:repo.git (fetch)
origin  git@github.com:repo.git (push)
@IanVaughan
IanVaughan / patron
Created Nov 21, 2015
patron gem fail
View patron
Installing patron 0.4.20 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/ubuntu/.rbenv/versions/2.2.3/bin/ruby -r ./siteconf20151121-13137-yck58r.rb extconf.rb
checking for curl-config... no
checking for main() in -lcurl... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
@IanVaughan
IanVaughan / output
Created Feb 28, 2012
brew install gpg
View output
$ brew doctor
Your system is raring to brew.
$ brew update
Already up-to-date.
$ brew install -v gpg
==> Downloading ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.12.tar.bz2
File already downloaded in /Users/ivaughan/Library/Caches/Homebrew
/usr/bin/tar xf /Users/ivaughan/Library/Caches/Homebrew/gnupg-1.4.12.tar.bz2
View runner.log
2021-06-08T11:59:41.3519967Z ##[section]Starting: Request a runner to run this job
2021-06-08T11:59:42.1598461Z Can't find any online and idle self-hosted runner in current repository that matches the required labels: 'ubuntu-latest'
2021-06-08T11:59:42.1598552Z Can't find any online and idle self-hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest'
2021-06-08T11:59:42.1598921Z Found online and idle hosted runner in current repository's account/organization that matches the required labels: 'ubuntu-latest'
2021-06-08T11:59:42.3122458Z ##[section]Finishing: Request a runner to run this job
2021-06-08T11:59:51.7098919Z Current runner version: '2.278.0'
2021-06-08T11:59:51.7127239Z ##[group]Operating System
2021-06-08T11:59:51.7128229Z Ubuntu
2021-06-08T11:59:51.7128778Z 20.04.2
2021-06-08T11:59:51.7129289Z LTS
@IanVaughan
IanVaughan / Heroku grok logstash rule for Heroku Deployments.md
Last active Jan 20, 2021
Heroku grok logstash rule for Heroku Deployments
View Heroku grok logstash rule for Heroku Deployments.md

Sample:

Deploy 77bd8aca by user some@email.com

Rule:

rule1 Deploy %{notSpace:deploy.sha} by user %{data:deploy.user}
@IanVaughan
IanVaughan / Datadog grok logstash rules for custom sidekiq logs.md
Last active Jan 20, 2021
Datadog grok logstash rules for custom sidekiq logs
View Datadog grok logstash rules for custom sidekiq logs.md

Samples:

I, [2020-11-12T12:12:18.883446 #4]  INFO -- : sidekiq-stats {"processed":48469869,"failed":30091,"scheduled_size":0,"retry_size":0,"dead_size":0,"processes_size":1,"default_queue_latency":0,"workers_size":0,"enqueued":0}
I, [2020-11-12T12:03:11.112090 #4]  INFO -- : sidekiq-queues [[{"name":"default"},{"count":0},{"size":0},{"latency":0}],[{"name":"import"},{"count":0},{"size":0},{"latency":0}],[{"name":"low"},{"count":26},{"size":26},{"latency":183.94694018363953}]]

Rules:

autoFilledRule1 I,\s+\[%{date("yyyy-MM-dd'T'HH:mm:ss.SSSSSS"):date}\s+#4\]\s+%{word:level}\s+--\s+\:\s+sidekiq-stats\s+\{\"processed\"\:%{integer:processed},\"failed\"\:%{integer:failed},\"scheduled_size\"\:%{integer:scheduled_size},\"retry_size\"\:%{integer:retry_size},\"dead_size\"\:%{integer:dead_size},\"processes_size\"\:%{integer:processes_size},\"default_queue_latency\"\:%{number:default_queue_latency},\"workers_size\"\:%{integer:workers_size},\"enqueued\"\:%{integer:enqueued}\}
autoFilledRule2 I,\s+\[%{date("yy
@IanVaughan
IanVaughan / Datadog grok logstash rules for standard sidekiq logs.md
Last active Jan 20, 2021
Datadog grok logstash rules for standard sidekiq logs
View Datadog grok logstash rules for standard sidekiq logs.md

Sample:

I, [2020-04-05T20:10:03.013349 #4]  INFO -- : [Paypal::Transactions] jid:39d5996400fa48a, too account_id:3, end_date:2020-04-04T23:59:59Z, page:1

Rules:

sidekiq %{notSpace:log.letter},\s+\[%{date("yyyy-MM-dd'T'HH:mm:ss.SSSSSS"):log.date}\s+#.\]\s+%{word:log.level}\s+--\s+\:\s+\[%{notSpace:sidekiq.job.class}]\s+jid:%{word:sidekiq.job.jid}%{data::keyvalue(":", "", ",")}