This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#habilita os modulos necessarios | |
sudo a2enmod cgi alias env auth_digest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#usando apt-get | |
sudo apt-get install git | |
#compilando a partir do codigo fonte | |
#baixe a ultima versao do GIT aqui: https://www.kernel.org/pub/software/scm/git | |
#por exemplo a versao 2.2.1 https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz | |
#depois descompacte e compile ele: | |
wget https://www.kernel.org/pub/software/scm/git/git-2.2.1.tar.gz | |
tar -zxf git-2.2.1.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin [email protected] | |
ServerName git.exemplo | |
DocumentRoot /var/www/git | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
#local onde estao os repositorios git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ativa o virtual host git | |
sudo a2ensite git.conf | |
#reinicia o apache | |
service apache2 reload | |
# ou | |
# sudo /etc/init.d/apache2 reload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#este comando cria um usuário com login victorvhpg | |
#para a área "Acesso privado Git", a senha será solicitada logo após a execução do comando. | |
#o arquivo foi colocado em /var/www/git/ apenas para exemplo | |
#Eh recomendado que coloque ele em um local seguro | |
sudo htdigest -c /var/www/git/.htpasswd "Acesso privado Git" victorvhpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#inicializa um repositorio git chamado meu_projeto.git com --bare, | |
#para que soh seja criado os arquivos do git | |
#este repositorio nao tera area de trabalho ele so tera os arquivos git. | |
git init --bare meu_projeto.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#clonar o repositorio | |
git clone http://git.exemplo/git/meu_projeto.git | |
#sera solicitada a autenticacao | |
#Username for 'http://git.exemplo': victorvhpg | |
#Password for 'http://[email protected]': ***** | |
#apos isso | |
#pode colaborar, fazer commits e push para o servidor | |
echo "oi servidor" > oi.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//retorna uma Promise que faz download de urlArquivo com responseType ArrayBuffer | |
//resolve a Promise com o ArrayBuffer do arquivo | |
var downloadArquivo = function(urlArquivo,fnProgresso) { | |
return new Promise(function(resolve, reject) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", urlArquivo, true); | |
//setar o responseType para arraybuffer | |
xhr.responseType = "arraybuffer"; | |
//quando a requisicao completar | |
xhr.addEventListener("load", function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
downloadArquivo("./logo.png").then(function(arrayBuffer) { | |
var blob = new Blob([arrayBuffer], { | |
type: "image/png" | |
}); | |
var img = document.createElement("img"); | |
img.addEventListener("load", function(e) { | |
window.URL.revokeObjectURL(img.src); | |
}, false); | |
img.src = window.URL.createObjectURL(blob); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
downloadArquivo("./video.ogv", function(progresso, total, perc) { | |
document.querySelector("progress").value = perc; | |
}).then(function(arrayBuffer) { | |
//cria um Blob a partir do arrayBuffer | |
var blob = new Blob([arrayBuffer], { | |
type: "video/ogg" | |
}); | |
//cria o elemento video | |
var video = document.createElement("video"); | |
video.autoplay = true; |