Skip to content

Instantly share code, notes, and snippets.

@peregrinogris
peregrinogris / grepc.sh
Last active December 2, 2021 20:17
Custom flavored grep
#!/bin/bash
EXCLUDEDIR=${EXCLUDEDIR:-"env/*"}
COLOR=${COLOR:-always}
CONTEXT=${CONTEXT:-0}
grep -IiRn --exclude="$EXCLUDE" --exclude-dir="$EXCLUDEDIR" --color=$COLOR -C$CONTEXT "$1" * \
| less -iFRX
@jackross
jackross / postgresql.rb
Created August 6, 2012 19:58 — forked from croaker/postgresql.rb
Homebrew - PostgreSQL 9.2 Beta 3 Formula
require 'formula'
class Postgresql92beta < Formula
homepage 'http://www.postgresql.org/'
url 'http://ftp.postgresql.org/pub/source/v9.2.0beta3/postgresql-9.2beta3.tar.bz2'
md5 '5164fce3a6c46dd7f6ef188a25ac0bc9'
depends_on 'readline'
depends_on 'libxml2' if MacOS.leopard? # Leopard libxml is too old
depends_on 'ossp-uuid'
@bsparrow435
bsparrow435 / gist:3563993
Created September 1, 2012 04:44
Riak MDC cheat sheet

#Riak Multi DC Repl Cheat Sheet


##Types There are two types of multi data center replication in Riak.

  1. Fullsync

    Operation is triggered by connection creation between clusters, running riak-repl start-fullsync on the listener leader, or every fullsync_interval minutes. Relevant app.config settings:

"Jazz Improvisation and Organizing: Once More from the Top" http://web.cba.neu.edu/~mzack/articles/jazzorg/jazzorg.htm

"Resilience, Adaptation and Improvisation: increasing resilience by organising for successful improvisation" http://www.sintef.no/project/Building%20Safety/Publications/3rd%20RE%20symposium,%20resilience_adaptation_improvisation,%20TOG.pdf

"Space Operations Officers As Jazz Musicians" http://www.smdc-armyforces.army.mil/Pic_Archive/ASJ_PDFs/ASJ_VOL_9_NO_1_008.pdf

"Supporting Improvisation Work in Inter-Organizational Crisis Management"

@dcode
dcode / GitHub Flavored Asciidoc (GFA).adoc
Last active June 3, 2024 07:24
Demo of some useful tips for using Asciidoc on GitHub

GitHub Flavored Asciidoc (GFA)

@bdd
bdd / quickfiles
Last active April 15, 2023 13:54
FZF_DEFAULT_COMMAND utility for fzf
#!/bin/bash
# FZF_DEFAULT_COMMAND utility for fzf
#
# Tries to use Watchman, Ripgrep (rg), The Silver Searcher (ag) in this order.
# ...or falls back the fzf's Unix default.
#
# TODO:
# - Use 'git ls-files -cmod' in Git repositories
@tombigel
tombigel / README.md
Last active June 3, 2024 00:19 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@mbbx6spp
mbbx6spp / config
Created November 22, 2017 16:19
Blocked SSH port, GitHub workaround
# Put in your ~/.ssh/config
### Problem
#
# You are on a public WiFi network that blocks SSH ports but you don't want to switch
# to pushing your Github changes to GH remotes via HTTPS nor do you want to change the
# remote hostname in all your repos.
Host github.com
Hostname ssh.github.com
@macdja38
macdja38 / foundation_db_tutorial_1
Created April 21, 2018 10:28
FoundationDB's python tutorial ported to python 3, running on a process pool instead of a 1 thread per student.
import itertools
import random
import fdb
from functools import partial
import time
from multiprocessing import Pool
@bryanhuntesl
bryanhuntesl / Riak and Erlang - execute a command upon a node and print to console.md
Last active June 13, 2022 16:00
Riak and Erlang - execute a command upon a node and print to console

verify distributed Erlang working

Ping the riak node, print the response and halt the system.

erl -setcookie riak -name "${USER}-"@127.0.0.1 -noshell \
-eval "Res = net:ping('dev1@127.0.0.1'), io:put_chars(standard_error,io_lib:format(\"~p\",[Res]))." \
-eval "erlang:halt()."

As a result, pong is printed to the console, the response from the remote node, we're ready to start executing Erlang.