Skip to content

Instantly share code, notes, and snippets.

@vindir
vindir / vonage.sh
Created April 14, 2014 08:02 — forked from sulrich/vonage.sh
#!/bin/sh
#
RCFILE=$HOME/.vonage
PREFIX='1'
#if [ a$1 = a ]
#then
# printf '\n\nUsage: dial \n\n'
# exit
#fi
@vindir
vindir / mono.rb
Created May 14, 2014 14:41 — forked from MattesGroeger/mono.rb
Brew formula for installing mono
# http://www.mono-project.com/Compiling_Mono_on_OSX
require 'formula'
class Mono < Formula
url 'http://download.mono-project.com/sources/mono/mono-3.2.3.tar.bz2'
homepage 'http://www.mono-project.com/'
sha1 'e356280ae45beaac6476824d551b094cd12e03b9'
def install

Irssi in Mac OS X Notification Center

Mou icon

Overview

This guide will explain how you can make irc messages in a screen on a remote server appear in your Mac OS X Lion Notification Center with the help of terminal-notifier.

We will also explain how the process can be automatically started each time you log in to your Mac and ensure the connection to the server is kept alive.

  1. General Background and Overview
@vindir
vindir / mandelbrot.sql
Last active August 29, 2015 14:25 — forked from rupey/mandelbrot.sql
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@vindir
vindir / install-pre-commit.sh
Created October 13, 2015 18:57 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
# Install with core.whitespace check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2
# Install with core.whitespace check and EOF-newline-check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3
# Install only core.whitespace check:
@vindir
vindir / amazon-id.conf
Created July 29, 2016 02:25 — forked from schlomo/amazon-id.conf
Amazon ID plugin for YUM. This will add 2 headers to the HTTP requests. With these headers the YUM repo server can identify the EC2 instance. These files come from the rh-amazon-rhui-client RPM package found on RHEL EC2 instances, probably part of the Red Hat Update Infrastructure (https://access.redhat.com/products/red-hat-update-infrastructure/)…
[main]
enabled=1
@vindir
vindir / gen.swift
Created November 16, 2016 04:32 — forked from blainerothrock/gen.swift
A Very Simple Genetic Algorithm Written in Swift 3
#!/usr/bin/env xcrun swift -O
/*
gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3
-------------------- https://gist.github.com/cfdrake/973505 ---------------------
gen.swift implements a genetic algorithm that starts with a base
population of randomly generated strings, iterates over a certain number of
generations while implementing 'natural selection', and prints out the most fit
string.
The parameters of the simulation can be changed by modifying one of the many
@vindir
vindir / gist:5b8bafd8cdc632747d0a57c6450b57ef
Created December 28, 2016 20:26 — forked from mdfGit/gist:48721c7cc0a9f18f27e7
AWS CloudFormation Mappings to Amazon NAT AMIs by Region/Instance type... Not sure why this doesn't already exist, but there were no example templates that mapped regions and instance types to the Amazon configured NAT ami. That's what this Gist is for, it provides the mappings for amzn-ami-vpc-nat amis in each region. These instances are config…
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "AWS CloudFormation Template (SNIPPET) that maps Amazon NAT amis (amzn-ami-vpc-nat) for each region and architecture. These instances should have the NAT configured by /usr/local/sbin/configure-pat.sh, which enables IP forwarding and adds masquerading to iptables. IMPORTANT, when defining your EC2 instance as a NAT, make sure the 'SourceDestCheck': property is set to false. Otherwise, traffic through the NAT may not work. This setting allows the NAT to forward network traffic - it is not the recipient of the traffic.",
"Mappings": {
"AWSInstanceType2Arch": {
"t1.micro": {
"Arch": "PV64"
},
"t2.micro": {
"Arch": "HVM64"
@vindir
vindir / ec2_tags.py
Created February 17, 2017 16:11 — forked from emilisto/ec2_tags.py
Grain for Salt that exposes all EC2 instance tags in grains['tags'], free for all to use and distribute. Tweet me @svammel if you have questions.
"""
ec2_tags - Exports all EC2 tags in a 'tags' grain
For Salt (http://saltstack.org)
Author: Emil Stenqvist <[email protected]>
Usage:
1. Put ec2_tags.py in roots/_grains/