Skip to content

Instantly share code, notes, and snippets.

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 19, 2024 18:20
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Interval 10
CheckThresholds true
LoadPlugin syslog
LoadPlugin cpu
LoadPlugin df
LoadPlugin interface
LoadPlugin load
LoadPlugin memory
LoadPlugin processes
@anamorph
anamorph / HOWTO Install AWS CLI on Debian.md
Last active July 30, 2022 09:50
HOWTO Install AWS CLI on Debian

HOWTO Install AWS CLI on Debian

1. installing pre-reqs

sudo apt-get install python python-pip

2. installing the cli:

sudo pip install awscli

3. configuring the cli:

aws configure
@graph1zzlle
graph1zzlle / riemann.config
Last active October 2, 2015 20:27
riemann-scratchpad
;; SCENARIO: Be able to detect high heap pressure on service.
;; -> If during the last x minutes, "heap.usage" values are > 0.70, then alert...
;; Riemann API http://riemann.io/api.html
(defn slack-this-shit [message]
(slack slack-alert-channel {:username "Not so friendly Riemann bot",
:formatter (fn [ev] {:text (str "*"(:service ev)"*" " is in *" (:state ev) "* state on hosts: *" (:host ev) "*. " message),
:icon ":x:"})}))
(def tracking-jvm-pressure-stream
@vsouza
vsouza / .bashrc
Last active April 9, 2024 05:27
Golang setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell, fish or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active May 9, 2024 03:03
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@codeinthehole
codeinthehole / user-data.sh
Created August 18, 2014 12:41
Get the value of an EC2 instance's tag
#!/usr/bin/env bash
#
# Get the value of a tag for a running EC2 instance.
#
# This can be useful within bootstrapping scripts ("user-data").
#
# Note the EC3 instance needs to have an IAM role that lets it read tags. The policy
# JSON for this looks like:
#
# {
@john2x
john2x / 00_destructuring.md
Last active April 23, 2024 13:18
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@consti
consti / hosts
Last active May 13, 2024 03:23
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command: