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
#!/bin/bash | |
ssh-keygen | |
# Quando for perguntado a você o local onde salvar o arquivo, | |
# escolha o lugar padrão. | |
# Pressione enter quando solicitado (não entre com passphrases). | |
# Se quiser usar uma senha, melhor. Mas daí não fica mais um SSH sem senha :D | |
# Este programa cria 2 arquivos: | |
# .ssh/id_rsa |
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
BOX = ~/precise32.box | |
VM = precise32 | |
cookbooks = lopesivan/chef | |
OUT = backup | |
all: status | |
new: | |
@vagrant box add $(VM) $(BOX) |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "precise32" |
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
#!/usr/bin/env bash | |
echo "Install Apache and setting it UP" | |
apt-get update | |
apt-get install -y apache2 | |
sudo sh -c 'echo "ServerName localhost" >> /etc/apache2/conf.d/name' && sudo service apache2 restart | |
rm -rf /var/www | |
ln -fs /vagrant /var/www | |
exit 0 |
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
Don't use HTTP use SSH instead | |
change | |
https://github.com/WEMP/project-slideshow.git | |
to | |
[email protected]:WEMP/project-slideshow.git | |
you can do it in .git/config file |
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
dpkg-query -Wf '${Package;-40}${Priority}\n' | sort -b -k2,2 -k1,1 | |
So, to remove all unneeded packages (optional and extra), you can execute the following command: | |
sudo apt-get --simulate purge $(dpkg-query -Wf '${Package;-40}${Priority}\n' | | |
awk '$2 ~ /optional|extra/ { print $1 }') | |
I added the --simulate option to be safe and see what apt says. | |
Strangely, it asks to remove also some required packages: e2fsprogs, util-linux, hostname and upstart, so it is necessary to reinstall these packages. I would download the packages in advance (apt-get download <packages>), to avoid network problems after. |
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
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "cf" | |
config.vm.synced_folder ".", "/Workspace", id: "vagrant-root" | |
# config.vm.network :private_network, ip: "10.10.10.1" | |
forward_port = ->(guest, host = guest) do | |
config.vm.network :forwarded_port, | |
guest: guest, |
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
npm ls -g -p | grep -v node_modules.*node_modules | awk -F/node_modules/ '{print $2}' | grep -vE '^(npm|)$' | xargs npm -g rm |
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
deploy_user = node[:deploy][:user] | |
deploy_user_home = File.join('/', 'home', deploy_user) | |
rvm_version = "head" | |
execute "install_rvm_for_deploy_user" do | |
user deploy_user | |
command "curl -L https://get.rvm.io | bash -s #{rvm_version}" | |
environment "HOME" => deploy_user_home | |
creates "#{deploy_user_home}/.rvm" | |
end |
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
require 'openssl' | |
require 'base64' | |
require 'securerandom' | |
def hash_hostname(hostname, salt_b64=nil) | |
if salt_b64 | |
salt = Base64.decode64(salt_b64) | |
else | |
salt = SecureRandom.random_bytes(20) | |
salt_b64 = Base64.encode64(salt).strip |
OlderNewer