Skip to content

Instantly share code, notes, and snippets.

View mabrizio's full-sized avatar
:octocat:
Nobody cares!

Mauricio Araya V. mabrizio

:octocat:
Nobody cares!
View GitHub Profile
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
end

Keybase proof

I hereby claim:

  • I am mabrizio on github.
  • I am maraya (https://keybase.io/maraya) on keybase.
  • I have a public key ASAhxUnZyyJqUHGkUzFGAEGEV0RJjb34E30Rt4kSFBdUTAo

To claim this, I am signing this object:

@mabrizio
mabrizio / rename.pl
Created July 22, 2014 22:22
rename.pl
#!/usr/bin/perl -w
#
# This script was developed by Robin Barker (Robin.Barker@npl.co.uk),
# from Larry Wall's original script eg/rename from the perl source.
#
# This script is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
#
# Larry(?)'s RCS header:
# RCSfile: rename,v Revision: 4.1 Date: 92/08/07 17:20:30
@mabrizio
mabrizio / 0_reuse_code.js
Created May 14, 2014 17:58
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
@mabrizio
mabrizio / bash_profile
Last active August 29, 2015 13:57
Bash Profile
export CLICOLOR=1
export LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx
# green, bold[reset, now, green, bold]reset, bold, pwd:>
export PS1="\[\e[01;32m\]\[\e[1m\][\[\e[0m\]\t\[\e[01;32m\]\[\e[1m\]]\[\e[0m\]\[\e[1m\] \w:>\[\e[0m\] "
# Ctrl w, al estilo tcsh
stty werase undef
bind '"\C-w":backward-kill-word'
@mabrizio
mabrizio / robots-from-cloudfront.vcl
Created January 30, 2014 19:32
Robots disallow robots from CloudFront
if (req.url ~ "^/robots.txt$") {
if (req.http.User-Agent ~ "CloudFront")
{
set obj.http.Content-Type = "text/plain; charset=utf-8";
synthetic {"User-agent: *\nDisallow: /"};
}
return (deliver)
}
@mabrizio
mabrizio / vimrc
Created January 27, 2014 04:29
.vimrc
if v:progname =~? "evim"
finish
endif
set sw=4 "Identation is now 4 white spaces
set nocompatible
set nomodeline
set backspace=indent,eol,start
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
@mabrizio
mabrizio / apache-visitors-per-ip-per-day.tcsh
Created January 20, 2014 17:27
Visitors per ip per day - Apache
#!/usr/bin/env tcsh
foreach i (`cat access.log | cut -d \] -f1 | cut -d \[ -f2 | cut -d \: -f1 | perl -ne 'print unless $seen{$_}++' `)
printf "$i -> "
printf `grep $i access.log | awk '{print $1}' | sort | uniq | wc -l`
echo " different IPs"
end
@mabrizio
mabrizio / ubuntu-nagios-recipe.sh
Last active January 3, 2016 12:38
Ubuntu + Nagios recipe
# inspired by: http://wellsie.net/p/248/
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install libgd2-xpm-dev apache2 apache2-mpm-prefork \
apache2-threaded-dev apache2-utils apache2.2-bin \
apache2.2-common libapache2-mod-php5 php5 gcc g++ \
make daemon libnet-snmp-perl libperl5.14 libpq5 \
libradius1 libsensors4 libsnmp libcgi-pm-perl \
@mabrizio
mabrizio / etc-init.d-nagios.sh
Last active January 3, 2016 12:39
Nagios service startup script
#!/bin/sh
# Nagios Startup script for the Nagios monitoring daemon
#
# chkconfig: - 85 15
# description: Nagios is a service monitoring system
# processname: nagios
# config: /etc/nagios/nagios.cfg
# pidfile: /var/nagios/nagios.pid
#