Skip to content

Instantly share code, notes, and snippets.

View lonefreak's full-sized avatar

Fabricio Leotti lonefreak

View GitHub Profile
@lonefreak
lonefreak / kitchen_centos
Created May 6, 2014 01:24
Chef + Knife Solo + Ruby 2.1.0 on CentOS
#!/usr/bin/env bash
# repository
cd /tmp
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# system update
yum -y update
yum -y install gcc
yum -y install *gcc-c++*
@lonefreak
lonefreak / pick_a_language
Created March 10, 2015 01:14
A short ruby program to randomly choose between some programming languages
#! /usr/bin/ruby
#pick a programming language
def get_language()
known_languages = ["ruby","javascript","php","java","perl"]
special_languages = ["python","go","scala","clojure","groovy"]
roll = rand(0..5)
return special_languages[roll] unless roll == 5
return known_languages[rand(0..4)]
end
@lonefreak
lonefreak / shared_folder_centos_virtualbox.txt
Last active September 1, 2015 07:26 — forked from larsar/shared_folder_centos_virtualbox.txt
Mount shared folder on CentOS in VirtualBox
# The VirtualBox documentation[1] for how to install guest additions
# for Linux on a virtual host is somewhat messy. So here is what
# I did to make it work.
# Install the packages required
yum update
yum install gcc kernel-devel make
reboot
@lonefreak
lonefreak / gist:3488270
Created August 27, 2012 13:07
Graphite Virtual Host
# You may need to manually edit this file to fit your needs.
# This configuration assumes the default installation prefix
# of /opt/graphite/, if you installed graphite somewhere else
# you will need to change all the occurances of /opt/graphite/
# in this file to your chosen install location.
<VirtualHost *:80>
ServerName <HOST PARA ACESSO AOS RELATORIOS>
DocumentRoot "/opt/graphite/webapp"
ErrorLog /opt/graphite/storage/log/webapp/error.log
@lonefreak
lonefreak / gist:3497545
Created August 28, 2012 12:03
Logster Runtime
logster --output=graphite --graphite-host=localhost:2003 MetricLogster /tmp/auditoria.log
--dry-run - só usar essa opção para testes
@lonefreak
lonefreak / graphite-centos6-install.sh
Created August 28, 2012 12:37 — forked from dillera/graphite-centos6-install.txt
Install Graphite 0.9.9 on Centos 6
#! /bin/sh
# FOR CENTOS 6
# Andrew Diller Jan 2012
# Modified by Fabricio Leotti Aug 2012
# Get EPEL Repo installed
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm
# Comment all "mirrorlist=" lines in /etc/yum.repos.d/epel.repo
sed -i s/^mirrorlist=/#mirrorlist=/g /etc/yum.repos.d/epel.repo
@lonefreak
lonefreak / gist:3502534
Created August 28, 2012 19:04
Install Logster on Centos
# Fabricio Leotti Aug 2012
# Instal Logcheck
yum -y install logcheck
# Download Logster
git clone https://github.com/etsy/logster.git
# Install Logster
cd logster
@lonefreak
lonefreak / logster.sh
Created September 4, 2012 13:52
Logster Wrapper
#! /bin/sh
usage() {
cat <<EOF
USAGE: $0 -h HOSTNAME [-p PORT] -f LOGFILE [-d -r]
HOSTNAME - hostname or IP address for the graphite server
PORT - port where the graphite server listens
LOGFILE - the path for the logfile that will be parsed
d - debug mode on
@lonefreak
lonefreak / gist:4024419
Created November 6, 2012 12:47
Reboot windows without login screen
1. Click Start, click Run, and type "control userpasswords2" without quotes.
2. Highlight your account and uncheck the "Users must enter a username and password to use this computer".
3. Click Apply.
4. Enter the password, then click OK.
5. Click OK again and you're all done.
@lonefreak
lonefreak / graphite-0.9.10-centos-6.2.sh
Created November 7, 2012 19:05
Install Graphite 0.9.10 on CentOS 6.2
#! /bin/sh
# GRAPHITE 0.9.10
# FOR CENTOS 6
# Andrew Diller Jan 2012
# Modified by Fabricio Leotti Nov 2012
# THIS SCRIPT DEPENDS ON PYTHON 2.6 (NO MORE, NO LESS)
# Get EPEL Repo installed
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm