Thursday, October 15, 2015

connect to corporate network from anywhere in internet through amazon ec2 instance

connect to a ubuntu server which resides inside a corporate network, which is more secured by corporate Firewall,  from anywhere in internet.

Assume you have a ubuntu 15.04 server located inside a corporate. corporate_user@corporate_server

if you want to connect to that corporate server from you home or from anywhere else, then you have to use a proxy server like amazon ec2
create a amazon ec2 instance server (named as $ws) with ubuntu 15.04 and enable port 22(enabled by default) and 2222.

now go and initiate a connection from you corporate_server
by typing

ssh -R 2222:localhost:22 -l ubuntu $ws
which will create a connection with ssh reverse port forwarding.

now connect your aws server ($ws) from anywhere and type
ssh -p 2222 corporate_user@localhost

that is nothing but your corporate_server

Tuesday, August 18, 2015

use aws-sdk-ruby in windows behind proxy


Aws.use_bundled_cert!
Aws::S3::Resource.new(http_proxy: "http://proxy.com:8080") 
Aws::S3::Client.new (http_proxy: "http://proxy.com:8080")


Sunday, June 21, 2015

shared network

1) Click "Launche Instance"
2) community AMIs
3) choose Operating System as "windows"
4) choose Architecture as 64 bit
5)  select "Windows_Server-2012-R2_RTM-English-64Bit-Base-2015.06.10 - ami-c5688281"

6) allocate hard disk size to 60 GB
Inbound TCP ruby 135-139 , 445
Inbound UDP ruby 135-139 , 445
enable ports in firewall

Wednesday, May 6, 2015

how to resolve passenger apache to read env variables

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04

Tuesday, May 5, 2015

Enable Public DNS for EC2 instance

http://stackoverflow.com/questions/20941704/ec2-instance-has-no-public-dns

Tuesday, April 21, 2015

how to configure nano editor & Atom Editor

http://askubuntu.com/questions/90013/how-do-i-enable-syntax-highlighting-in-nano
https://atom.io/

Sunday, April 19, 2015

avoid prompt for passprase

eval $(ssh-agent)
ssh-add

read /etc/hosts file by HostAdmin in chrome & ff

https://github.com/tg123/chrome-hostadmin

https://github.com/tg123/chrome-hostadmin/issues/11


Thursday, April 16, 2015

how to assign IP Address to docker container

http://stackoverflow.com/questions/27937185/assign-static-ip-to-docker-container

https://opsbot.com/advanced-docker-networking-pipework/
http://xboxng.com/wp/?p=66

https://opsbot.com/advanced-docker-networking-pipework/

Friday, April 10, 2015

create sublime.desktop launcher in ubuntu unity

user@ubuntu:~/.local/share/applications$ cat sublime.desktop
[Desktop Entry]
Name=Sublime
GenericName=SublimeTest3
X-GNOME-FullName=SublimeText3
Comment=Editor, simple, lightweight
Exec=/home/user/packages/sublime_text_3/sublime_text
Icon=/home/user/packages/sublime_text_3/Icon/48x48/sublime-text.png
Terminal=false
Type=Application
Categories=GNOME;IDE;Editor;Ruby;Golang;
StartupNotify=true
X-Ubuntu-Gettext-Domain=sublimetext
user@ubuntu:~/.local/share/applications$ 

Thursday, April 9, 2015

boot2docker on osX

instal boot2docker pkg in mac os x
then open trerminal
~:$ /usr/local/bin/boot2docker init
~:$ docker info
~:$ /usr/local/bin/boot2docker up && export DOCKER_HOST=tcp://$(/usr/local/bin/boot2docker ip 2 > /dev/null):2375
export DOCKER_HOST=tcp://192.168.59.103:4243
~:$ docker info
~:$ docker run busybox echo hello Docker!


process killer for linux by ruby


if ARGV.size == 0
puts "pass argument"
else
        res = `ps aux | grep '#{ARGV[0]}' | awk '{print $2}'`
end
pids = res.split("\n")
puts pids
pids.each {|e|
  if Process.pid.to_s != e
     puts `ps -p #{e} -o pid,vsz=MEMORY -o user,group=GROUP -o comm,args=ARGS`
     puts `kill -9 #{e}`
     puts "killed"
   end
}
puts "all process are killed and resources releived to Kernel"


Monday, February 16, 2015

create a new rails 5 application and deploy to heroku

how to create a new rails 5 application and deploy it into heroku.
install ruby and rails following by their dependencies.

