This file contains 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
define profiles::blog ( | |
$docroot = '/opt/wordpress', | |
$port = '80', | |
$vhost_name = $title | |
){ | |
class { 'wordpress': | |
wp_owner => 'wordpress', | |
wp_group => 'wordpress', | |
install_dir => $docroot | |
} |
This file contains 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
download entire site: | |
wget --no-clobber --convert-links --random-wait -r -p -E -e robots=off -U mozilla http://www.site.com | |
## pe-agent update: | |
### Put this in site.pp | |
node 'master.puppetlabs.vm' { | |
notify { "Hello dear master": } | |
} |
This file contains 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 'spec_helper_acceptance' | |
describe "file content tests" do | |
step "Create file with content" | |
hosts.each do |host| | |
# confine :except, :platform => 'windows' | |
content = "foo\nfoo\nfoo\n" | |
the_file = "/tmp/demo.txt" | |
create_remote_file host, the_file, content |
This file contains 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
cat /proc/sys/kernel/random/uuid | |
This can be used in creating Puppet node groups. |
This file contains 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
# Need to force | |
# Ideally run this after removing the containers so that the images are not being used | |
for i in $(docker images | tail -n +2 | awk '{ print $3 }'); do docker rmi -f $i ; done | |
# Need to stop the container before removing it | |
# Instead of 'docker stop', you can also run 'docker kill'. | |
for i in $(docker ps -a | tail -n +2 | awk '{ print $1 }'); do docker stop $i && docker rm $i ; done |
This file contains 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/local/bin/docker -d -D -g /var/lib/docker -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375 --label provider=virtualbox -s aufs | |
-d is deprecated |
This file contains 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
export PS1='\[\e[4;32m\]\!\[\e[m\] \[\e[0;31m\]\[\e[47m\]\u\[\e[m\] \[\e[1;37m\]\w\[\e[m\] \[\e[0;93m\][$?]\[\e[m\] \[\e[1;31m\]\$ \[\e[m\]\[\e[m\]\[\e[0;32m\]' | |
eg: | |
517 anoop ~ [0] $ cat aa | |
cat: aa: No such file or directory | |
518 anoop ~ [1] $ |
This file contains 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
# Run this on the docker host (of course) | |
# Here I am exposing port 8080 on the container whose IPAddress is 172.17.0.113 | |
#> as port 8888 on the docker host | |
# To get the container's IPAddress, use `docker inspect <containerid> | grep IPAddress | |
# To get the docker host's ip address and ssh into it, use: | |
# `docker-machine ssh $(docker-machine ls -q)` | |
iptables -t nat -A DOCKER -p tcp --dport 8888 -j DNAT --to-destination 172.17.0.113:8080 |
This file contains 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
While running the following command, you may see this error: | |
`docker push anoop/webapp` | |
To fix this, run | |
`docker images` | |
Get the image id of the repository that you want to push. | |
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE | |
web_web latest 4b81006810f8 2 hours ago 348.6 MB |
This file contains 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
DTR uses SSL certificates in addition to a login/password to login. | |
The steps to use openssl to create a self-signed certificate as below: | |
1. First create a private key (myserver.key) and a certificate signing request (server.csr) | |
openssl req -nodes -newkey rsa:2048 -keyout myserver.key -out server.csr | |
2. Finally create the SSL certificate (server.crt) using the csr and private key just created: | |
openssl x509 -req -days 365 -in server.csr -signkey myserver.key -out server.crt |
OlderNewer