Skip to content

Instantly share code, notes, and snippets.

@avnerbarr
avnerbarr / graphite
Created July 3, 2013 11:39
Installing Graphite server on Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64) by a total noob. Server configuration is annoying, especially when you are a developer and not a systems guy. Getting things right took ages. Now it seems to work for me. Try this script out
sudo apt-get update
sudo apt-get upgrade
wget http://launchpad.net/graphite/0.9/0.9.9/+download/graphite-web-0.9.9.tar.gz
wget http://launchpad.net/graphite/0.9/0.9.9/+download/carbon-0.9.9.tar.gz
wget http://launchpad.net/graphite/0.9/0.9.9/+download/whisper-0.9.9.tar.gz
tar -zxvf graphite-web-0.9.9.tar.gz
tar -zxvf carbon-0.9.9.tar.gz
tar -zxvf whisper-0.9.9.tar.gz
mv graphite-web-0.9.9 graphite
@avnerbarr
avnerbarr / installstatsd
Created July 3, 2013 12:39
Installing StatsD to write to mongodb by a total systems noob - some what annoying thing to do and time time consuming because nothing seems to work the first time. There aren't that many configurations but you got to get them right. This gist is more of a walkthrough and less of an automated install like you would probably wish there was. There…
I installed Statsd on Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-48-virtual x86_64)
Get node (i think that the repo for it changed so check out a different way to install)
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python-software-properties git-core
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
@avnerbarr
avnerbarr / Parallax for a table view
Last active August 29, 2015 14:20
Parallax table view helper
//
// ParallaxController.swift
// ParallaxTableVIew
//
// Created by Avner on 5/2/15.
// Copyright (c) 2015 Avner. All rights reserved.
//
import UIKit
@objc protocol ParallaxControllerDelegate {
@avnerbarr
avnerbarr / gist:a46b1f651b16f647389e
Created May 2, 2015 19:53
Test parallax controller
//
// ViewController.swift
// ParallaxTableVIew
//
// Created by Avner on 5/2/15.
// Copyright (c) 2015 Avner. All rights reserved.
//
import UIKit
@avnerbarr
avnerbarr / devices
Created February 9, 2016 10:17
get the devices from a mobile.provision file
security cms -D -i path/to/file
@avnerbarr
avnerbarr / chisel.sh
Created February 9, 2016 14:39
Install chisel
#!/bin/sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update
brew install chisel
@avnerbarr
avnerbarr / toolexists
Created November 20, 2016 11:35
Checks if a tool exists
set -e
if ! which <your tool> > /dev/null; then
echo "error: <your tool> is missing"
exit 1
fi
@avnerbarr
avnerbarr / learningScala.md
Last active October 8, 2017 10:33
Learning Scala
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 11 columns, instead of 2 in line 4.
sku,categories:blah,group_id,image_url,in_stock,post_type,price:blah,publish_time:blah:1:blah:foo:ha,title,updated,url
sku-0-50-rpDxvXLYji,categories:blah-0-33-yIrYX6Rosb,group_id-0-59-y1lEevwHLm,image_url-0-31-kxVMZKapB7,in_stock-0-59-H4uoKlTZLP,post_type-0-3-AmDM9GWQ0W,price:blah-0-34-ypVStJYQb2,publish_time:blah:1:blah:foo:ha-0-69-v5LzZBC2ue,title-0-84-Z1BSyxb2Uz,updated-0-25-D8AWawf3G4,url-0-87-NQIqIrZBAs
sku-1-63-Ki3xOqPRz2,categories:blah-1-68-ZIcKbiq4lE,group_id-1-94-Nbe7fFIpED,image_url-1-75-a7kXRPSwMy,in_stock-1-36-emmhFD3mXh,post_type-1-61-EVbMu5qOzZ,price:blah-1-44-nJeq9Hrg2u,publish_time:blah:1:blah:foo:ha-1-1-fJqXe8oJPk,title-1-36-LpeEaZ3Xoi,updated-1-68-aqhLSOyFkZ,url-1-38-ZHmAhpSIEp
sku-2-30-e5Io7EvVlb,categories:blah-2-36-Es1pnn1F3g,group_id-2-82-HtACnC9gLu,image_url-2-34-ExVRkzNkNe,in_stock-2-4-0YcEynHEzn,post_type-2-61-1DP1A7J0So,price:blah-2-23-lSW3SL1QVp,publish_time:blah:1:blah:foo:ha-2-39-D0hdKOmf6b,title-2-57-hv1tiQXgQO,updated-2-28-Z2Lio1bzBD,url-2-58-NEOcGhSJ5O
sku-3-6-3fIXxQcibO,cate
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 11 columns, instead of 10 in line 3.
sku,categories:blah,group_id,image_url,in_stock,post_type,price:blah,publish_time:blah:1:blah:foo:ha,title,updated,url
sku-0-50-rpDxvXLYji,categories:blah-0-33-yIrYX6Rosb-0-19,group_id-0-59-y1lEevwHLm-0-93,image_url-0-31-kxVMZKapB7-0-29,in_stock-0-59-H4uoKlTZLP-0-70,post_type-0-3-AmDM9GWQ0W-0-27,price:blah-0-34-ypVStJYQb2-0-97,publish_time:blah:1:blah:foo:ha-0-69-v5LzZBC2ue-0-49,title-0-84-Z1BSyxb2Uz-0-84,updated-0-25-D8AWawf3G4-0-27,url-0-87-NQIqIrZBAs-0-23
sku-1-63-Ki3xOqPRz2,categories:blah-1-68-ZIcKbiq4lE,group_id-1-94-Nbe7fFIpED,image_url-1-75-a7kXRPSwMy,in_stock-1-36-emmhFD3mXh,post_type-1-61-EVbMu5qOzZ,price:blah-1-44-nJeq9Hrg2u,publish_time:blah:1:blah:foo:ha-1-1-fJqXe8oJPk,title-1-36-LpeEaZ3Xoi,updated-1-68-aqhLSOyFkZ,url-1-38-ZHmAhpSIEp
sku-2-30-e5Io7EvVlb,categories:blah-2-36-Es1pnn1F3g,group_id-2-82-HtACnC9gLu,image_url-2-34-ExVRkzNkNe,in_stock-2-4-0YcEynHEzn,post_type-2-61-1DP1A7J0So,price:blah-2-23-lSW3SL1QVp,publish_time:blah:1:blah:foo:ha-2-39-D0hdKOmf6b,title-2-57-hv1tiQXgQO,updated-2-28-Z2Li