Simple Puppet snippets for easier cutting and pasting...
Setting up puppet on a new machine:
wget https://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
dpkg -i puppetlabs-release-pc1-xenial.deb
apt-get update
apt-get upgrade
apt-get install puppet-agent
ln -s /opt/puppetlabs/bin/* /usr/local/bin
Create a new module:
puppet module generate wkumari-foo
Run / apply a single module (for example, while testing):
puppet apply --noop --test -e "include foo"
or the longer version:
puppet apply --noop --test --modulepath="/etc/puppetlabs/code/modules:/etc/puppetlabs/code/environments/production/modules" -e "class {test_mailserver: param => 'bar'} include test_mailserver"
and with hiera info:
puppet apply --hiera_config /etc/puppetlabs/puppet/hiera.yaml --noop --test --modulepath="/etc/puppetlabs/code/modules:/etc/puppetlabs/code/environments/production/modules" -e " include test_mailserver"
Emacs Tips and Tricks
The only thing Emacs is missing is a good editor.
-- Anon
To set a variable:
M-: (setq variable "value")
Merging files:
To deal with git merge conflicts, use smerge-mode.
smerge-next
bound to smerge-command-prefixn to move to next conflict.smerge-previous
bound to smerge-command-prefixp to move to previous conflict.smerge-keep-current
bound to smerge-command-prefixRET to keep the version the cursor is on.smerge-keep-mine
bound to smerge-command-prefixm to keep your changes.smerge-keep-other
bound to smerge-command-prefixo to keep other changes.smerge-ediff
bound to smerge-command-prefixE to start an ediff session to merge the conflicts.
OpenVPN Access Server gives users a nice, preconfigured .dmg, which includes a profile for connecting to the server. Unfortunatly this client is configured to be very basic, and does not allow for importing profiles.
This can be configured from the access-server, but it is often nicer to be able to do this on a per-client basis (with the "basic_client" parameter). This is how to do it on OS X.
To get status:
/Library/Frameworks/OpenVPN.framework/Versions/Current/bin/capicli GetPreferences
To allow adding profiles:
/Library/Frameworks/OpenVPN.framework/Versions/Current/bin/capicli -k basic_client -v false SetPreference
This keeps breaking, with weird unmet dependencies. apt-get-f install, etc seems to become sad. Completely removing and reinstalling seems easiest...
Getting errors like:
* Already started
Processing triggers for libc-bin (2.23-0ubuntu4) ...
Errors were encountered while processing:
/var/cache/apt/archives/srvadmin-hapi_8.4.0-1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Fixed with:
apt-get -f purge srvadmin-isvc srvadmin-hapi srvadmin-ominst apt-get -f purge srvadmin-storage srvadmin-omacore srvadmin-storage-cli
apt-get -f install
apt-get update
apt-get install srvadmin-isvc srvadmin-hapi srvadmin-ominst apt-get install srvadmin-storage srvadmin-omacore srvadmin-storage-cli
service dataeng start
omreport storage controller
Quick notes on creating a ZFS filesystem.
root@ron:~/src/configs/gitosis-admin# zfs create tank/data/scratch
root@ron:~/src/configs/gitosis-admin# zfs set quota=10G tank/data/scratch
root@ron:~/src/configs/gitosis-admin# touch /tank/data/scratch/.duplicity-ignore
root@ron:~/src/configs/gitosis-admin#
Creating .duplicity-ignore will prevent Duply (well, Duplicity) from backing up this directory.
Checking the compression ratio:
zfs get all | grep compressratio