Skip to content

Instantly share code, notes, and snippets.

@jedi4ever
jedi4ever / challenge.md
Last active September 9, 2020 21:03
Example of creating a Wordpress challenge in Markdown & Mustache

Wordpress Setup

This challenge will see if you can setup and configure a wordpress correctly.

Wordpress is great!

Hardware

Ubuntu

The hardware used will be an Ubuntu machine.

  • os: ubuntu
@jedi4ever
jedi4ever / gist:6247941
Last active December 21, 2015 04:18
Yow Conference - Talk Proposal - "How to make operations love Nodejs Apps"

Title:

How to make operations love Nodejs Apps

One little typo for Dev-kind, one big failure for Ops

(or vice versa if that makes more sense)

Abstract:

One little typo, is all what it takes to break a nodejs program. From an operational side, this doesn't give you much confidence.

Much of the documentation on nodejs out there is focused on building websites with Express and the Secret Sauce 'Socket.IO' and friends. Documentation on non-functional aspects, is sparse and more fragmented.

@jedi4ever
jedi4ever / nodejs-cluster-zero-downtime.md
Last active July 26, 2024 14:01
nodejs clustering, zero downtime deployment solutions

Clustering: The basics

The trick? pass the file descriptor from a parent process and have the server.listen reuse that descriptor. So multiprocess in their own memory space (but with ENV shared usually)

It does not balance, it leaves it to the kernel.

In the last nodejs > 0.8 there is a cluster module (functional although marked experimental)

@jedi4ever
jedi4ever / comparing statsd nodejs clients.md
Last active December 20, 2015 04:09
Comparing nodejs statsd clients (24/07/2013)
@jedi4ever
jedi4ever / dns tuning ssh login speedup vagrant
Created May 27, 2013 13:37
speeding up DNS/SSH connections in vagrant
- Tune /etc/ssh/sshd_config
UseDNS no # Disable DNS lookups
GSSAPIAuthentication no # Disable negotation of slow GSSAPI
don't forget to restart it, use a script provider to set it , or create it with veewee or snapshot it
- Tune Vagrantfile
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
@jedi4ever
jedi4ever / gist:5590952
Last active December 17, 2015 09:58
growl - nodejs - mocha
Get free version of growl - http://www.macupdate.com/app/mac/41038/growl-fork
From notes on - <https://github.com/visionmedia/node-growl>
$ sudo gem install terminal-notifier
$ npm install growl
$ ./node_modules/mocha/bin/mocha --require test/common.js -G
Simple guard-nodejs like :
@jedi4ever
jedi4ever / Compiling_Nodejs_Single_File.md
Last active October 10, 2020 15:12
Notes on compiling/packaging a node.js projects as a single binary

Compiling plain javascript (no external modules)

So we got nexe to compile nodejs projects to an executable binary:

  • it downloads the nodejs source
  • it creates a single file nodejs source (using sardines )
  • it monkey patches the nodejs code to include this single file in the binary (adding it to the lib/nexe.js)

$ nexe -i myproject.js -o myproject.bin -r 0.10.3

Caveats:

  • I had an issue with unicode chars that got converted: it uses uglify.js and this needs to be configured to leave them alone
#!/bin/bash -e
export TERM=xterm
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Use the correct ruby
rvm install ruby-1.9.2-p320
rvm use 1.9.2@veewee-test-1 --create
# Do any setup
# e.g. possibly do 'rake db:migrate db:test:prepare' here
bundle install
export VEEWEE_SSH_TIMEOUT=600
@jedi4ever
jedi4ever / gist:5023486
Created February 24, 2013 11:27
Template veewee ci build job
#!/bin/bash -e
export TERM=xterm
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Use the correct ruby
rvm install ruby-1.9.2-p320
rvm use 1.9.2@veewee-test-1 --create
# Do any setup
bundle install
export VEEWEE_SSH_TIMEOUT=600
export VEEWEE_CPU_COUNT=4
@jedi4ever
jedi4ever / chef.sh
Last active December 13, 2015 22:28
Example chef install script - veewee
if [ -f .veewee_params ]
then
. .veewee_params
fi
if [ -z "$CHEF_INSTALLMETHOD" ]; then
export CHEF_INSTALLMETHOD="gems"
fi
# Installing chef