Skip to content

Instantly share code, notes, and snippets.

@Alambador
Alambador / 0_reuse_code.js
Created July 26, 2014 18:36
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#################
#### MODULES ####
@Alambador
Alambador / monitrc
Last active August 29, 2015 14:14 — forked from franck/monitrc
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.
@Alambador
Alambador / es.sh
Last active August 29, 2015 14:17 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@Alambador
Alambador / gist:65dca25c0e73e7a08bc8
Created May 14, 2015 08:46
Shell Script To Monitor Services Such As Web / Http, Ssh, Mail Server
#!/bin/bash
# Shell script to monitor running services such as web/http, ssh, mail etc.
# If service fails it will send an Email to ADMIN user
# -------------------------------------------------------------------------
# Copyright (c) 2006 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# ----------------------------------------------------------------------
@Alambador
Alambador / notes.md
Last active August 29, 2015 14:21 — forked from DavidWittman/notes.md

A Brief Introduction to Fabric

Fabric is a deployment management framework written in Python which makes remotely managing multiple servers incredibly easy. If you've ever had to issue a change to a group servers, this should look pretty familiar:

for s in $(cat servers.txt); do ssh $s service httpd graceful; done

Fabric improves on this process by providing a suite of functions to run commands on the servers, as well as a number of other features which just aren't possible in a simple for loop. While a working knowledge of Python is helpful when using Fabric, it certainly isn't necessary. This tutorial will cover the steps necessary to get started with the framework and introduce how it can be used to improve on administering groups of servers.

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2015-01-21T15:24:57Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@Alambador
Alambador / crlf.sh
Created August 29, 2015 17:37
Converts a DOS text file to Unix format
#!/usr/bin/bash
if [ -z "$1" ]
then
echo "Usage: `basename $0` filename-to-convert"
exit 1
fi
# Lines in a DOS text file end in a CR-LF.
CR='\015' # Carriage return.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Alexey Kutepov a.k.a. rexim
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
@Alambador
Alambador / linode-stackscript-centos-lemp-advanced
Created September 27, 2016 22:08 — forked from cballou/linode-stackscript-centos-lemp-advanced
An advanced Linode StackScript for deploying a CentOs 64bit LEMP Stack with a ton of extras and configuration: MySQL, Suhosin, Memcached, Monit, Supervisord, Gearman, Beanstalk, Fail2Ban, IPTables Firewall, SSH
#!/bin/bash
#
# MYSQL CONFIG
# ============
# <UDF name="db_password" Label="Choose a MySQL Root Password" />
# <UDF name="db_name" Label="MySQL - Database Name" default="" example="Optionally create this database." />
# <UDF name="db_user" Label="MySQL - Username" default="" example="Optionally create this user." />
# <UDF name="db_user_password" Label="MySQL - Password" default="" example="The user password." />
#
# OPTIONAL LIBRARIES TO INSTALL