user@ubuntu-15.04:~$ ruby -v
ruby 2.2.0p0 (2015-01-25 revision 49005) [x86_64-linux]
user@ubuntu-15.04:~$ rails -v
Rails 4.2.0

install edge rails
user@ubuntu-15.04:~$ git clone git@github.com:rails/rails.git ~/packages/edge/rails
user@ubuntu-15.04:~$ export EDGE=/home/user/packages/edge/rails/railties/bin
user@ubuntu-15.04:~$ $EDGE/rails -v
Rails 5.0.0.alpha
user@ubuntu-15.04:~$ $EDGE/rails new --edge --database=postgresql rails-5-demo-blog
user@ubuntu-15.04:~$ cd rails-5-demo-blog


user@ubuntu-15.04:~/rails-5-demo-blog$ git init; git add . ; git commit -m "first commit"
user@ubuntu-15.04:~/rails-5-demo-blog$ $EDGE/rails g --help
user@ubuntu-15.04:~/rails-5-demo-blog$ $EDGE/rails g scaffold Post name desc:text at:timestamp
user@ubuntu-15.04:~/rails-5-demo-blog$ rake db:create; rake db:migrate;


user@ubuntu-15.04:~/rails-5-demo-blog$ git add . ; git commit -m "Post Scaffold Added"
user@ubuntu-15.04:~/rails-5-demo-blog$ $EDGE/rails s

now ,you can browse at localhost:3000

want to run in production

comment this last 2 line in config/database.yml

# username: rails-5-demo-blog
# password: <%= ENV['RAILS_5_DEMO_BLOG_DATABASE_PASSWORD'] %>

add production secret_key into config/secret.yml at last line
<pre>
production:
  secret_key_base: blahblahblah
</pre>
add <pre>root 'posts#index'</pre> into config/routes.rb
add </pre>public/assets/</pre> into .gitignore

user@ubuntu-15.04:~/rails-5-demo-blog$ rake db:create RAILS_ENV=production
user@ubuntu-15.04:~/rails-5-demo-blog$ rake db:migrate RAILS_ENV=production
user@ubuntu-15.04:~/rails-5-demo-blog$ rake assets:precompile
user@ubuntu-15.04:~/rails-5-demo-blog$ RAILS_SERVE_STATIC_FILES=true $EDGE/rails server -e production

now, you can browse your production app at localhost:3000

deploy to heroku

add <pre>ruby '2.2.0'</pre> at top of Gemfile
add <pre>gem 'rails_12factor', group: :production</pre> into Gemfile

user@ubuntu-15.04:~/rails-5-demo-blog$ bundle
user@ubuntu-15.04:~/rails5blog$ git add .;git commit -m "Heroku dependencies Added"


install heroku toolbelt

user@ubuntu-15.04:~/rails-5-demo-blog$ heroku login
user@ubuntu-15.04:~/rails-5-demo-blog$ heroku create
user@ubuntu-15.04:~/rails-5-demo-blog$ git push heroku master
user@ubuntu-15.04:~/rails-5-demo-blog$ heroku run:detached rake db:migrate
user@ubuntu-15.04:~/rails-5-demo-blog$ heroku open

A demo app created at https://github.com/thaniyarasu/rails-5-demo-blog
this demo app deployed into heroku at https://rails-5-demo-blog.herokuapp.com/


Dartium will kill all major web & desktop application in upcoming years


After analyzing All Web Technologies,
i am sure about that , DARTIUM  (dartlang.org) will kill All Mobile & Desktop Application in another 3-7 years.

The Effect of Dartium


1) Dartium will dominate javascript in upcoming years
2) Dartium will kill All Desktop Apps 
3) Dartium will kill All Mobile Native Apps like Android ,IPhone,BlackBerry , Windows Mobile,etc

Go Language , Dart Language, Dartium ,PolymerDart ,AngularDart, Pnacl/NacL are the Future of Web Technologies.

All server side component will be re written in Golang
All client side component will be re written in AngularDart with the support of dartlang and polymerDart


Monday, February 9, 2015

remove homebrew complete in mac

~$ sudo rm -rf /usr/local
~$ sudo mkdir /usr/local
~$ sudo chown -R 777 /usr/local
install homebrew

~$ sudo chown -R $USER /Library/Caches/Homebrew
~$ brew install automake libtool pkg-config gcc48 libyaml readline libksba openssl
install rvm
rvm requirements