Skip to content

Instantly share code, notes, and snippets.

View jerryjohnjacob's full-sized avatar

Jerry John Jacob jerryjohnjacob

View GitHub Profile
@jerryjohnjacob
jerryjohnjacob / pg-ubuntu-1204
Last active October 5, 2016 13:52
Postgresql on Ubuntu 12.04
sudo apt-get install postgresql postgresql-contrib libpgsql-ruby libpgtcl-dev postgresql-server-dev-9.x
@jerryjohnjacob
jerryjohnjacob / rvm-ruby-rails-pg
Created November 19, 2014 12:12
Setting up RVM, Ruby, Rails and PG
sudo apt-get update
sudo apt-get upgrade
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source /home/vagrant/.rvm/scripts/rvm
gem install rails
sudo apt-get install postgresql postgresql-contrib libpgsql-ruby libpgtcl-dev postgresql-server-dev-9.3
task :environment do
require './dj-sinatra'
end
namespace :jobs do
desc "Clear the delayed_job queue."
task :clear => :environment do
Delayed::Job.delete_all
end
@jerryjohnjacob
jerryjohnjacob / 00.howto_install_phantomjs.md
Created January 4, 2016 11:19 — forked from julionc/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@jerryjohnjacob
jerryjohnjacob / all-lein-templates.txt
Created June 28, 2016 09:28 — forked from anonymous/all-lein-templates.txt
for i in {1..28} ; do lein search lein-template $i ; done | grep '^\[' | perl -pe 's,^\[,,; s,/.*?],:,' | sort | uniq -c | tee all-lein-templates.txt
1 acorn: A Leiningen template for a ClojureScript setup with Figwheel, Austin, Om.
8 amp: Leiningen template for AMP (Alfresco Module Package) projects.
1 angular-cl2: A Leiningen template for using AngularJS and ChlorineJS
1 angular: Clojure and AngularJS in perfect harmony.
6 angular: Clojure and AngularJS in perfect harmony. $ lein new angular <name>
2 angularjs-app: Leiningen template for web application with http-kit and angularjs
5 angular-simple: Clojure and AngularJS $ lein new angular-simple <name>
1 aperiodic-cljs: My cljs development starting point. Basically ripped from lein-cljsbuild.
1 apijr: clojurescript project template
1 appfgo: 'lein new' template for Funcgo application
@jerryjohnjacob
jerryjohnjacob / pkcs12_to_pem_script.sh
Last active July 19, 2018 21:49
Extracting keys from pkcs12
openssl pkcs12 -in certificates/cert.p12 -out certificates/cert.pem -clcerts -nokeys
openssl pkcs12 -in certificates/cert.p12 -out certificates/key.pem -nocerts -nodes
openssl pkcs12 -in certificates/cert.p12 -out certificates/ca.cert -cacerts -nodes
@jerryjohnjacob
jerryjohnjacob / psql_utf8_encoding_fix.txt
Last active October 5, 2016 15:46
Change postgres default template0 to UTF8 encoding
mike@rbci:~$ psql -U postgres
psql (9.0.3)
Type "help" for help.
postgres=# update pg_database set datallowconn = TRUE where datname = 'template0';
UPDATE 1
postgres=# \c template0
You are now connected to database "template0".
template0=# update pg_database set datistemplate = FALSE where datname = 'template1';
UPDATE 1
@jerryjohnjacob
jerryjohnjacob / upgrade_postgres.sh
Created October 6, 2016 16:33
Easy upgrade to postgres 9.6 with data migration
sudo su postgres
pg_dumpall > full_backup
exit
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql postgresql-contrib libpgsql-ruby libpgtcl-dev postgresql-server-dev-9.6
# remove older postgres installation
@jerryjohnjacob
jerryjohnjacob / base_karma.conf.js
Created November 23, 2016 05:56
Basic Karma config for testing JS in a Rails project using Jasmine
// Karma configuration
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use