Skip to content

Instantly share code, notes, and snippets.

View AKNiazi's full-sized avatar

Abdullah Khan AKNiazi

  • Lahore Pakistan
View GitHub Profile
@AKNiazi
AKNiazi / native script
Last active November 1, 2016 15:22
Commands for native Script
tns doctor (to check everything installed is Ok)
tns create my-app-name --ng (to create new app from scratch)
tns platform add android (to add android platform in the app)
tns run android --emulator (to run with an emulator)
tns run android (to run with a device)
tns livesync android --watch or tns livesync android --emulator --watch
1. How to check one index mappings i.e which fields are mapped
curl -XGET 'http://localhost:9200/_mapping?pretty=true'
2. Delete index
$ curl -XDELETE 'http://localhost:9200/journeys/' where journeys is the index name
@AKNiazi
AKNiazi / Runing resque in backgound manually
Created July 14, 2015 21:58
Runing resque in backgound manually
PIDFILE=./resque.pid BACKGROUND=yes QUEUE="*" rake resque:work >> worker1.log &
PIDFILE=./resque-scheduler.pid BACKGROUND=yes QUEUE="*" rake resque:scheduler
@AKNiazi
AKNiazi / Manual Deployment with nginx and puma
Last active September 2, 2016 17:18
Manual Deployment with nginx and puma
Link I used i the following steps is https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04 and this link http://ruby-journal.com/how-to-setup-rails-app-with-puma-and-nginx/
Also a useful link to do this properly is http://nicolas-brousse.github.io/ubuntu-install-and-tips/pages/installation/rails-puma/
1. Install DBMS (postgre, mysql) and install rvm, ruby, rails and there dependencies
2. clone the git repository to any location ideally in home
3. cd myapp
@AKNiazi
AKNiazi / install_nginx
Last active August 29, 2015 14:22
Different Userful Tutorial to Install Deploy Rails with Nginx
https://www.digitalocean.com/community/tutorials/how-to-automate-ruby-on-rails-application-deployments-using-capistrano
https://gist.github.com/sathishmanohar/5491263
https://github.com/JasonGiedymin/nginx-init-ubuntu
#states how to start nginx if nginx is installed with different scenarios.
@AKNiazi
AKNiazi / import _from_heroku
Created December 19, 2014 07:10
Import Data from Heroku to Local Machine
IMPORTING DATA FROM HEROKU TO LOCAL MACHINE
Install the Heroku Backup tool
$ heroku addons:add pgbackups
Start using it
$ heroku pgbackups:capture
Download the remote db on Heroku (to your local machine) using curl
@AKNiazi
AKNiazi / Deployment Steps Amazon EC2
Created October 1, 2014 05:51
Steps to deploy Ruby on Rails Apps on Amazon EC2 with postgresSql
1. Log in to the AWS console. (First you should create account on Amazon)
2. Create key pair
3. Create elastic IP
4. Make new instance of the aws manually.
5. Create the ppk key from the .pem key.
6. Login to the putty give the public ip to in the host and also add the putty key file in the auth/ssh
7. Provide ubuntu as the user name.
Now after the login
A- Install required ruby version using RVM