Skip to content

Instantly share code, notes, and snippets.

@hyperfocus1338
hyperfocus1338 / local.yml
Created August 23, 2014 17:31
Playbook file created for the Ansible local provisioner with Packer
---
- name: update apt cache
command: apt-get update -y
- name: upgrade linux kernel
command: apt-get dist-upgrade -y
- name: upgrade all packages
@hyperfocus1338
hyperfocus1338 / virtualbox.json
Created August 23, 2014 17:28
Virtualbox packer template converted from Veewee
{
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
"scripts": [
"provision/shell/build_time.sh",
"provision/shell/apt.sh",
"provision/shell/sudo.sh",
@hyperfocus1338
hyperfocus1338 / gist:fe1f3c557f8549d3385d
Created July 11, 2014 14:39
Packer Ansible and Shell provisioner example
{
"provisioners": [
{
"type": "shell",
"execute_command": "echo 'vagrant'|sudo -S sh '{{.Path}}'",
"script": "provision/shell/ansible.sh"
},
{
@hyperfocus1338
hyperfocus1338 / gist:9783225
Last active August 29, 2015 13:57
New relic agent compilation error
hyper@cloudserver:~$ sudo pip install newrelic-plugin-agent
Downloading/unpacking newrelic-plugin-agent
Downloading newrelic_plugin_agent-1.2.3.tar.gz
Running setup.py (path:/tmp/pip_build_root/newrelic-plugin-agent/setup.py) egg_info for package newrelic-plugin-agent
Checking /usr for newrelic_plugin_agent installation manifest
Checking /usr for newrelic_plugin_agent installation manifest
Checking /home/hyper/.local/lib/python2.7/site-packages for newrelic_plugin_agent installation manifest
Checking /tmp/pip_build_root/newrelic-plugin-agent for newrelic_plugin_agent installation manifest
Did not find the installed-files.txt manifest uninstallation issue
@hyperfocus1338
hyperfocus1338 / Vagrantfile
Created February 23, 2014 11:53
Amazon AWS Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
override.ssh.username = "ubuntu"
override.ssh.private_key_path = "/path/to/ssh/key"
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@hyperfocus1338
hyperfocus1338 / gist:8803328
Created February 4, 2014 13:12
Compiling Nginx for mod security error
stderr: configure: error: couldn't find APXS
stdout: checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
@hyperfocus1338
hyperfocus1338 / gist:8577582
Last active January 4, 2016 05:49
Idempotent MySQL example which fails to create a database gives error: msg: unable to connect, check login_user and login_password are correct, or alternatively check ~/.my.cnf contains credentials tail -f /var/log/mysql/mysql.log on the host only tells me: 51 Connect root@localhost on website (website is database name)
---
- name: install MySQL
apt: pkg={{ item }}
state=present
update_cache=yes
with_items:
- python-mysqldb
- mysql-client
- mysql-server
@hyperfocus1338
hyperfocus1338 / virtualbox.json
Last active December 25, 2015 10:39
Packer configuration
{
"builders": [
{
"type": "virtualbox",
"iso_url": "http://releases.ubuntu.com/12.04/ubuntu-12.04.3-server-amd64.iso",
"iso_checksum": "61d5e67c70d97b33c13537461a0b153b41304ef412bb0e9d813bb157068c3c65",
"iso_checksum_type": "sha256",
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_wait_timeout": "300s",
@hyperfocus1338
hyperfocus1338 / gist:6696657
Last active December 23, 2015 21:29
Shell script for Packer build
#!/usr/bin/env bash -x
echo 'update software'
sudo apt-get update -y
sleep 2