Skip to content

Instantly share code, notes, and snippets.

View Unitech's full-sized avatar

Alexandre Strzelewicz Unitech

View GitHub Profile
@YutaroHayakawa
YutaroHayakawa / report.lua
Created October 10, 2016 14:10
Lua script for formatting output of wrk to csv
done = function(summary, latency, requests)
-- open output file
f = io.open("result.csv", "a+")
-- write below results to file
-- minimum latency
-- max latency
-- mean of latency
-- standard deviation of latency
-- 50percentile latency
@alavit-d
alavit-d / README.md
Last active August 31, 2016 17:25
Setup dhcp for Rig

#Setup dhcp for Rig

  • Set static IP on network: ex on enxf01e34002108: sudo ifconfig enxf01e34002108 192.168.50.0
  • Setup file in /etc/dhcp/dhcpd.conf - as options routers ip set IP getting net access
  • Setup correct interface in /etc/default/isc-dhcp-server
  • sudo service isc-dhcp-server restart
  • sudo service isc-dhcp-server status
  • for debug: sudo tcpdump -n -i enxf01e34002108 port bootps or port bootpc
  • for DNS using the google DNS: add /etc/resolvconf/resolv.conf.d/tail
@DarrenN
DarrenN / get-npm-package-version
Last active June 16, 2024 05:49 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@jeffwhelpley
jeffwhelpley / gist:056e012544c631438ad2
Created July 12, 2015 02:06
playing nice: continuation-local-storage, hapi.js and pm2

I had a lot of issues trying to get continuation-local-storage (cls) working on a hapi.js app with pm2 in cluster_mode. Long story short, my mistake was wrapping cls around my server.start() when I should have been running it in a request handler. Here is the code you should use to get all this working:

var cls = require('continuation-local-storage');
var ns = cls.createNamespace('mySession');

var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({ port: 80 });
@Unitech
Unitech / bootstrap
Last active February 9, 2018 15:22
PM2 / Keymetrics for Heroku/Rackspace/Joyent/Amazon Elasticbeanstalk/Azure...
http://pm2.keymetrics.io/docs/usage/use-pm2-with-cloud-providers/
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@constantology
constantology / process.logger.js
Created July 24, 2014 09:39
using node's process to emit events to log stuff from anywhere
// use like this:
// process.emit( 'app:log', module, arg1, arg2, ..., argN );
var Module = require('module');
function logConsole(method, module) {
var args = [(new Date()).toJSON(), method];
var index = 1;
if (module instanceof Module) {

Migrating to RethinkDB 1.12

There are a number of breaking changes in RethinkDB 1.12 you should be aware of before migrating.

Data migration

First, make sure to go through the regular data migration process, since the 1.12 file format isn't compatible with file formats generated by previous versions of RethinkDB.

Then, replace group_by and grouped_map_reduce commands in your applications with the new group command.

#!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = """
---
author: Aiko Mastboom
module: pm2.py
short_description: nodeJS pm2 wrapper
description:
- This module helps managing processes using pm2 on hosts
@denji
denji / http-benchmark.md
Last active June 20, 2024 14:22
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)