Skip to content

Instantly share code, notes, and snippets.

View ovaistariq's full-sized avatar

Ovais Tariq ovaistariq

View GitHub Profile
Config is:
* Intel NUC 2 cpus, 4 vcpus, 16gb RAM
* block cache / buffer pool is 12gb
* 16 tables, 3M rows/table, 1 client connection
* compressed InnoDB uses zlib, compressed MyRocks uses lz4 for mid levels and zstd for max level
Engines:
* myrocks.p5721.{zstd,none} - MyRocks, Percona 5.7.21 using zstd or no compression for max level
* innodb.p5721.{zlib,none} - InnoDB, Percona 5.7.21 using zlib or no compression
@garukun
garukun / backpressure-detection.go
Last active April 14, 2023 09:47
Go example regarding channels and backpressure
// https://play.golang.org/p/z2eYKhyoIk
package main
import "fmt"
import "time"
import "sync"
// Blocking detection for when pushing on filled buffered channel by using default.
func main() {
ch1 := make(chan int, 2)
@mattjbarlow
mattjbarlow / gist:242b66cdae6938d34419
Created December 22, 2014 15:40
Chef Shell in Test Kitchen
cd into /tmp/kitchen.
/opt/chef/embedded/bin/gem install chef-zero
/opt/chef/embedded/bin/chef-zero -d
knife cookbook upload -a -c client.rb
chef-shell -z -c client.rb -o '<YOUR RECIPE>'
@evanscottgray
evanscottgray / docker_kill.sh
Last active November 7, 2023 03:40
kill all docker containers at once...
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
@robcowie
robcowie / test_example.py
Created December 7, 2013 15:03
py.test fixtures for testing tornado apps
def test_root_output(client):
resp = client.fetch('/')
assert resp.code == 200
assert resp.body == 'Hello, world'
def test_async_output(client):
resp = client.fetch('/async')
assert resp.code == 200
@stephenlauck
stephenlauck / migration.sh
Created January 29, 2013 23:38
Migrate node across hosted chef servers
# update gems
sudo gem update --no-rdoc --no-ri
# edit client.rb with correct validation key and chef server
# also set the environment
log_level :info
log_location STDOUT
chef_server_url "https://api.opscode.com/organizations/modcloth-comments"
validation_client_name "modcloth-comments-validator"
node_name "comments-standalone-01.demo.modcloth.com"
@mattbornski
mattbornski / stdout.py
Created August 8, 2012 21:41
Streaming stdout from a Python subprocess in Python 2.6-2.7
#!/usr/bin/env python
# I was frustrated that no matter what buffer setting I passed to communicate,
# I could not get stdout from my subprocess until the process had completed.
# I googled around and came up with this, which illustrates the problem and a
# solution.
# http://stackoverflow.com/questions/2804543/read-subprocess-stdout-line-by-line
# http://bugs.python.org/issue3907
# http://docs.python.org/library/io.html
@jtimberman
jtimberman / knife.rb
Created February 1, 2012 19:33
Commented knife.rb for all the things
# Knife Configuration File.
#
# This is a Ruby DSL to set configuration parameters for Knife's
# general options. The default location for this file is
# ~/.chef/knife.rb. If multiple Chef repositories are used,
# per-repository configuration files can be created. A per repository
# configuration file must be .chef/knife.rb in the base directory of
# the Chef repository. For example,
#
# ~/Development/chef-repo/.chef/knife.rb
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real