(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deployAnd Update the new password
| # List databases | |
| sudo su postgres | |
| psql | |
| \list | |
| # Create a compressed backup | |
| sudo su postgres | |
| pg_dump -Fc <database_name> > <file> | |
| # Example |
| DUMP | |
| // pod-name name of the postgres pod | |
| // postgres-user database user that is able to access the database | |
| // database-name name of the database | |
| kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql | |
| RESTORE | |
| // pod-name name of the postgres pod | |
| // postgres-user database user that is able to access the database | |
| // database-name name of the database |
(wherever it says url.com, use your server's domain or IP)
Login to new server as root, then add a deploy user
sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deployAnd Update the new password
| // set-up a connection between the client and the server | |
| var socket = io.connect(); | |
| // let's assume that the client page, once rendered, knows what room it wants to join | |
| var room = "abc123"; | |
| socket.on('connect', function() { | |
| // Connected, let's sign-up for to receive messages for this room | |
| socket.emit('room', room); | |
| }); |
| // Register keyboard events | |
| $(document).keydown(function(e) { | |
| if (e.keyCode === 37) { | |
| // Previous | |
| $(".carousel-control.left").click(); | |
| return false; | |
| } | |
| if (e.keyCode === 39) { | |
| // Next | |
| $(".carousel-control.right").click(); |
| browser-sync start --server --directory true --files "**/*.css, **/*.js, **/*.html" |