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
| mkpasswd --local > /etc/passwd | |
| mkgroup --local > /etc/group | |
| chmod +r /etc/passwd | |
| chmod u+w /etc/passwd | |
| chmod +r /etc/group | |
| chmod u+w /etc/group | |
| chmod 755 /var | |
| touch /var/log/sshd.log | |
| chmod 664 /var/log/sshd.log | |
| editrights -l -u sshd |
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
| Vagrant.configure("2") do |config| | |
| config.vm.box = "hashicorp/precise32" | |
| 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
| Vagrant.configure("2") do |config| | |
| config.vm.box = "hashicorp/precise32" | |
| config.vm.define :web do |web_config| | |
| web_config.vm.network "private_network", ip: "192.168.50.10" | |
| end | |
| 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
| exec { "apt-update": | |
| command => "/usr/bin/apt-get update" | |
| } | |
| package { ["openjdk-7-jre", "tomcat7"]: | |
| ensure => installed, | |
| require => Exec["apt-update"] | |
| } |
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
| Vagrant.configure("2") do |config| | |
| config.vm.box = "hashicorp/precise32" | |
| config.vm.define :web do |web_config| | |
| web_config.vm.network "private_network", ip: "192.168.50.10" | |
| web_config.vm.provision "puppet" do |puppet| | |
| puppet.manifest_file = "web.pp" | |
| end | |
| end | |
| 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
| public class Orcamento { | |
| private double valor; | |
| public Orcamento(double valor) { | |
| this.valor = valor; | |
| } | |
| public double getValor() { | |
| return valor; |
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
| public class ICMS { | |
| public double calculaICMS(Orcamento orcamento) { | |
| return orcamento.getValor() * 0.1; | |
| } | |
| } | |
| public class ISS { | |
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
| public interface Imposto { | |
| double calcula(Orcamento orcamento); | |
| } | |
| public class ICMS implements Imposto { | |
| public double calcula(Orcamento orcamento) { | |
| return orcamento.getValor() * 0.1; |
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
| public class CalculadorDeImpostos { | |
| public void realizaCalculo(Orcamento orcamento, Imposto imposto) { | |
| return imposto.calcula(orcamento); | |
| } | |
| } |
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
| public class Orcamento { | |
| private double valor; | |
| private List<Item> itens; | |
| public Orcamento(double valor) { | |
| this.valor = valor; | |
| this.itens = new ArrayList<Item>(); | |
| } | |
OlderNewer