Skip to content

Instantly share code, notes, and snippets.

View tsabat's full-sized avatar

Tim Sabat tsabat

View GitHub Profile
@tsabat
tsabat / checksum.md
Created December 20, 2014 16:19
pt-table-checksum and row-based replicaiton

I ran into the following error when I tried to run pt-table-checksum on the master.

Replica ip-10-83-3-194 has binlog_format ROW which could cause pt-table-checksum to break replication. Please read "Replicas using row-based replication" in the LIMITATIONS section of the tool's documentation. If you understand the risks, specify --no-check-binlog-format to disable this check.

So I read the documentation for that tool. It states:

pt-table-checksum requires statement-based replication, and it sets binlog_format=STATEMENT on the master, but due to a MySQL limitation replicas do not honor this change. Therefore, checksums will not replicate past any replicas using row-based replication that are masters for further replicas.

I verified the following things:

# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt resize +10% +0
bind left:alt resize -10% +0

The front end calls out to a set of preprocessor servers running behind an amazon load balancer.

Here are some details:

  • sinatra server for speed and size
  • heavy regex stripping to protect against dangerous calls
  • the tilt gem to normalize the api for different processor types
  • a forked timeout on each call to protect infinite loops
  • delegation to nodejs servers for non-ruby preprocessors
➜ CPOR curl -v3 -X HEAD https://codepen.io
* Rebuilt URL to: https://codepen.io/
* Hostname was NOT found in DNS cache
* Trying 54.244.230.6...
* Connected to codepen.io (54.244.230.6) port 443 (#0)
* SSL peer handshake failed, the server most likely requires a client certificate to connect
* Closing connection 0
curl: (35) SSL peer handshake failed, the server most likely requires a client certificate to connect
➜ CPOR dig codepen.io spf
; <<>> DiG 9.8.3-P1 <<>> codepen.io spf
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46174
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;codepen.io. IN SPF
@tsabat
tsabat / 01_precommit.md
Last active August 29, 2015 14:10
precommit hook

the file below keeps you from checking in debugger statements, merge symbols like >>> and stuff like focus: true. For example, when i try to commit with focus: true, you get this:

Error: git pre-commit hook forbids committing "focus: true" to spec/services/jobs/create_job_graph_spec.rb
--------------
To commit anyway, use --no-verify

to make this work

@tsabat
tsabat / I-am-changing-it-again..markdown
Last active August 29, 2015 14:09
A Pen by Tim Sabat.

these functions added to your ~/.bash_profile will always push your files to the current branch:

function gpush() {
  gc .; gp origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
}

function gpull() {
  gc .; git pull origin $(git rev-parse --symbolic-full-name --abbrev-ref HEAD)
}
@tsabat
tsabat / Dqmry.markdown
Created October 17, 2014 18:12
A Pen by Tim Sabat.
mkdir src
cd src
wget http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
#download all patches
for i in $(seq -f "%03g" 0 25); do wget http://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-$i; done
tar zxvf bash-4.3.tar.gz
cd bash-4.3
#apply all patches
for i in $(seq -f "%03g" 0 25);do patch -p0 < ../bash43-$i; done
#build and install