sudo apt-get install -y sysv-rc-conf
sudo add-apt-repository -y ppa:nginx/stable
var crypto = require('crypto') | |
var cipher = function(key, plaintext){ | |
console.log('cipher::init') | |
var cipher = crypto.createCipher('aes-256-cbc', key) | |
var encriptedText = cipher.update(plaintext, 'utf8', 'hex') |
var co = require('co') | |
var bcrypt = require('bcrypt') | |
var moment = require('moment') | |
var Promise = require('bluebird') | |
var bSalt = Promise.promisify(bcrypt.genSalt) | |
var bHash = Promise.promisify(bcrypt.hash) | |
var passphrase = moment().format('YYYY[RandomString]MMDDHH') | |
console.log('passphrase =',passphrase) |
#!/bin/bash | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
SSL_FOLDER="../ssl" | |
if [ -d "$SSL_FOLDER" ]; then | |
echo "ssl folder existed" |
#!/bin/bash | |
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge |
// npm install --save split-file | |
// https://github.com/tomvlk/node-split-file | |
var sf = require('split-file'); | |
sf.splitFile('unicorn.png', 10, function(err, names) { | |
if(err) return console.log(err); | |
console.log(names); | |
sf.mergeFiles(names, 'unicorn.merge.png', function(err, outputFile) { | |
if(err) return console.log(err); |
#cloud-config | |
hostname: yourcorename | |
coreos: | |
etcd: | |
addr: $public_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
units: | |
- name: etcd.service |
#!/bin/bash | |
# https://github.com/moovweb/gvm/issues/155 | |
gvm install go1.4 | |
gvm use go1.4 | |
export GOROOT_BOOTSTRAP=$GOROOT | |
gvm install go1.5 |