Skip to content

Instantly share code, notes, and snippets.

View joedevivo's full-sized avatar
💻
commands

Joe DeVivo joedevivo

💻
commands
View GitHub Profile
#!/usr/bin/env emacs --script
;; should likely be called with 2</dev/null to suppress the various
;; output to the shell.
;; I think that this is going to fail non-emacs24 installs, since
;; 'package isn't installed by default there. You'll see this error:
;; "Symbol's function definition is void: package-initialize"
;; `brew install emacs` should fix you up, though.
(package-initialize)
@jaredmorrow
jaredmorrow / smartos-versions.md
Last active December 14, 2015 00:38
Which SmartOS package to use

SmartOS albeit powerful, makes some easy things like figuring out a "version" of SmartOS very difficult and confusing. To someone like Basho who makes packages for SmartOS, it is enough to drive us (me) insane trying to figure out how to label the packages.

The problem lies in trying to define the version at all. Is the version you care about listed in uname -a? How about a file in /etc/ that tells you? The answer to bolth of those questions is "no". uname -v gives you a string like joyent_20130125T031721Z The only file in /etc/ that comes close is pkgsrc_version, but that is only sometimes available on the system. The real answer is a combination of the Global Zone snapshot version and the pkgsrc version in the guest zones.


So how do I label my packages for SmartOS?

With the uname -v example above, joyent_20130125T031721Z describes the global zone, and has some influence on how apps run, but not enough to determine which package will work on which system. Plus I d

@vinoski
vinoski / fd_setsize_on_osx.md
Last active November 7, 2017 06:20
How to raise the maximum number of file descriptors when building Erlang/OTP on OS X.

When you build Erlang/OTP on OS X, it unfortunately defaults to handling a maximum of 1024 file descriptors. You can get around this limitation with the right combination of configuration options and manual changes to a generated config file.

First, go into your unpacked Erlang/OTP source directory and run the following command, replacing the value 10000 with whatever value you want for max file descriptors:

perl -i -pe 's/(define\s+FD_SETSIZE\s+)\d+/\1 10000/' erts/config.h.in 

Next, when you run configure in your Erlang/OTP source directory, be sure to include the right CFLAGS setting, as shown below:

CFLAGS='-DREDEFINE_FD_SETSIZE -DFD_SETSIZE=15000 -D_DARWIN_UNLIMITED_SELECT' ./configure --enable-kernel-poll <other options>
@puffnfresh
puffnfresh / SpacesDemo.m
Created November 11, 2012 07:19
Demo of Spaces API discovered via reverse engineering
#include <Carbon/Carbon.h>
typedef uint64_t CGSConnection;
extern CGSConnection _CGSDefaultConnection(void);
#define CGSDefaultConnection _CGSDefaultConnection()
typedef uint64_t CGSSpace;
typedef enum _CGSSpaceType {
kCGSSpaceUser,
kCGSSpaceFullscreen,