Milliseconds in your Timestamps.
We got 'em, you want 'em.
Shit needs to be PRECISE
MIT
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); |
#!/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 |
IO.foreach("./test.csv") do |line| | |
# Remove trailing whitespace. | |
line.chomp! | |
# Split on comma. | |
values = line.split(",") | |
# Write results. | |
IO.write("/tmp/testfile", values.join("+") << "... " << String(values.length) << "\n", mode: 'a') |
sudo apt-get install libpq-dev
gem install pg -v '0.18.4'
# add gem 'pg' to Gemfile
bundle install