Skip to content

Instantly share code, notes, and snippets.

@identityclash
identityclash / yyyyMMddHHmmssSSS_Timestamp.js
Created November 11, 2015 06:08 — forked from genediazjr/yyyyMMddHHmmssSSS_Timestamp.js
A simple yyyyMMddHHmmssSSS timestamp generator
function getTimestamp () {
var date = new Date();
var year = date.getFullYear();
var month = (date.getMonth() + 1) + '';
var day = date.getDate() + '';
var hr = date.getHours() + '';
var min = date.getMinutes() + '';
var sec = date.getSeconds() + '';
var ms = date.getMilliseconds() + '';
@identityclash
identityclash / debian-update-timezone.sh
Created November 11, 2015 06:09
Modify the timezone on Debian
vim /etc/timezone
-----------------------------------------------------------------------------
Asia/Manila
-----------------------------------------------------------------------------
export TZ=Asia/Manila
@identityclash
identityclash / sockjs-ws.js
Created November 11, 2015 06:10 — forked from genediazjr/sockjs-ws.js
Basic sockjs server and with ssl
var sockjs = require('sockjs');
var server = require('http').Server();
var socket = sockjs.createServer({sockjs_url: 'https://cdnjs.cloudflare.com/ajax/libs/sockjs-client/0.3.4/sockjs.min.js'});
socket.on('connection', function (conn) {
console.log('new connection id:' + conn.id);
conn.on('close', function () {
console.log('connection closed id:' + conn.id);
});
@identityclash
identityclash / debian-change-ssh-port.sh
Created November 11, 2015 06:10
Change SSH Port on Debian
vim /etc/ssh/sshd_config
# Change Port 22 to a number you prefer
# Reboot machine
@identityclash
identityclash / debian-increase-memory.sh
Created November 11, 2015 06:10 — forked from genediazjr/debian-increase-memory.sh
Increase Memory on Debian
dd if=/dev/zero of=/swapfile1 bs=1024 count=524288
mkswap /swapfile1
chown root:root /swapfile1
chmod 0600 /swapfile1
swapon /swapfile1
nano /etc/fstab
-----------------------------------------------------------------------------
/swapfile1 swap swap defaults 0 0
-----------------------------------------------------------------------------
@identityclash
identityclash / debian-tomcat.sh
Created November 11, 2015 06:10 — forked from genediazjr/debian-tomcat.sh
Tomcat port 80 on Debian
apt-get update
apt-get upgrade
apt-get install vim make g++ openjdk-7-jdk tomcat7 fastjar unzip
cd /usr/share/tomcat7/lib/
-----------------------------------------------------------------------------
jar xf catalina.jar org/apache/catalina/util/ServerInfo.properties
server.info=Apache
@identityclash
identityclash / debian-nodejs.sh
Created November 11, 2015 06:10 — forked from genediazjr/debian-nodejs.sh
Nodejs on Debian
apt-get install vim python g++ make checkinstall
src=$(mktemp -d) && cd $src
wget -N http://nodejs.org/dist/node-latest.tar.gz
tar xzvf node-latest.tar.gz && cd node-v*
./configure
@identityclash
identityclash / debian-nginx-php.sh
Created November 11, 2015 06:11 — forked from genediazjr/debian-nginx-php.sh
Nginx w/ PHP on Debian
apt-get install vim nginx php5-fpm php5-xcache
php5-sqlite sqlite3
php5-mysql mysql-server mysql-client
vim /etc/nginx/nginx.conf
-----------------------------------------------------------------------------
server_tokens off;
-----------------------------------------------------------------------------
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}
@identityclash
identityclash / ixgbevf-upgrade.sh
Created November 11, 2015 06:13
ixgbevf 2.16.1 upgrade for AWS EC2 SR-IOV "Enhanced Networking" on Ubuntu 14.04 (Trusty) LTS
ssh ubuntu@n.n.n.n "bash -s -x" -- <ixgbevf-upgrade.sh