Skip to content

Instantly share code, notes, and snippets.

View tamsky's full-sized avatar

Marc Tamsky tamsky

View GitHub Profile
@tamsky
tamsky / fixup-chrome-profile.sh
Created February 12, 2014 04:09
script that performs global search and replace of a URL within a Chrome User Profile
#!/bin/bash
# Primary goal is renaming $OLD http or https urls to $NEW https urls
# Instructions
#
# Before you start, locate and *BACKUP* your Chrome folder:
# on OSX it's at: ~/Library/Application Settings/Google/Chrome
#
# Next:
# Disable chrome sync at https://www.google.com/settings/chrome/sync
#!/bin/bash
set -eu
shopt -s nullglob
if [[ -n ${RUN:-} ]]; then
dry=
else
dry=echo
fi
@tamsky
tamsky / stderr
Last active August 29, 2015 14:05
[docker provider] VAGRANT_LOG=debug vagrant ssh -- -t sudo su -
INFO global: Vagrant version: 1.6.3
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant"
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
riemann.streams=> (def s (by [:tt :host] (ddt-events (partial prn :ddt))))
#'riemann.streams/s
riemann.streams=> (s {:tt 0 :host "foo" :metric 1})
true
riemann.streams=> (s {:tt 0 :host "foo" :metric 2})
true
riemann.streams=> (s {:tt 0 :host "foo" :metric 3})
true
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@tamsky
tamsky / gist:bad8a7968560f133450d
Created November 24, 2014 05:02
pyKairosdb in juypter colaboratory
%matplotlib inline
# working example
%install_ext https://bitbucket.org/birkenfeld/ipython-physics/raw/d1310a2ab15d/physics.py
%load_ext physics
# try something similar
%install_ext https://github.com/tamsky/pyKairosDB/raw/master/pyKairosDB.zip
sys.path.append(".ipython/extensions/pyKairosDB.zip")
import pyKairosDB
@tamsky
tamsky / meetup-notes
Last active August 29, 2015 14:10
Talk notes: Jon Haddad: Diagnosing Cassandra Problems in Production
Jon Haddad: Diagnosing Cassandra Problems in Production
http://www.meetup.com/ladevops/events/213408212/
where do systems fail?
spof
typical : replication - master failure
master insert bottleneck
san&nas performance
hardware/software upgrades
any # of cloud issues
If you want, I can try and help with pointers as to how to improve the indexing speed you get. Its quite easy to really increase it by using some simple guidelines, for example:
- Use create in the index API (assuming you can).
- Relax the real time aspect from 1 second to something a bit higher (index.engine.robin.refresh_interval).
- Increase the indexing buffer size (indices.memory.index_buffer_size), it defaults to the value 10% which is 10% of the heap.
- Increase the number of dirty operations that trigger automatic flush (so the translog won't get really big, even though its FS based) by setting index.translog.flush_threshold (defaults to 5000).
- Increase the memory allocated to elasticsearch node. By default its 1g.
- Start with a lower replica count (even 0), and then once the bulk loading is done, increate it to the value you want it to be using the update_settings API. This will improve things as possibly less shards will be allocated to each machine.
- Increase the number of machines you have so
brew install tuntap
sudo cp -pR $(brew --prefix tuntap)/Library/Extensions/tap.kext /Library/Extensions/
sudo cp -pR $(brew --prefix tuntap)/Library/Extensions/tun.kext /Library/Extensions/
sudo chown -R root:wheel /Library/Extensions/tap.kext
sudo chown -R root:wheel /Library/Extensions/tun.kext
sudo touch /Library/Extensions/
sudo cp -pR $(brew --prefix tuntap)/tap /Library/StartupItems/
sudo chown -R root:wheel /Library/StartupItems/tap
sudo cp -pR $(brew --prefix tuntap)/tun /Library/StartupItems/
sudo chown -R root:wheel /Library/StartupItems/tun
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.