Updating play framework secret key for your application

Updating the application secret in application.conf

Play also provides a convenient utility for updating the secret in application.conf, should you want to have a particular secret configured for development or test servers. This is often useful when you have encrypted data using the application secret, and you want to ensure that the same secret is used every time the application is run in dev mode.
To update the secret in application.conf, run playUpdateSecret in the Play console:
[my-first-app] $ playUpdateSecret
[info] Generated new secret: B4FvQWnTp718vr6AHyvdGlrHBGNcvuM4y3jUeRCgXxIwBZIbt
[info] Updating application secret in /Users/jroper/tmp/my-first-app/conf/application.conf
[info] Replacing old application secret: play.crypto.secret="changeme"
[success] Total time: 0 s, completed 28/03/2014 2:36:54 PM
playUpdateSecret 
updates play.crypto.secret in application.conf 

Play deployment

1)binary distribution
 activator dist
copy target/universal/*.zip to production server ex:/home/ikhbla/workspace

login to production server
cd /home/ikbhal/workspace
unzip
https://www.playframework.com/documentation/2.4.x/Production
Dapplication.secret=abcdefghijk.
dist
target/universal
unzip my-first-app-1.0.zip
$ my-first-app-1.0/bin/my-first-app -Dplay.crypto.secret=abcdefghijk

my-first-app-1.0/bin/my-first-app -Dconfig.file=/full/path/to/conf/application-prod.conf


2)Running with source code in production
Running a production server in place
In some circumstances, you may not want to create a full distribution, you may in fact want to run your application from your project’s source directory. This requires an sbt or activator installation on the server, and can be done using the stage task.

$ activator clean stage

2.1)Running as test instance on production
Running a test instance
Play provides a convenient utility for running a test application in prod mode.

This is not intended for production usage.

To run an application in prod mode, run testProd:

[my-first-app] $ testProd

Play generate secret key

[my-first-app] $ playGenerateSecret
[info] Generated new secret: QCYtAnfkaZiwrNwnxIlR6CTfG3gf90Latabg5241ABR5W1uDFNIkn
[success] Total time: 0 s, completed 28/03/2014 2:26:09 PM

AWS ec2 selection decision for Play Framework 2.4

Amazon Linux/Ubuntu/Cent OS
not decide, even the below discussion is for creating binary distribution of package
Reference:

activator clean compile dist

use nginx as front load balancer for port forwarding from 80 to 9000

old reference might not work exactly
SCRIPT: /al-start.sh
chmod +x start
nohup ./start -server -Dconfig.resource=application-prod.conf -Dhttp.port=9000 &
A few notes about this script:
  1. I created this script so I don’t have to edit the Play start script.
  2. It uses a Play configuration file named application-prod.conf. That file just needs to be on the classpath, so having it in the Play application conf folder is all you need.
  3. It runs the server on port 9000. You don’t need to specify that on the command line, but I have a bad memory, so if I want to change this later, it’s easiest to specify it now.
Another note about the production environment: Port 80 on the kbhr.co website is served by Nginx, and it does a proxy to serve the Play application.

docker-machine commands

docker-machine create --driver virtualbox default
docker-machine env default
docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM default * virtualbox Running tcp://192.168.99.101:2376
http://192.168.99.101:32769 for accessing python flash hello world app
docker-machine env default
eval "$(docker-machine env default)"

docker book url

docker article sharing for my self

https://viget.com/extend/how-to-use-docker-on-os-x-the-missing-guide

HOW DOCKER WORKS

Docker is a client-server application. The Docker server is a daemon that does all the heavy lifting: building and downloading images, starting and stopping containers, and the like. It exposes a REST API for remote management.
The Docker client is a command line program that communicates with the Docker server using the REST API. You will interact with Docker by using the client to send commands to the server.
The machine running the Docker server is called the Docker host. The host can be any machine—your laptop, a server in the Cloud™, etc—but, because Docker uses features only available to Linux, that machine must be running Linux (more specifically, the Linux kernel).

We’ll run the Docker client natively on OS X, but the Docker server will run inside our boot2docker VM. This also means boot2docker, not OS X, is the Docker host.

old tutorial
----

Step 3: Initialize and start boot2docker

First, we need to initialize boot2docker (we only have to do this once):
> boot2docker init
2014/08/21 13:49:33 Downloading boot2docker ISO image...
    [ ... ]
2014/08/21 13:49:50 Done. Type `boot2docker up` to start the VM.
Next, we can start up the VM. Do like it says:
> boot2docker up
2014/08/21 13:51:29 Waiting for VM to be started...
.......
2014/08/21 13:51:50 Started.
2014/08/21 13:51:51   Trying to get IP one more time
2014/08/21 13:51:51 To connect the Docker client to the Docker daemon, please set:
2014/08/21 13:51:51     export DOCKER_HOST=tcp://192.168.59.103:2375

Step 4: Set the DOCKER_HOST environment variable

The Docker client assumes the Docker host is the current machine. We need to tell it to use our boot2docker VM by setting the DOCKER_HOST environment variable:
> export DOCKER_HOST=tcp://192.168.59.103:2375

docker volume practice

docker run -d -P --name web -v /webapp training/webapp python app.py
docker run -d -P --name web -v /opt/webapp:ro training/webapp python app.py
docker inspect web
docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py

docker rm nostalgic_morse
docker run -t -i ubuntu:14.04 /bin/bash

docker images
docker pull centos
docker pull training/sinatra

docker run -t -i training/sinatra /bin/bash

Dockerfile
use a Dockerfile to specify instructions to create an image.
docker commit -m "Added json gem" -a "Kate Smith" \ 0b2616b0e5a8 ouruser/sinatra:v2

$ mkdir sinatra 
$ cd sinatra 
$ touch Dockerfile
docker build

Dockerfile
FROM ubuntu:14.04 
MAINTAINER Kate Smith  
RUN apt-get update && apt-get install -y ruby ruby-dev 
RUN gem install sinatra

docker tag 5db5f8471261 ouruser/sinatra:devel
docker push ouruser/sinatra
docker rmi training/sinatra

docker run -d --name db training/postgres
docker rm -f web
docker run -d -P --name web --link db:db training/webapp python app.py
https://docs.docker.com/userguide/dockervolumes/

docker container practice

ocker run -d -p 80:5000 training/webapp python app.py
This would map port 5000 inside our container to port 80 on our local host. You might be asking about now: why wouldn’t we just want to always use 1:1 port mappings in Docker containers rather than mapping to high ports? Well 1:1 mappings have the constraint of only being able to map one of each port on your local host. Let’s say you want to test two Python applications: both bound to port 5000 inside their own containers. Without Docker’s port mapping you could only access one at a time on the Docker host.

Note: If you have used the boot2docker virtual machine on OS X, Windows or Linux, you’ll need to get the IP of the virtual host instead of using localhost. You can do this by running the following outside of the boot2docker shell (i.e., from your comment line or terminal application).
$ boot2docker ip
The VM's Host only interface IP address is: 192.168.59.103
In this case you’d browse to http://192.168.59.103:49155 for the above example.

docker practice

container docker

https://hub.docker.com/r/ingensi/play-framework/
cent os 7
may not support 2.4 play
docker run -d \
  -v /path/to/your/play/app:/app:rw \
  -p 80:9000 \
  ingensi/play-framework

---
https://www.docker.com/
install docker on mac
http://docs.docker.com/mac/started/

for linux users;
http://docs.docker.com/linux/started

docker-machine for creating docker vm in mac
docker toolbox
https://www.docker.com/toolbox

----
docker quickstart terminal
docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

---
https://docs.docker.com/userguide/

docker ps - Lists containers.
docker logs - Shows us the standard output of a container.
docker stop - Stops running containers.

docker run -d -P
 Let’s start with a docker run command.
$ docker run -d -P training/webapp python app.py
-----
Let’s review what our command did. We’ve specified two flags: -d and -P
running container using the docker ps command.
$ docker ps -l
CONTAINER ID  IMAGE                   COMMAND       CREATED        STATUS        PORTS                    NAMES
bc533791f3f5  training/webapp:latest  python app.py 5 seconds ago  Up

ticketing service for customer to connect with company via email, web, phone, chat

https://www.zendesk.com/
ticketing service for customer to connect with company via email, web, phone, chat

Angular material design ui

https://material.angularjs.org/latest/#/

ruby on rails videos

http://railscasts.com/

Ruby functions

2.2.1 :039 > def hello(str="ikbhal")
2.2.1 :040?>   "hello #{str}"
2.2.1 :041?>   end
 => :hello 

2.2.1 :042 > hello 

2.2.1 :043 > "ab cde f".split
 => ["ab", "cde", "f"] 
2.2.1 :044 > arr = [23, 45, 56]
 => [23, 45, 56] 
2.2.1 :045 > a[0]

2.2.1 :047 >   arr[0
2.2.1 :048?>   ]
 => 23 
2.2.1 :049 > arr[-1]
 => 56 

2.2.1 :050 > arr.first
 => 23 
2.2.1 :051 > arr.second
 => 45 
2.2.1 :052 > arr.third
 => 56 
2.2.1 :053 > arr.last
 => 56 

2.2.1 :059 >   arr.reverse
 => [56, 45, 23] 
2.2.1 :060 > arr
 => [23, 45, 56] 
2.2.1 :061 > arr.reverse!
 => [56, 45, 23] 
2.2.1 :062 > arr
 => [56, 45, 23] 
2.2.1 :063 > 

2.2.1 :063 > arr.shuffle
 => [23, 45, 56] 
2.2.1 :064 > arr.shuffle!
 => [23, 56, 45] 
2.2.1 :065 > arr
 => [23, 56, 45] 

2.2.1 :066 > arr.push(1001)
 => [23, 56, 45, 1001] 
2.2.1 :067 > arr
 => [23, 56, 45, 1001] 
2.2.1 :068 > arr<<"ikbhal"<<"basha"
 => [23, 56, 45, 1001, "ikbhal", "basha"] 
2.2.1 :069 > arrr.join

2.2.1 :075 >   (0..9).to_a
 => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] 
2.2.1 :076 > a=%w[ikbhal basha shaik]
 => ["ikbhal", "basha", "shaik"] 
2.2.1 :077 > a[0..1]
 => ["ikbhal", "basha"] 

2.2.1 :078 > (0..9).each{|i| puts 2*i}
0
2
4
6
8
10
12
14
16
18
 => 0..9 

>> 3.times { puts "Betelgeuse!" }   # 3.times takes a block with no variables.
"Betelgeuse!"
"Betelgeuse!"
"Betelgeuse!"
=> 3
>> (1..5).map { |i| i**2 }          # The ** notation is for 'power'.
=> [1, 4, 9, 16, 25]
>> %w[a b c]                        # Recall that %w makes string arrays.
=> ["a", "b", "c"]
>> %w[a b c].map { |char| char.upcase }
=> ["A", "B", "C"]
>> %w[A B C].map { |char| char.downcase }
=> ["a", "b", "c"]

Ruby strings

""
"ab" + "cd"
name="Ikbhal"
last="shaik"
full_name = "#{name} #{last}"
puts "foo"
# is same as
printf "foo\n"


2.2.1 :011 > "ikbhal".length
 => 6 
2.2.1 :012 > "ikbhal".empty?
 => false 
2.2.1 :013 > "".empty?

 => true 

2.2.1 :025 > if s.empty?
2.2.1 :026?>   "The string is empty"
2.2.1 :027?>   else
2.2.1 :028 >     "The string is not empty"
2.2.1 :029?>   end
 => "The string is not empty" 

2.2.1 :030 > nil.to_s
 => "" 
2.2.1 :031 > x =2
 => 2 
2.2.1 :032 > puts x if x<2 span="">
 => nil 

2.2.1 :033 > "ab".nil?
 => false 
2.2.1 :034 > "".nil?
 => false 
2.2.1 :035 > nil.nil?
 => true 

2.2.1 :036 > string = "foobar"
 => "foobar" 
2.2.1 :037 > puts "string is not empty" unless string
 => nil 
2.2.1 :038 > puts "string is not empty" unless string.empty?
string is not empty
 => nil 

Ruby on rails practice

Reference online book: https://www.railstutorial.org/book/beginning

Cloude IDE
 cloud9 (https://c9.io/)
support Ruby, RubyGems, Git
 text editor, a filesystem navigator, and a command-line terminal

install rails
http://installrails.com/

create rails app
rails new hello_app
here hello_app is rails app name

After creating ruby on rails application, use bundler to install and include gems required by application

Gemfile
gem 'sqlite3'
 install latest version of gem "sqlite3"

 gem 'uglifier', '>=1.3.0'
 install latest version of uglifer gem if its version greater than or equal to 1.3.0

 gem 'coffee-rails', '~> 4.0.0'
 install coffee-rails verson newer than 4.0.0 less than 4.0.1
 only minor change ex: not 4.1

run rails app
cd hello_app;
rails server

on cloude IDE
rails server -b $IP -p $PORT

access local rails app hello_app
http://localhost:3000/

mvc flow diagram


root  /
root route

routes.rb
root 'application#hello'

git vesion controller code repository hosting
cloude ide.c9 support git by default
git configuration for first time

git config -global user.name "Shaik Ikbhal Basha"
git config -global user.email "iqbalforall@gmail.com"
git config -global push.default matching
git config -global alias.co checkout

----
git init
git add -A
#adds all files in the current folder to git project

if delete files accidentally , not committed
you can restore it from current working tree as
git checkout -f

git remote add origin https://github.com/ikbhal/hello_app.git
git push -u origin master

hosting
shared hosts or virtual private servers running Phusion Passenger (a module for the Apache and Nginx16 web servers), full-service deployment companies such as Engine Yardand Rails Machine, and cloud deployment services such as Engine Yard CloudNinefold, andHeroku.

Heoroku
group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'

end
bundle install --without production

shortcuts
rails s -> rails server
rails g -> rails generate
rails c -> rails console
rake test -> rake
bundle -> bundle instlal

generate controller
rails g controller StaticPages some help
undo the creating controller
rails destory controller StaticPages

creating model
rails g model User name:string email:string
rails destory  model User

app/views/static_pages/home.html.erb

StaticPages#home
Find me in app/views/static_pages/home.html.erb
--------
test/controllers/static_pages_controller_test.rb
require 'test_helper'

class StaticPagesControllerTest < ActionController::TestCase
  test "should get some" do
    get :some
    assert_response :success
  end

  test "should get help" do
    get :help
    assert_response :success
  end

end

Create product website every day for fresher

Create product website every day for fresher .

Increase the complexity of website every day by little
significant complexity by every week.
Start with no framework only language, db

then slowly integrate framework.

Even every day stress on bootstrap,css, jquery, angular.js..

Startup focused job consultancies

Job consultance company which focuses on Startup tech requirment, Operation requirement, designer, product manager..

Crowd funding offering basic offering 10% discount onproduct, news letter

promotion of product via crowd funding with discount

ketto https://www.ketto.org/

Indian crowd funding website
https://www.ketto.org/

Maid aggregator, driver hiring companies aggregator

Maid aggregator, driver hiring companies aggregator

Maid aggregator, driver hiring companies aggregator

Maid aggregator, driver hiring companies aggregator

BPO consultant aggregator

Verified BPO consultant.
Hire BPO very fast at cheaper rate.

BPO consultancies

Hire BPO through reference or from BPO consultancies.
BPO consultancies tie up with companies, naukri, monster.
Normal search on monster, naukri
Whenever one person leaves company, BPO consultancies knows about it via partner deel.
They contact person, follow up he needs job or not.
If he need, attach to other companies.
Based on requirements.

Apprensire

Wish list buy Microsoft Holo lens

Wish list buy Microsoft Holo lens
https://www.microsoft.com/microsoft-hololens/en-us/development-edition?ref=producthunt

bike rent aggregators , bike rental companies aggregator

Rent bike as easy as giving your id proof pan card, .or giving advance.
Rent it, bike is deliverd to your house.
there are small bike rental, aggregate all of them for free
Even maintain their branding

Like marketplace of bike renter companies
Even individual can rent bike

Tailors aggregate

tailer aggregate

Visiting Card hosting as service

Upload visiting cards, contacts to website/app
you can search by visiting card image, by name, location, time, date
Visiting card image to details image conversion

clients: business, later freelancer, marketor

sample service/ tips

sampleservice
get sample tips/suggestion for free, before commiting for next real service
by doctor, charted account, designer, developer, product manager, 

YourWork remind work, manage work, personal assistant

Remind work, manage work
 by old people, younger people> 15 , house wife as part time job
 don't miss work, apointment, do more , organized work
, external push when you need

open source product hub, open source android app, open source website, cross selling by marketers

----
consultant company get projects via affiliates who are working in othe campanies, partner with companies
----
open source android app, where only android app which are opensource, well maintained are shared
---
open source website, where website which are free, well maintained are share
---
Cross selling of products by marketers, operations, customer care people

Software consultant lead generation by marketer

Create  projects , sell to business and customer via markets on revenue share basis only

project exchange or lead exchange

consultant comapny with backend developer, front end developer and draphic designer, marketer
from freshers with basic salary, remaining revenue sharing
space providing, internet, current, few projects , guidance in exchange for revenue sharing

Remote jobs guider

Remote jobs work to be done by others(fresher,sumiya) with help of me.

Mobisheeer partner plans in future if worked out

Mubasheer partership for 5 lakhs for 10 percentage of company share negotiable future plans
Mubasheer company hiring interns free in exchange for work experience as experiment project
Mubasheer big projects exchange for our consultancies

freelancer/consultant share projects in future exchange with complementary companies

webstie/app where consultants,freelancers can share their projects which they can not do it
their company people capacity, skill limit. In exchange for return favour in the project which they
are specialize for complementary skilled freelancer, consultant companies.

Startup small tech work for 100 rs in exchange for work credit for fresher

Startup small tech work for free in exchange for work credit for fresher

Lets there is small work, which is very least priority
You don't want full time intern.
You dont' want look for freelance work.
Just complete fast , deliverd for small money 100 rs.

We need lots of Social short movies/videos

We need lots of tSocial short movies/videos
Respect elder
teach creativity
help other
be job creator
be loyal

try to be better person by practice good habbits

Practice good habbits
Try to better person by actions, by thought
say sorry, forgive other, help other, clean teeth, go to bed early
teach yourself, your children, your family with softly

Share physical paper/poster about what you feel

You like something , you want inform something.
What you feel 
let other know by sharing on paper, print it share it to strangers, friends, neigbhours

Talk one friend a day

You have lots of friends from college, colleques, neigbhours.
You are not able to make calls to them due to busy schedule.
Make call/chat on facebook/whatsppa/call one person
Collet all contact details one place.

Review exchange app/website

You can write review for app, website, service, product.
you accumulate review points.
Which you can redeem when you need to review for your product/service.

You can review on google play store, website, email.