Skip to content

Instantly share code, notes, and snippets.

View thebapi's full-sized avatar

Sajib Sarkar thebapi

View GitHub Profile
@thebapi
thebapi / gist:f6e7aa3074a10c070f5a
Last active August 29, 2015 13:58
NGinx setup with nodejs in ubuntu 12
server {
listen 80;
server_name testproject.local
charset utf-8;
reset_timedout_connection on;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Installing NODEJS on Ubuntu 14 LTE
Steps to follow :
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get install build-essential libssl-dev
sudo apt-get update
sudo apt-get install nodejs
@thebapi
thebapi / BasicWebappCreator
Last active August 29, 2015 14:03
Create a basic webapp using HTML5 Boilerplate, jQuery, Modernizr, and Bootstrap.
sudo npm install -g generator-gulp-webapp
mkdir myOwnApp
cd myOwnApp
yo gulp-webapp
gulp
gulp serve
gulp test
@thebapi
thebapi / CheckBoxGroupedSelectableModelForComboBox
Created July 9, 2014 06:57
turn combo boxes to a checkbox style
Ext.define('MLPI.shared.ux.plugins.CheckBoxGroupedSelectableModelForComboBox', {
extend: 'Ext.AbstractPlugin',
requires: [
'Ext.AbstractPlugin'
],
alias: 'plugin.checkboxgroupedselectionmodelforcombobox',
init: function (combo) {
var displayFieldName = combo.displayField, me = this;
Ubuntu problems ::
warning: Setting locale failed
Solution :
sudo locale-gen en_US.UTF-8
export LC_ALL="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
@thebapi
thebapi / gist:a28d4a8470f0278d59ab
Last active August 29, 2015 14:06
MongoDB Data conversion example
use ets;
db.orgs.remove({_id: {$in: [ ObjectId('507ba4947b2bc5d8eee92c59'), ObjectId('507ba5427b2bc5d8eee92c5d'), ObjectId('50d2089cb3a7231c0400001b') ]}})
db.subscriptions.remove({billingEmail: 'a.fats@gmail.com'})
db.users.remove({userName: 'a.fats@gmail.com'});
use mlpishared;
db.videoClipStandard.remove({_id: {$in: [ ObjectId('517ad2d7465ae88815000002') , ObjectId('517e2448b496200c19000001') ]}});
var clips = db.videoClips.find({}).toArray();
clips.forEach(function (item) {
delete item.submittedBy;
@thebapi
thebapi / gist:5cb7586bf40715425dbc
Created September 18, 2014 13:29
Creating a new SSL key and cer file
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
rm csr.pem
@thebapi
thebapi / Angular-gulp-webapps
Created September 20, 2014 08:59
Setup of Gulp Angularjs App
npm install -g generator-gulp-angular
yo gulp-angular
var http = require('http'),
https = require('https'),
fs = require("fs"),
httpProxy = require('http-proxy'),
util = require("util");
var httpOptions = {
@thebapi
thebapi / gist:3945227be6cee06ca47d
Created November 5, 2014 10:01
Ububtu server ip forwarding....
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000
then install iptables-persistent which will persist the rules
sudo apt-get install iptables-persistent -y