Pipe a remote machine's localhost:5432 for postgres to your localhost:6432
ssh -nNT -L 9000:localhost:5432 user@database-ip-address
You can then use psql -h localhost -p 6432
to connect to the database locally.
def replicate_remote_database(username,password,target_ip,db_name): | |
import couchdb | |
server = couchdb.Server() # connects to the local_server | |
server.replicate( | |
'http://{}:{}@{}:5984/{}'.format( | |
username, | |
password, | |
target_ip, | |
db_name | |
), |
def get_ip(): | |
import socket | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.connect(("gmail.com",80)) | |
out=(s.getsockname()[0]) | |
s.close() | |
return out |
Pipe a remote machine's localhost:5432 for postgres to your localhost:6432
ssh -nNT -L 9000:localhost:5432 user@database-ip-address
You can then use psql -h localhost -p 6432
to connect to the database locally.
This writeup is about where I see web development going, where I want it to go and where I think it should go but it shouldn't.
Don't lock things in. But give an obvious path for beginners. Locking things makes evolution to better tools more difficult. Giving options makes getting this done more difficult and time consuming.
'docker ps' -> Lists containers.
'docker ps -a' -> Lists all containers.
'docker logs' -> Shows us the standard output of a container.
'docker stop' -> Stops running containers.
'docker rm ' -> Removes a container.
We subscribe to the Git Featrue Branch workflow, briefly described in that link.
In practice, it works as follows:
git checkout development
git pull origin development
Various Cheats found on the Web | |
mongo //Start Mongo | |
show dbs //Show databases | |
use mydb //User database named "mydb" | |
db //Show selected database | |
help //Get help | |
show collection //Show collections from a database | |
Finds - db.collection |
# create a branch | |
git branch <branch> | |
# delete a branch | |
git branch -d|D <branch> | |
# go back to master | |
git checkout master | |
# merge branch to master |
By definition the Internet is a worldwide, publicly accessible series of interconnected computer networks that transmit data by packet switching using the standard Internet Protocol