This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redis configuration file example. | |
# | |
# Note that in order to read the configuration file, Redis must be | |
# started with the file path as first argument: | |
# | |
# ./redis-server /path/to/redis.conf | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log /dev/log local0 | |
log /dev/log local1 notice | |
chroot /var/lib/haproxy | |
stats socket /run/haproxy/admin.sock mode 660 level admin | |
stats timeout 30s | |
maxconn 16384 | |
tune.ssl.default-dh-param 2048 | |
user haproxy | |
group haproxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const p = require('path'); | |
// const webpack = require('webpack'); | |
module.exports = { | |
// we are going to read from here | |
entry: p.resolve(__dirname, 'src/app.js'), | |
// where we gonna spit it out | |
output: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": [ | |
"plugin:import/errors", | |
"plugin:import/warnings" | |
], | |
"settings": { | |
"import/resolver": { | |
"node": { | |
"extensions": [".mjs", ".js", ".json"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title> React + Webpack + Babel </title> | |
<link href="http://fonts.googleapis.com/css?family=Roboto:400,300,700" rel="stylesheet" type="text/css"> | |
<link href="css/styles.css" rel="stylesheet" type="text/css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* ============================================================================================= | |
* A state container | |
* @exports {Object} Continer | |
* | |
* // in the very beginning | |
* const con = require('container.js') | |
* con.add('logger', new Logger('log')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @class QError | |
*/ | |
class QError extends Error { | |
/** | |
* @param {string} message | |
* @param {string} [type=error] | |
* @param {Object} [cause=null] - extra data for debugging | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Create ssh shortcut alias | |
""" | |
import boto3 | |
ec2 = boto3.client('ec2') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateOrUpsertMany(mongo, col, docs) { | |
const bulk = mongo.colection(col).initializeUnorderedBulkOp(); | |
docs.forEach(doc => { | |
bulk.find({ _id: doc._id }).upsert().updateOne({ $set: doc }); | |
}); | |
if (docs.length > 0) { | |
return bulk.execute() | |
.catch((ex) => { | |
if (ex.message.indexOf('E11000 duplicate key error collection') !== -1) { | |
return this.updateOrUpsertMany(mongo, col, docs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Setup for gathering metrices, debian based | |
required_env='AWS_REGION, MONITOR_DISKS, MACHINE_NAME'; | |
function checkEnv() { | |
echo "Checking $1" | |
local val=$(env | grep "$1") | |
echo $val |
OlderNewer