Skip to content

Instantly share code, notes, and snippets.

@peihsinsu
peihsinsu / get-cpu-info.js
Created September 25, 2014 13:28
Get CPU info restful
var http = require('http');
var os = require('os');
http.createServer(function(req, res){
res.writeHead(200, {'Content-Type':'application/json'});
res.end(JSON.stringify(os.cpus()));
}).listen(3000);
@peihsinsu
peihsinsu / gce-snapshot.sh
Created September 19, 2014 13:38
GCE daily scheduling snapshot backup
#!/bin/bash
# Environments
export PATH=/root/google-cloud-sdk/bin:$PATH
# Daily create snapshot for "backup_path" listed disks
# And remove snapshot 1 week old before
# Create snap date
export DT=`date +%Y%m%d`