- install mosca
- admin user should have read permission on /etc/mosca
- admin user should have write permission on /var/log/mosca
- copy
config.json and credentials.json
to /etc/mosca
$ sudo npm install -g mosca
From https://gist.github.com/3050224
From http://blog.smartcore.net.au/smartos-the-basics/
# Path to your oh-my-zsh installation. | |
export ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="build47" | |
# ZSH_THEME="bureau" |
n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local |
$ g++ -std=c++0x -fexceptions -dM -E -c ast.cpp | |
#define sa_sigaction _funcptr._sigaction | |
#define __CORRECT_ISO_CPP_STDLIB_H_PROTO 1 | |
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 808 | |
#define __DBL_MIN_EXP__ (-1021) | |
#define _STL_PAIR_H 1 | |
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 806 | |
#define HUGE_VAL (__builtin_huge_val()) | |
#define M_SQRT1_2 0.70710678118654752440 | |
#define _SYS_FEATURE_TESTS_H |
// from: http://www.slideshare.net/Couchbase/reactive-programmingrxjavaefficientdata-benchristensenmichaelnitschinger/75 | |
Observable | |
.defer(() -> bucket.get("id")) | |
.retryWhen(attempts -> attempts | |
.zipWith(Observable.range(1,3), (n, i) -> i) | |
.flatMap(i -> { | |
System.out.println("Delaying retry by " + i + " second(s)"); | |
return Observable.timer(i, TimeUnit.SECONDS) | |
}) |
// You'll need configuration like this to get MongoDB up and running with Grails on AppFog | |
// This config will also work locally | |
grails { | |
def vcap = System.env.VCAP_SERVICES | |
def credentials = vcap ? grails.converters.JSON.parse(vcap)["mongodb-1.8"][0]["credentials"] : null | |
mongo { | |
host = credentials ? credentials.hostname : "localhost" | |
port = credentials ? credentials.port : "27017" | |
username = credentials ? credentials.username : null |
<?xml version="1.0"?> | |
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> | |
<service_bundle type="manifest" name="pm2"> | |
<service name="application/pm2" type="service" version="1"> | |
<create_default_instance enabled="true"/> | |
<single_instance/> |
# file: plugins/dicecourse/observers/post_dice_observer.rb | |
class PostDiceObserver < ActiveRecord::Observer | |
observe :post | |
def after_create(model) | |
Rails.logger.debug "After Create on Post triggered" | |
#roll some dice | |
end | |
end |
set-option -g prefix C-s | |
unbind-key C-b | |
set -g default-terminal "xterm-256color" | |
set-option -g mouse-select-pane on | |
set-option -g mouse-resize-pane on | |
set-option -g mouse-utf8 on | |
set-option -g mouse-select-window on | |
set-window-option -g mode-mouse on |