Skip to content

Instantly share code, notes, and snippets.

View jespada's full-sized avatar

jespada jespada

View GitHub Profile
@jespada
jespada / percona-xtrabackup.sh
Created August 26, 2018 16:27 — forked from jaygooby/percona-xtrabackup.sh
Call via crontab on whatever schedule suits you; keep n full mysql Percona xtrabackups of your mysql database, with binary logs applied. Also does a full mysqldump that can then have the binary logs applied to restore to a point-in-time backup via the binlogs. Copy all of this (backup, mysqldump, binlogs) to S3.
#!/bin/bash
#
# Carries out a full mysqldump, calls percona-xtrabackup and then
# copies the sql dump, the percona backup and your mysql bin logs
# to S3 using s3cmd http://s3tools.org/s3cmd
#
# TODO: extract out the S3 backup stuff to make it optional, and so
# other s3 programs can replace the s3cmd call.
# TODO: the if [ $? == 0 ] alert blocks should be a function
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test
@jespada
jespada / jenkins_docker_cleanup.gdsl
Created April 24, 2018 13:43
jenkins dsl cleanup job slaves docker
// got it from https://gist.github.com/tomnomnom/53998ec618a17d61153911f9b5ade0ed
// The ArrayList of slaves is not serializable, so fetching them should be marked as @NonCPS so that
// no attempt is made to serialize and save the local state of the function. See here for details:
// https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#serializing-local-variables
@NonCPS
def getSlaves() {
def slaves = []
jenkins.model.Jenkins.instance.slaves.each {
if (it.name.startsWith('jenkinsslave-')) {
@jespada
jespada / once-per-jenkins-slave.groovy
Created April 24, 2018 10:11 — forked from tomnomnom/once-per-jenkins-slave.groovy
Run a command once on each Jenkins slave using the CloudBees Workflow / Jenkins Pipeline plugin
// The ArrayList of slaves is not serializable, so fetching them should be marked as @NonCPS so that
// no attempt is made to serialize and save the local state of the function. See here for details:
// https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md#serializing-local-variables
@NonCPS
def getSlaves() {
def slaves = []
hudson.model.Hudson.instance.slaves.each {
slaves << it.name
}
return slaves
@jespada
jespada / .editorconfig
Created February 16, 2018 11:39
editorconfig general
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 2
; Use tabs for indentation (Makefiles require tabs)
[{Makefile,**.mk}]
@jespada
jespada / compile-pgloader-ccl.sh
Created May 18, 2017 10:53
pgloader-ccl-compile
# run as root
git clone git@github.com:dimitri/pgloader.git
cd pgloader
mkdir -p /opt/src/pgloader
cp -R * /opt/src/pgloader
apt-get update
apt-get install -y wget curl make git bzip2 time libzip-dev libssl1.0.0 openssl
apt-get install -y patch unzip libsqlite3-dev gawk freetds-dev subversion
@jespada
jespada / pub-keys
Created August 25, 2016 14:12
jespada pub keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDHkf7Pnw1swrjJL/m9emEBUzMByLMmLYSCvZn1fZXkc0jwtxV0evHYgbtO3TsZnHr8kMjbWkNHkFHhfnS2yZJ3aWbsIhAuZdqfK8em5JhNfO3xj/wVErC92s6rGiaFNuG3VGOi8iN5hTW3BSJNmUSDSLXVdfmxOvft44T403/cRRtzlYVmBq52rzUvp0KEcPjXLWr3wLOsisnnFOajggfVbeps3gp99DathXvF2PNvr+8NQvfcLfLj6cS7gDcua72Ngig5zXoVX4Wd0yFYNkoR9bpadxfGO53721emxu5x6O1XgiHVWRJcRj+x+zZDx6DQ65Es6LXhNFA77zhxJK5nqX1NPS1BxMxl2ddStOU9W/q9//Hsq/bI8/8ECf2H8CiQU1oS8aL3vxTpOu0ZW5o12Q8xM7G8P62TgnkZccVJ/92POW9LkmXfIYxOg/wmEVtoLGJHAwNe9RCnT1eb1Mh1ge+718H/uB6Xf4l8Blrz8Mv0LKpTN0xN0l9MOGbCt4PNH4fLPuYP2pQyGS48lNOrT2QZ1rraiMyt9+mLaqXbR9x4wk56miH66LLUtgUHENQ1DO/9s8IaES/fXc4KN3dxC8+6yOo0njF4D8aMO4NmkqKenYkuq6DbaeckwUHtH4L33AZHYVS4TCcHTL1pZkXjWitMExLh9y3eD2xXALmpGw== jorge@thor
@jespada
jespada / onename
Created October 24, 2015 13:56
Verifying that +jespada is my blockchain ID. https://onename.com/jespada
Verifying that +jespada is my blockchain ID. https://onename.com/jespada
@jespada
jespada / logstash.log
Created July 1, 2015 14:59
logstatsh hipchat plugin
:stacktrace=>["org/jruby/ext/openssl/SSLSocket.java:195:in `connect_nonblock'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/ftw-0.0.44/lib/ftw/connection.rb:413:in `do_secure'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/ftw-0.0.44/lib/ftw/connection.rb:393:in `secure'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/ftw-0.0.44/lib/ftw/agent.rb:449:in `connect'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/ftw-0.0.44/lib/ftw/agent.rb:283:in `execute'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-hipchat-1.0.0/lib/logstash/outputs/hipchat.rb:64:in `receive'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/outputs/base.rb:88:in `handle'", "(eval):107:in `output_func'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:243:in `outputworker'", "/opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb:165:in `start_outputs'"], :level=>:warn}
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.14 (GNU/Linux)
mQMuBFMaIUIRCAD6D5xKjYp8SQWVSahN4TSDO0A14GDZk1smkBd7cTYjgQUXmQOe
nI/jwLdKLXelH87ZT/OfWp7QE0ZqOrx/zY9zXFceXXKYdmbHi8OcM9eS1L+HcvPY
3JDNvJiUoo1pmFo0a02veU3l9RrUrQgZkb0qvkCIU/Di4Rj7GFIxw5Eja5gfWYkc
p77l+aKlfRxtS1YF9diMy3Nu3DmWmGnuYqnu4XuUhASnQIF5KUnZcDIxKV9E/PEi
Zw8aSS8VnbeSkATwS1Ix0ITAdoa/qRW8jbR/qJG92yagFvtAkX0FX+zCmUyH9YTi
dx7XQXi+LV8CD3LkXu0Ak9CKKf2uX2ZsoJHrAQDwwBSHlK1mUYIw/T6F/ioW5zcY
jx9VS/SusCtKmMAXyQf+KB2r1gbun9sAPleUB9efphK2UMv7Iyk03RNxdor729PO
@jespada
jespada / keybase.md
Created July 15, 2014 22:26
keybase.md

Keybase proof

I hereby claim:

  • I am jespada on github.
  • I am jespada (https://keybase.io/jespada) on keybase.
  • I have a public key whose fingerprint is 8B01 6F99 EFF9 E431 38F7 96B1 65CA AA42 B8D2 494C

To claim this, I am signing this object: