Thursday, January 28, 2016

connect to host postgresql from vagrant guest

user@host:~$ sudo -i
root@host:~$ echo "listen_addresses = '*'" >> /etc/postgresql/9.5/main/postgresql.conf
root@host:~$ echo "host    all             all             0.0.0.0/0            md5" >> /etc/postgresql/9.5/main/pg_hba.conf

root@host:~$ /etc/init.d/postgresql restart


connect to host from guest
user@host:~$ vagrant ssh
vagrant@guest:~$ psql -h 192.168.33.1



Thursday, January 21, 2016

npm install on ubuntu

npm config set registry=http://registry.npmjs.org/

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