my notes

Deploying with Capistrano 3

gem install capistrano

mkdir ~/project
cd ~/project
cap install



Add stage info to file

For production - config/deploy/production.rb 
For development - config/deploy/develop.rb 

server 'hostname', user: 'username', roles: %w{web app}, port: 22

To deploy, must be in root of project

cd ~/project

cap develop deploy


- key based ssh logins need to be setup
- deploy key needs to be setup for git


Zimbra cheatsheat

Relay/Route emails to external smtp server

zmprov ma zimbraMailTransport

Relay/Route all mail destined for a particular domain

md zimbraMailCatchAllAddress
md zimbraMailCatchAllForwardingAddress
md zimbraMailTransport

Import user's encrypted password

zmprov ma userPassword '{crypt}$1$rV85sAyx$NGKPhhzAVJ/n7tKnxI4g4.'


puppet custom fact

We will ad custom puppet fact that will show ruby path.

create file


add following ruby code

Facter.add(:rubypath) do
setcode 'which ruby'

run on puppet gent

facter --puppet rubypath

Custom facts from modules are only used on puppet runs.


puppet cheatsheet

puppet config print
puppet config print runinterval
/usr/bin/puppet config set runinterval 1200
puppet parser validate init.pp

Regenerating a Puppet Agent Certificate

puppet resource service puppet ensure=stopped
rm -rf /var/lib/puppet/ssl/
puppet resource service puppet ensure=running


Setup lvm2

Create physical volume

pvcreate /dev/sda4

Physical volume "/dev/sda4" successfully created

Create a logical volume group called pve

vgcreate pve /dev/sda4

Volume group "pve" successfully created

Create volume group

If you really need to assign all space on partition this is the way to do it. This is not a good idea as snapshots will not work.

lvcreate -l 100%VG -n storage pve

to use 90%
lvcreate -l 90%VG -n storage pve


Shrink ext4 partition

We want a 10G partition therefore we need to resize the filesystem to a smaller size to something like 9G.

# e2fsck -f /dev/sda2
# resize2fs /dev/sda2 9G

Delete the partition and create a new one with 10 G size.

# cfdisk /dev/sda

Run resize2fs without size parameter

# resize2fs /dev/sda2