This file contains hidden or 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
| 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 | |
| ----------------------------------------------------------------------------- |
This file contains hidden or 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
| vim /etc/ssh/sshd_config | |
| # Change Port 22 to a number you prefer | |
| # Reboot machine |
This file contains hidden or 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
| 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); | |
| }); |
This file contains hidden or 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
| vim /etc/timezone | |
| ----------------------------------------------------------------------------- | |
| Asia/Manila | |
| ----------------------------------------------------------------------------- | |
| export TZ=Asia/Manila |
This file contains hidden or 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 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() + ''; |
This file contains hidden or 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 s4() { | |
| return Math.floor((1 + Math.random()) * 0x10000) | |
| .toString(16) | |
| .substring(1); | |
| }; | |
| function guid() { | |
| return s4() + s4() + '-' + s4() + '-' + s4() + '-' + | |
| s4() + '-' + s4() + s4() + s4(); | |
| } |
This file contains hidden or 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
| $.fn.serializeObject = function () { | |
| var o = {}; | |
| var a = this.serializeArray(); | |
| $.each(a, function () { | |
| if (o[this.name] !== undefined) { | |
| if (!o[this.name].push) { | |
| o[this.name] = [o[this.name]]; | |
| } | |
| o[this.name].push(this.value || ''); | |
| } else { |
This file contains hidden or 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
| <!-- Append to pom.xml --> | |
| <dependency> | |
| <groupId>com.thetransactioncompany</groupId> | |
| <artifactId>cors-filter</artifactId> | |
| <version>1.8</version> | |
| </dependency> | |
| <!-- Append to web.xml --> | |
| <filter> |
This file contains hidden or 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
| .DS_Store | |
| .lock-wscript | |
| .komodotools | |
| .classpath | |
| .settings | |
| .project | |
| .dropbox | |
| .tmproj | |
| .grunt | |
| .cache |
This file contains hidden or 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
| #!/bin/sh | |
| echo "\n Killing the cat..." | |
| /etc/init.d/tomcat7 stop | |
| echo "\n Removing internal organs..." | |
| rm -rf /var/lib/tomcat7/webapps/ROOT | |
| rm -rf /var/lib/tomcat7/webapps/ROOT.war | |
| echo "\n Placing new organs..." |