Skip to content

Instantly share code, notes, and snippets.

View ajoyoommen's full-sized avatar

Ajoy Oommen ajoyoommen

View GitHub Profile
@ajoyoommen
ajoyoommen / 1_Install_Required
Last active August 29, 2015 14:21
Prepare Amazon AMI for Django, NGINX, PostgreSQL
sudo yum install nginx htop git gcc
ssh-keygen
sudo yum install postgresql93 postgresql93-devel postgresql93-server python27-devel
@ajoyoommen
ajoyoommen / app.js
Created June 3, 2015 05:34
Ionic PushPlugin project
var exapp = angular.module('exapp',
['ionic',
'ui.select2',
'exapp.controllers',
'exapp.services']);
exapp.run(function($ionicPlatform, $state, Notifications, geo) {
$ionicPlatform.ready(function() {
if (window.cordova && window.plugins.backgroundGeoLocation) {
geo();
@ajoyoommen
ajoyoommen / index.js
Created August 22, 2015 06:53
Initializing Cordova Project with PushPlugin
var Project = {};
var app = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
@ajoyoommen
ajoyoommen / file_sizes.sh
Created December 16, 2015 10:18
List the size of all files and the folders in a directory in linux. Accepts a command line argument of the directory to scan
du -BM --max-depth=1 $1 | sort -n -r
http://www.jdd.nu/data/files/dot.emacs
@ajoyoommen
ajoyoommen / Git-Prompt - Append to bashrc
Last active June 23, 2019 12:47
Show user and git branch on terminal prompt
# Append this code to ~/.bashrc
# colors!
green="\[\033[0;32m\]"
blue="\[\033[0;34m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"
# Change command prompt
source ~/git-prompt.sh
@ajoyoommen
ajoyoommen / celery.sh
Last active July 12, 2016 08:43
Simple Celery script
if [ -n "$1" ]; then
if [ $1 == "kill" ]; then
kill -9 `ps aux |grep projectname |grep celery |awk '{ print $2 }'`
elif [ $1 == "list" ]; then
ps aux |grep projectname |grep celery
elif [ $1 == "start" ]; then
cd projectname/
source venv/bin/activate
source env.sh
celery -A projectname worker -l info
@ajoyoommen
ajoyoommen / kill.sh
Last active December 22, 2023 20:03
Kill gunicorn daemon
kill -9 `ps aux |grep gunicorn |grep projectname | awk '{ print $2 }'`
@ajoyoommen
ajoyoommen / emacs.el
Created October 7, 2016 09:00
Emacs configuration files
;; Disbale CTRL Z
(global-unset-key (kbd "C-z"))
;; Show line number and column number at bottom
(setq line-number-mode t)
(setq column-number-mode t)
;; setup package repositories
(when (>= emacs-major-version 24)
(require 'package)
@ajoyoommen
ajoyoommen / indian_states_cities.json
Created November 18, 2016 06:29
A Django DB dump of list of 1216 cities and 34 states (including union territories) in India
[
{
"model": "stores.state",
"pk": 1,
"fields": {
"country": 1,
"name": "Delhi"
}
},
{