Skip to content

Instantly share code, notes, and snippets.

View abeyt's full-sized avatar
🌴
On vacation

abeyt

🌴
On vacation
View GitHub Profile
Logstash Configuration...
input {
file {
format => "plain"
path => "/var/log/apache2/*error.log"
type => "apacheerror"
}
}
filter {
@abeyt
abeyt / hosts.j2
Last active August 29, 2015 14:17 — forked from geowa4/hosts.j2
[a]
{% for a in a_provision.instances %}
{{ a.rax_accessipv4 }}
{% endfor %}
[b]
{% for b in b_provision.instances %}
{{ b.rax_accessipv4 }}
{% endfor %}
---
# This has been tested with ansible 1.3 with these commands:
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true"
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts"
# NB: The type of the variable is crucial!
- name: Ansible Conditionals Examples
hosts: $hosts
vars_files:
@abeyt
abeyt / README.md
Last active August 29, 2015 14:22 — forked from oodavid/README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

#!/bin/bash
# Configure the instance to run as a Port Address Translator (PAT) to provide
# Internet connectivity to private instances.
function log { logger -t "vpc" -- $1; }
function die {
[ -n "$1" ] && log "$1"
log "Configuration of PAT failed!"
exit 1
@abeyt
abeyt / enable_serial_console.sh
Last active September 19, 2022 16:57 — forked from stefanozanella/enable_serial_console.sh
Enable serial console output in CentOS 7
echo "ttyS0" >> /etc/securetty
vi /etc/default/grub
# Add console=ttyS0 to the end of kernel line(s) "GRUB_CMDLINE_LINUX"
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
#vi /etc/sysconfig/init
# Edit ACTIVE_CONSOLES to look like:
#ACTIVE_CONSOLES="/dev/tty[1-6] /dev/ttyS0"
@abeyt
abeyt / gist:7a7a7be652581f776f49
Last active September 9, 2015 15:28 — forked from chrisgilbert/gist:58f57c82f74162ed5c0f
Run Ansible or Ansible-Playbook from Rundeck
#!/bin/bash
# Interpret whether the input needs to go to ansible, or ansible-playbook and run appropriately
# First update the git repos for each project
/usr/bin/update-git-repos
export ANSIBLE_FORCE_COLOR=1
export ANSIBLE_RETRY_FILES_ENABLED=False
#!/bin/bash
####
#Script installs libraries needed after java has been installed on
# fedora 22/23
####
dnf install opencv wmctrl tesseract xdotool redhat-lsb-core -y
@abeyt
abeyt / prepare tmpfs bricks
Created January 22, 2016 17:24 — forked from enakai00/prepare tmpfs bricks
Prepare Fedora GlusterFS nodes with tmpfs brick
#!/bin/bash -x
setenforce 0
curl http://download.gluster.org/pub/gluster/glusterfs/LATEST/Fedora/glusterfs-fedora.repo > /etc/yum.repos.d/gluster.repo
yum -y install glusterfs-server glusterfs-geo-replication
chkconfig glusterd on
service glusterd start
chkconfig iptables off
service iptables stop
mkdir -p /bricks/tmpfs
umount /bricks/tmpfs