ssh-keygen -f ~/.ssh/id_rsa -q -P ""
cat ~/.ssh/id_rsa.pub
Copy and put that ssh key on destination server in (if don't exists, create it):
~/.ssh/authorized_keys
First, make sure you already have git installed on local and remote server. | |
On remote server | |
---------------- | |
$ cd ~/ #if you are not here yet | |
$ mkdir website.git && cd website.git | |
$ git init --bare | |
Initialized empty Git repository in /home/ubuntu/website.git/ | |
$ vi hooks/post-receive # paste the post-receive file here |
a |
Recentemente publicamos o artigo: Descompactando arquivos vai SSH. E hoje aprenderemos como compactar estes arquivos. | |
Quem tem um site ou qualquer hospedagem que armazene arquivos sabe que eventualmente são necessários backups, seja para corrigir algum erro ou problema que tenha dado (muito comuns quando estamos fazendo a periódica manutenção do portal). O grande problema é quando alguma coisa dá errado e não conseguimos restaurar nossos arquivos para antes do problema ter ocorrido. | |
Hoje a maioria dos provedores de hospedagem possuem um backup automático onde basta o cliente solicitar o dia e hora que seus arquivos serão restaurados. | |
O grande problema é: Tempo. | |
Recentemente passei pela inconveniente necessidade de recuperar uns arquivos antigos e tive que pedir ao meu provedor para restaurar até determinada hora. |
#alternative to .gitignore | |
git update-index --assume-unchanged path/to/file |
<?php | |
backup_tables('localhost', 'DB_USER', 'DB_PASS', 'DB_DATABASE'); | |
/* backup the db OR just a table */ | |
function backup_tables($host,$user,$pass,$name,$tables = '*') | |
{ | |
$link = mysql_connect($host,$user,$pass); |
#modal {
display: block;
position: fixed;
top: 50%;
left: 50%;
box-sizing: border-box;
transform: translate(-50%, -50%);
}
Bringing machine 'default' up with 'virtualbox' provider... | |
[default] Setting the name of the VM... | |
[default] Clearing any previously set forwarded ports... | |
[default] Creating shared folders metadata... | |
[default] Clearing any previously set network interfaces... | |
There was an error while executing `VBoxManage`, a CLI used by Vagrant | |
for controlling VirtualBox. The command and stderr is shown below. | |
Command: ["hostonlyif", "create"] |
ubuntu@ip-10-248-47-171:~$ cat /etc/proftpd/proftpd.conf | |
# | |
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. | |
# To really apply changes, reload proftpd after modifications, if | |
# it runs in daemon mode. It is not required in inetd/xinetd mode. | |
# | |
# Includes DSO modules | |
Include /etc/proftpd/modules.conf |
git shortlog -s -n |