Skip to content

Instantly share code, notes, and snippets.

@rubendob
rubendob / nginx.onf
Created September 30, 2012 18:22
Nginx
user nginx;
worker_processes 2;
worker_rlimit_nofile 32768;
error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 4096;
multi_accept on;
@rubendob
rubendob / my.cnf
Created September 30, 2012 18:24
MySQL 5.5 conf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Global Settings
thread_cache_size=4
@rubendob
rubendob / httpd.conf
Last active December 10, 2015 20:59
Httpd.conf sin los módulos innecesarios
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 60
<IfModule prefork.c>
StartServers 16
MinSpareServers 10
@rubendob
rubendob / httpd.conf - Plesk 10.X
Last active December 24, 2015 09:09
Httpd.conf Plesk 10.X
ServerTokens OS
ServerRoot "/etc/httpd"
PidFile run/httpd.pid
Timeout 60
KeepAlive Off
MaxKeepAliveRequests 100
KeepAliveTimeout 15
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
@rubendob
rubendob / varnish.conf
Created February 19, 2014 11:31
varnish for WP
backend default {
.host = "";
.port = "80";
.connect_timeout = 300s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 300s;
.max_connections = 512;
}
acl purge {
@rubendob
rubendob / Vagrantfile
Created March 12, 2015 11:47
PXC-Ansible
-*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
cluster = {
"node1" => { :ip => "192.168.33.50", :cpus => 1, :mem => 1024 },
"node2" => { :ip => "192.168.33.51", :cpus => 1, :mem => 1024 },
"node3" => { :ip => "192.168.33.52", :cpus => 1, :mem => 1024 },
@rubendob
rubendob / gist:15fcfd8cd0ed1c47fbfc
Created February 23, 2016 08:53
mongo db backup script
#!/bin/sh
# MongoDB backup script
# This script is licensed under GNU GPL version 2.0 or above
# It makes a folder under BACKUP folder and compress it into .tar.gz.file
# Using another script we will remove older backups later
# ---------------------------------------------------------------------
### System Setup ###
BACKUP=""
@rubendob
rubendob / fluentd_tcp_localhost_to_debug
Last active April 12, 2018 10:01
Local Fluentd to debug purposes - Ubuntu Xenial 16.04 TLS / fluent-plugin-kv-parser
sudo curl -L https://toolbelt.treasuredata.com/sh/install-ubuntu-xenial-td-agent2.sh | sh config
sudo /usr/sbin/td-agent-gem install fluent-plugin-kv-parser
(edit config file, do backup first)
sudo cp /etc/td-agent/td-agent.conf /etc/td-agent/td-agent.conf.backup
echo "
<source>
@type tcp
tag kv_log # required
# remove previous installed package
sudo apt-get remove --purge ansible
# install pip
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py --user
# install ansible
pip install ansible==2.5.0 --user
# update PATH
@rubendob
rubendob / node_exporter init.d
Created September 6, 2018 09:42
Prometheus node exporter in Debian Wheezy
#!/bin/sh
### BEGIN INIT INFO
# Provides: node_exporter
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $all
# Should-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6