Skip to content

Instantly share code, notes, and snippets.

@tylerflint
tylerflint / app.config
Created March 19, 2014 04:35
erlang release config
[{lager,
[{error_logger_hwm,100},
{crash_log_count,5},
{crash_log_date,"$D0"},
{crash_log_size,10485760},
{crash_log_msg_size,65536},
{crash_log,"./log/crash.log"},
{colored,true},
{handlers,
[{lager_console_backend,info},
@tylerflint
tylerflint / gist:9570175
Created March 15, 2014 16:41
Elixir dsl/macro discovery

dsl

In this experiment, I'm attempting to create a dsl that will allow me to

  • execute a dsl in the module definition
  • store data in the module (similar to Ruby's class instance variables)
  • fetch the data stored in the module from within a function defined inside of that module

Here is an example module that uses the dsl:

@tylerflint
tylerflint / gist:8428612
Created January 15, 2014 00:24
mdb -k unix.0 vmcore.0
> ::status
debugging crash dump vmcore.0 (64-bit) from private-hypervisor-2
operating system: 5.11 joyent_20131029T054044Z (i86pc)
image uuid: (not set)
panic message: BAD TRAP: type=e (#pf Page fault) rp=ffffff00f4bbce40 addr=0 occurred in module "<unknown>" due to a NULL pointer dereference
dump content: kernel pages only
> ::stack
av_dispatch_autovect+0x95(d1)
dispatch_hilevel+0x20(d1, 0)
switch_sp_and_call+0x13()
# Default rules for rsyslog.
#
# For more information see rsyslog.conf(5) and /etc/rsyslog.conf
#
# First some standard log files. Log by facility.
#
# pagodabox internal logger
local0.* @logvac.pagodabox.com:514
auth,authpriv.* /var/log/auth.log
@tylerflint
tylerflint / gist:3452012
Created August 24, 2012 15:30
escript format
#!/usr/bin/env escript
main([]) ->
Fun = fun(e) ->
ok.
lists:foreach(Fun, lists:seq(1, 10000)).
@tylerflint
tylerflint / gist:3350786
Created August 14, 2012 16:48
culture helpers
# tell bundler to use a local copy of kernel-culture when developing locally
$ bundle config local.kernel-culture PATH
# -- FROM WITHIN THE CULTURE GEM --
# generate a new culture
rails g culture CULTURE
# generate a new family
@tylerflint
tylerflint / gist:2770151
Created May 22, 2012 16:41
pow dns hijack
# Lovingly generated by Pow
nameserver 127.0.0.1
port 20560
@tylerflint
tylerflint / gist:1848008
Created February 16, 2012 21:30
Boxfile.install
web1:
after_build:
# If we don't have a database config file yet then we'll copy the one from installer/assets
- "[ -f 'system/cms/config/database.php' ] || mv 'installer/assets/config/dynamic_database.php' 'system/cms/config/database.php'"
after_deploy:
# All files are in place and the database connection is ready. Run the install
@tylerflint
tylerflint / gist:1783678
Created February 9, 2012 22:05
Boxfile example with simple mv after_build
web1:
after_build:
- "mv wp-config-pagoda.php config-pagoda.php"
@tylerflint
tylerflint / gist:1783666
Created February 9, 2012 22:04
Simple bash mv example
#!/usr/bin/env bash
mv wp-config-pagoda.php config-pagoda.php