Skip to content

Instantly share code, notes, and snippets.

View bdossantos's full-sized avatar

Benjamin Dos Santos bdossantos

View GitHub Profile
@bdossantos
bdossantos / gist:1476720
Created December 14, 2011 14:13
proto.c
#include <stdio.h>
#include <netdb.h>
int main(void) {
struct protoent *proto;
setprotoent(0);
while ((proto = getprotoent()) != NULL) {
fprintf (stdout, "%s ", proto->p_name);
@bdossantos
bdossantos / gist:1758870
Created February 7, 2012 09:57
CDN OVH vs Dédié

Test CDN OVH vs Serveur dédié OVH

From: New York, NY - IE9 - DSL

CDN

cdn.optin-machine.com/test.png

CDN

@bdossantos
bdossantos / check_ddos.sh
Last active April 24, 2017 15:31
Check DDOS attack plugin for Nagios
#!/bin/bash
#
# /!\ moved to https://github.com/bdossantos/nagios-plugins
#
# check_ddos Nagios plugin
#
# Options :
# -w/--warning)
# Warning value (number of SYN_RECV)
#
@bdossantos
bdossantos / gist:3529034
Last active October 9, 2015 15:17
Install check_nrpe for shinken
cd /usr/local/src/
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.14.tar.gz
tar -zxf nrpe-2.14.tar.gz
cd nrpe-2.14
./configure --with-nagios-user=shinken --with-nagios-group=shinken --libexecdir=/usr/local/shinken/libexec --enable-libtap --enable-extra-opts --enable-perl-MODULES
make all
make install-plugin
@bdossantos
bdossantos / gist:3772737
Created September 23, 2012 19:21
munin apache plugins
#!/bin/bash
apt-get install libio-all-lwp-perl -y;
ln -s /usr/share/munin/plugins/apache_* /etc/munin/plugins/;
invoke-rc.d munin-node restart;
@bdossantos
bdossantos / gist:3778723
Created September 24, 2012 22:02
Install node.js via nave
#!/bin/bash
apt-get install libssl-dev build-essential git-core -y;
git clone git://github.com/isaacs/nave.git /usr/local/src/nave;
pushd /usr/local/src/nave
chmod +x nave.sh;
./nave.sh usemain 0.8.9;
popd
@bdossantos
bdossantos / default.rb
Created November 25, 2012 12:08 — forked from wilmoore/default.rb
DIY Private Cloud w/ VirtualBox and Chef
# Cookbook Name:: mongodb
# Recipe:: default
case node['platform']
when "ubuntu"
execute "apt-get update" do
action :nothing
end
execute "add gpg key" do
@bdossantos
bdossantos / gist:4258785
Created December 11, 2012 14:03
check_load
time 5 min 10 min 15 min
warning: 90% 70% 60%
critical: 100% 80% 70%
@bdossantos
bdossantos / gist:4285967
Created December 14, 2012 14:50
Nginx lb + CouchDB
# client body
client_header_timeout 3600;
client_body_timeout 3600;
client_max_body_size 128m;
# proxy options
proxy_read_timeout 3600;
proxy_connect_timeout 3600;
#ignore_invalid_headers on;
@bdossantos
bdossantos / gist:4336039
Created December 19, 2012 11:24
ping test
bdossantos:~/ $ ping -c 4 91.121.149.132
PING 91.121.149.132 (91.121.149.132): 56 data bytes
64 bytes from 91.121.149.132: icmp_seq=0 ttl=54 time=87.858 ms
64 bytes from 91.121.149.132: icmp_seq=1 ttl=54 time=77.375 ms
64 bytes from 91.121.149.132: icmp_seq=2 ttl=54 time=76.998 ms
64 bytes from 91.121.149.132: icmp_seq=3 ttl=54 time=75.763 ms
--- 91.121.149.132 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss