Skip to content

Instantly share code, notes, and snippets.

@techwhizbang
techwhizbang / README.md
Created January 22, 2019 22:50 — forked from tombigel/README.md
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:

@techwhizbang
techwhizbang / gist:1bcaf9628a909b8a6b56
Created August 24, 2014 15:06
rack_api_versioning example
map "/accounts" do
use RackApiVersioning::Middleware, :app_name => "awesome-app", :default_version => 1, :target_version => 2
run AccountsController
end
{:user {:compile-path ".out/",
:target-path ".dist/",
:clean-targets [:target-path :compile-path],
:mirrors {#".+" {:url "https://artifactory/repo"
:username ~(System/getenv "username")
:password ~(System/getenv "password")}},
@techwhizbang
techwhizbang / noctor_authentication
Created June 18, 2014 21:16
java.lang.IllegalArgumentException: No matching ctor found for class org.sonatype.aether.repository.Authentication
java.lang.IllegalArgumentException: No matching ctor found for class org.sonatype.aether.repository.Authentication
at clojure.lang.Reflector.invokeConstructor(Reflector.java:183)
at cemerick.pomegranate.aether$set_authentication.invoke(aether.clj:159)
at cemerick.pomegranate.aether$make_repository.invoke(aether.clj:179)
at cemerick.pomegranate.aether$mirror_selector$reify__141.getMirror(aether.clj:479)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:93)
@techwhizbang
techwhizbang / env_var_lein_project.clj
Created February 8, 2014 18:30
Difficulty reading environment variables in Leiningen project.clj
; consider this example
(let [_ (prn (System/getenv))]
(defproject your-clojure-app "1.0.0-SNAPSHOT"
:mirrors {#".+" {:url "https://internal.artifactory.repo.com/repo"
:username :env/artifactory_username
:password :env/artifactory_password}}))
; in the above example I confirm that the environment variables that I want
@techwhizbang
techwhizbang / gist:2008998
Created March 9, 2012 22:14
lobos alter :modify not working
(defmigration alter-ip-address-column-for-ipv6-20120125
(up []
(alter :modify
(table :notifications
(column :ip_address (data-type :varchar 45) :not-null))))
(down []
(alter :modify
(table :notifications
(column :ip_address (data-type :varchar 15))))))
@techwhizbang
techwhizbang / prepare.clj
Created January 18, 2012 21:33
Super long running Clojure shell commands
(ns my-app.db.prepare
(:use [clojure.java.shell :only [sh]]))
(defn -main []
"Will create the database if it does not exist yet for the specified environment"
(let [db-name "my_db"
db-user "root"
db-pass ""]
@techwhizbang
techwhizbang / selenium-grid.sh
Created October 28, 2011 17:34
Selenium Grid service script
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium-grid.pid
then
echo "Selenium Grid is already running."
else
java -jar /home/bkr/selenium/selenium-server-standalone-2.9.0.jar -port 5555 -role hub > /var/log/selenium/selenium-grid.log 2> /var/log/selenium/selenium-grid-error.log & echo $! > /tmp/selenium-grid.pid
echo "Starting Selenium Grid..."
@techwhizbang
techwhizbang / selenium-grid.sh
Created October 28, 2011 17:34
Selenium Grid service script
#!/bin/bash
case "${1:-''}" in
'start')
if test -f /tmp/selenium-grid.pid
then
echo "Selenium Grid is already running."
else
java -jar /home/bkr/selenium/selenium-server-standalone-2.9.0.jar -port 5555 -role hub > /var/log/selenium/selenium-grid.log 2> /var/log/selenium/selenium-grid-error.log & echo $! > /tmp/selenium-grid.pid
echo "Starting Selenium Grid..."
@techwhizbang
techwhizbang / injectable.rb
Created July 21, 2011 06:38
Ruby inject method implementation
require 'rubygems'
require 'rspec'
module Enumerable
def inject(*args, &block)
if(args.size == 2)
inject_binary_operation(args[0], args[1], self)
elsif(args.size == 1 && !block_given?)
inject_binary_operation(self.first, args[0], self.drop(1))
else