Skip to content

Instantly share code, notes, and snippets.

View gerardorochin's full-sized avatar

Gerardo Rochín gerardorochin

View GitHub Profile
@gerardorochin
gerardorochin / php_error_logstash.conf
Created June 2, 2014 15:39
php error logging into logstash + elasticsearch and trace errors on single line and root path hidden
input {
file {
type => "php-error"
path => "/var/www/error_log"
sincedb_path => "/opt/logstash/sincedb-access"
}
}
@gerardorochin
gerardorochin / serf_members_api.rb
Last active August 29, 2015 14:05
Serf members HTTP API
#!/usr/local/bin/ruby
# -*- mode: ruby -*-
# vi: set ft=ruby :
# encoding: UTF-8
#
# Get all members:
# curl "localhost:3737/api/members"
#
# Get members alive:
# curl "localhost:3737/api/members?status=alive"
@gerardorochin
gerardorochin / Make a USB bootable for pfSense on OSX
Created April 25, 2016 18:49
Example for create USB bootable for pfSense using device /dev/disk3
# diskutil list
/dev/disk0 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *121.3 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_CoreStorage Macintosh HD 121.0 GB disk0s2
3: Apple_Boot Boot OS X 134.2 MB disk0s3
/dev/disk1 (internal, physical):
#: TYPE NAME SIZE IDENTIFIER
<?php
$data = array(
"content" => "Pickle Rick motherfuckers!",
);
$ch = curl_init("https://discordapp.com/api/webhooks/<WEBHOOK_ID>/<TOKEN>");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HEADER, 0);