Sandors Systems Scribbles

Notes about Systems & Infrastructure Culture

Using Ansible to deploy a PuppetMaster

The Problem Need to deploy a new Puppet Enterprise cluster with a PuppetMaster, PuppetConsole and a PuppetDB while avoiding typos and misconfigurations. Also need to deploy to several environments using a consistent configuration. The Solution Use Ansible to deploy Puppet onto freshly built servers that contain just a SysAdmins SSH public key. The Goal A repeatable and documented way to deploy the very finicky Puppet installer in any environment needed from local vagrants to the clouds of vSphere, AWS, RackSpace or Digital Ocean.

Using GoAccess to parse webserver logs

The Problem Need the ability to track web traffic for a specific hours worth of logs. The Solution Using GoAccess to parse Apache logs that are rotated into hour chunks. The Goal Install GoAccess to parse webserver logs. Use Ansible Playbooks for the installation, configuration and for re-usabilty of GoAccess on other servers. Keep it simple by rotating logs on the hour. The Links GoAccess - real-time web log analyzer - allinurl/goaccess Ansible - Ansible Docs Apache rotatelogs - Hourly Rotated WebServer Logs Digital Ocean - My referral link, thanks!

Dogecoin mining on Digital Ocean

The Goal Create a droplet on Digital Ocean to mine Dogecoins so fun much profits. The Links Dogecoin - very link /r/dogecoin - so reddit /r/dogemining - many mines Dogecoin Mining Pools - much swim Dogecoin Resources - sources Dogecoin Foundation - now found Digital Ocean - awesome drops TugBoat - command line ocean Create a droplet sandor@theargo> tugboat create lucydoge -s 62 -i 308287 -r 3 -k 44888 Name: lucydoge Status: active Region ID: 3 Image ID: 308287 Size ID: 62 Backups Active: false Create user root@lucydoge:~# history root@lucydoge:~# ls -al root@lucydoge:~# useradd -m lucy root@lucydoge:~# passwd lucy root@lucydoge:~# adduser lucy sudo Update Debian root@lucydoge:~# apt-get -y update && apt-get -y upgrade Install Screen root@lucydoge:~# apt-get install screen Install a CPU Miner root@lucydoge:~# sudo apt-get install git build-essential autotools-dev libcurl4-gnutls-dev autoconf automake lucy@lucydoge:~# mkdir ~/miner2049er lucy@lucydoge:~# cd miner2049er lucy@lucydoge:~# git clone https://github.

Using Oscar to Build a Local Puppet Environment with Vagrant

The Goal Install Oscar Use Oscar to build a local PuppetMaster & Agent config Use Vagrant to start the PuppetMaster & Agent Install VirtualBox - https://www.virtualbox.org/wiki/Downloads Vagrant - Oscar works with Vagrant version 1.3.4 - http://downloads.vagrantup.com/tags/v1.3.4 Oscar - https://github.com/adrienthebo/oscar sandor@theargo> vagrant plugin install oscar Add a Vagrant Box sandor@theargo> vagrant box add centosPupLabs http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box What that does: sandor@theargo> vagrant box add boxName http://url.box Downloads the .

Using Vagrant on Windows

The Goal Install and configure VirtualBox & Vagrant on your Windows dev box Download and start a Linux & Windows Vagrant Box. Install VirtualBox - https://www.virtualbox.org/wiki/Downloads Vagrant - http://www.vagrantup.com/downloads Download the .msi Right click and Install as Administrator Add a Vagrant Box Open a Command Prompt and Run as Administrator C:\Windows\system32\>vagrant box add centosPupLabs http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210-nocm.box What that does: C:\Windows\system32\>vagrant box add boxName http://url.

Add WebProxy Cert to Fedora

The Goal Make Fedora work behind a restrictive idiotic corporate web proxy Install a corporate cert to make that happen Get the cert Install the cert sandor@theargo> openssl x509 -text -in /path/to/proxycert.crt >> /etc/pki/tls/certs/ca-bundle.crt The result Your corporate overlord has now man in the middled your personal gmail, have fun.

Auto Update VirtualBox Guest Additions with vagrant-vbguest

The Goal Keep the VirtualBox guest additions at the latest version using vagrant-vbguest built by dotless-de. The Links Vagrant - link Vagrant vbguest - link dotless-de - link vagrant-vbguest A beautifully simple Vagrant plugin to manage the guest additions on VirtualBox. install sandor@theargo> ~/Codestuff/vagrants/PuppetMaster $vagrant plugin install vagrant-vbguest bootup usage vagrant-vbguest will run on every vagrant up or on a vagrant reload unless you specifically tell it not to.

Puppet vim setup

The Goal Setup vim to edit Puppet Manifests using a few good tools that will get you to pass Puppet Lint tests. The Links PuppetLabs - link vim-puppet - link vim tabular - link vim syntastic - link Vim-Pathogen Vim-Pathogen on github sandor@theargo mkdir -p ~/.vim/autoload ~/.vim/bundle sandor@theargo cd ~/.vim/autoload sandor@theargo curl -o pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim Add these settings to .vimrc execute pathogen#infect() syntax on filetype plugin indent on Vim-Puppet Vim-Puppet on github

Ansible on RedHat 5.x

The problem Older Pythons that live on older RedHats do not have json support. Old corporations still use old OS’es like RedHat 5.x but need to use modern configuration management tools like Ansible. The goal Enable RedHat 5.x systems to run Ansible by installing json support on Python 2.4. HowTo Using Ansible Raw sandor@theargo> ansible -i hosts all -m raw -a "yum -y install python-simplejson"