The following commands work on macOS High Sierra, not tested in previous versions
$ scutil --dns | grep 'nameserver\[[0-9]*\]'
pipeline { | |
agent any | |
stages { | |
stage('Build') { | |
steps { | |
sh 'docker build -t openjobs:latest .' | |
sh 'docker-compose build' | |
sh 'docker-compose run web bundle install' | |
sh 'docker-compose run web yarn' | |
sh 'docker-compose run -e RAILS_ENV=test --rm web bundle exec rake db:drop db:create db:migrate' |
#!/usr/bin/env python | |
import socket | |
import random | |
import itertools | |
import sys | |
HOSTS=["www.bbc.co.uk", "guardian.co.uk", "dailymail.co.uk", "reddit.com"] | |
request = ''' |
#!groovy | |
String GIT_VERSION | |
node { | |
def buildEnv | |
def devAddress | |
stage ('Checkout') { |
# host name of your docker server | |
HOST=host.net | |
# ip of your docker server | |
IP=0.0.0.0 | |
# days of validity for cert | |
DAYS=365 | |
default: | |
openssl genrsa -aes256 -out ca-key.pem 4096 | |
openssl req -new -x509 -days ${DAYS} -key ca-key.pem -sha256 -out ca.pem |
#include <sys/epoll.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include "chicken.h" | |
#define MAX_EVENTS 24 | |
extern void SCM_epoll_wait_cb(C_word vec); |
#! /bin/bash | |
d="$(mktemp -d)" | |
# Make a git repo with one file in it. | |
mkdir "$d/good" | |
cd "$d/good" | |
git init | |
echo good > file.txt | |
git add -A |
A quick overview of the node.js streams interface with basic examples.
This is based on @brycebaril's presentation, Node.js Streams2 Demystified
Streams are a first-class construct in Node.js for handling data.
Think of them as as lazy evaluation applied to data.
'use strict'; | |
// Dependencies | |
const gcloud = require('google-cloud', { | |
projectId: 'sara-bigquery', | |
keyfileName: 'keyfile.json' | |
}); | |
const vision = gcloud.vision(); | |
const fs = require('fs'); | |
const async = require('async'); |
fs.file-max = 1000000
net.ipv4.tcp_max_syn_backlog = 3240000
net.core.somaxconn = 3240000