Skip to content

Instantly share code, notes, and snippets.

@rauluranga
rauluranga / script.sh
Created January 30, 2015 06:18
backup website
wget -erobots=off --no-parent --wait=3 --limit-rate=20K -r -p -U "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" -A htm,html,css,js,json,gif,jpeg,jpg,bmp,png http://example.com/
@rauluranga
rauluranga / script.sh
Created January 27, 2015 17:34
bump npm version
bumpversion -m 0.0.7 -lc 1 -p -x c
@rauluranga
rauluranga / logger.js
Created December 16, 2014 23:58
NodeJS log4js file
var log4js = require('log4js');
log4js.loadAppender('file');
log4js.addAppender(log4js.appenders.file('base.log'), 'baseLogger');
var logger = log4js.getLogger('baseLogger');
@rauluranga
rauluranga / video.sh
Created December 13, 2014 23:05
ffmpeg iPad video settings
ffmpeg -i INPUT -r FPS-VALUE -acodec aac -ac 2 -strict experimental -ab 160k -s 1024x768 -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 OUTPUT
@rauluranga
rauluranga / 0_reuse_code.js
Last active August 29, 2015 14:11
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rauluranga
rauluranga / composer
Created August 22, 2014 01:31
Ubuntu Composer install
$ curl -sS https://getcomposer.org/installer | php
$ mv composer.phar /usr/local/bin/composer
@rauluranga
rauluranga / Xdebug
Last active August 29, 2015 14:05
Xdebug installation Ubuntu
$ sudo apt-get install php5-xdebug
@rauluranga
rauluranga / LEMP
Last active December 14, 2021 00:33
Setting up LEMP
#/etc/nginx/sites-available/default
server {
listen 80 default; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
# Make site accessible from http://localhost/
server_name localhost;
server_name_in_redirect off;
@rauluranga
rauluranga / grub
Created July 10, 2014 16:17
prevent login hangout
//add this line to /etc/default/grub in your guest machine (Ubuntu)
GRUB_RECORDFAIL_TIMEOUT=2
//then run in your console:
//sudo update-grub
@rauluranga
rauluranga / server.coffee
Created March 7, 2014 19:34
Custom Brunch server with proxy support
express = require 'express'
sysPath = require 'path'
httpProxy = require 'http-proxy';
request = require 'request';
apiProxy = httpProxy.createServer({
target:'http://localhost:3000'
});