Skip to content

Instantly share code, notes, and snippets.

@mathieue
mathieue / do-it.sh
Last active December 22, 2015 02:59
graphite + statsd install with chef-solo
# install chef-solo one line !
curl -L https://www.opscode.com/chef/install.sh | bash
# cookbooks have their rep: check the dir name == cookbook name
mkdir -p /opt/cookbooks
git clone https://github.com/hw-cookbooks/graphite
git clone https://github.com/opscode-cookbooks/apache2.git
git clone https://github.com/opscode-cookbooks/python.git
git clone https://github.com/opscode-cookbooks/runit.git
git clone https://github.com/opscode-cookbooks/memcached.git
@rantav
rantav / meetup-bad-bad-hosts.md
Last active November 2, 2017 15:27
How meetup fucked up, but then fixed it

Update: Meetup had revived the group and are welcoming us back again. At the end, no data was lost, even though interim communications suggested it was.
We are happy that things had finally taken a positive turn and are happy to stay at meetup and grow our community to our next event and next next event. We are a little bit sorry that things went soar for awhile but what's important is that at the end both us and meetup had learned how to make things better for the next time.

Original post below....

Meetup, you've been bad, bad hosts!

TL;DR: Meetup had deleted my group, for what I beleive to be their mistake, yet they did not admit the mistake nor can they restore the data. I am deeply dissapointed from meetup and I've lost my trust in them.

@rantav
rantav / read.md
Created September 12, 2012 07:40
Using newrelic with maven, Java

When using newrelic in java, it isn't obvious how to mavenize things. Newrelic has two java jars: newrelic.jar and newrelic-api.jar. There's also another newrelic.yaml of course. For development you need the api.jar in your classpath. In production you want the api jar in the classpath, but also newrelic.jar as an agent. Newrelic have a good explanation about how to set up newrelic.jar as an agent but they don't have anything regarding how to develop and get the api jar in place using maven, so here goes...

Add the repository:

<repositories>
  <repository>
    <id>newrelic</id>

newrelic

@matschaffer
matschaffer / create_data_bag.rb
Created June 8, 2012 15:30
Creating local encrypted data bags
require 'rubygems'
require 'chef/encrypted_data_bag_item'
secret = Chef::EncryptedDataBagItem.load_secret('data_bag_key')
data = {"id" => "mysql", "root" => "some secret password"}
encrypted_data = Chef::EncryptedDataBagItem.encrypt_data_bag_item(data, secret)
FileUtils.mkpath('data_bags/passwords')
File.open('data_bags/passwords/mysql.json', 'w') do |f|
f.print encrypted_data.to_json
@jboner
jboner / latency.txt
Last active April 18, 2024 17:18
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@mgpb
mgpb / .bashrc
Created April 19, 2011 05:03
bash prompt with git branch name and time since commit, based on what @garybernhardt did.
# It looks like this but with color and stuff:
# (macbot • sample_app ┣master ∆68m)$
# (macbot • autumn ┣master ∆2yr8mo)$
function relative_time_since_last_commit {
last_commit=`git log --pretty=format:'%ar' -1`
echo ${last_commit}
}