Instantly share code, notes, and snippets.

View gist:69ea50f8fa8a5a43af6e
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
View gist:a683d77d4adefc693772
set nocompatible
syntax on
set relativenumber
set number
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
command Unsetnum :execute ':set relativenumber& | set number&'
command Resetnum :execute ':set relativenumber | set number'
set backspace=2 " make backspace work like most other apps (http://vim.wikia.com/wiki/Backspace_and_delete_problems)
set viminfo='10,\"100,:20,%,n~/.viminfo
function! ResCur()
View package-graphite.sh
#! /bin/bash
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
clean() {
rm -rf whisper-0.9.9 carbon-0.9.9 graphite-web-0.9.9
View setup-statsd-centos.sh
# First do a fresh install of CentOS 5.7 i386, server configuration (no GUI)
# This should be performed as root since it's going to be installing a bunch of stuff
# --- Update things to make sure we have the latest patches ---
# Add EPEL so we can get reasonably recent packages
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# --- Install all the packages --- #
yum -y install python-whisper python-carbon graphite-web python-memcached python-ldap httpd memcached
View munin-graphite.rb
#!/usr/bin/env ruby
#
# graphite-mdash client - build ontop of munin-graphite
#
# Copyright: Copyright (c) 2012, Jonas Genannt <jonas@brachium-system.net>
#
# Author:: Adam Jacob (<adam@hjksolutions.com>)
# Copyright:: Copyright (c) 2008 HJK Solutions, LLC
# License:: GNU General Public License version 2 or later
#
View rmq-publish-with-header.c
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <clem_rmq.h>
#include <assert.h>
#include <amqp_tcp_socket.h>
#include <amqp.h>
View riemann.js
/*
*
* To enable this backend, include './backends/riemann' in the backends
* configuration array:
*
* Requires Riemann Node client
*
* backends: ['./backends/riemann']
*
*/
View php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View supervisord
#! /bin/sh
#
# Downloaded from:
# http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/supervisor/trusty/view/head:/debian/supervisor.init
#
# skeleton example file to build /etc/init.d/ scripts.
# This file should be used to construct scripts for /etc/init.d.
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian
View gist:1384192
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Filemanager extends Controller {
private $file = '/var/www/assets/img/big/IMG_2083.JPG';
private $new_file = '/var/www/assets/encrypt/';
private $key = 'your key';
private $cipher = MCRYPT_RIJNDAEL_256;
private $mode = MCRYPT_MODE_CBC;