Skip to content

Instantly share code, notes, and snippets.

View cdgraff's full-sized avatar

AlejandroF cdgraff

View GitHub Profile
# Based on https://github.com/ripienaar/mcollective-plugins/blob/master/agent/urltest/urltest.rb
require 'net/http'
require 'socket'
req_url = "http://www.google.com"
url = URI.parse(req_url)
@cdgraff
cdgraff / gist:8578424
Last active September 25, 2023 23:53
logstash filter pattern for Icecast2
input {
file {
path => "/var/log/icecast/access.*"
type => "icecast"
start_position=>"beginning" # this be to import old logs
}
}
filter {
if [type] == "icecast" {
@cdgraff
cdgraff / gist:9178068
Created February 23, 2014 22:10
graphana debug json response 1
[{"target": "200", "datapoints": [[null, 1393189800], [930.0, 1393189860], [1023.0, 1393189920], [942.0, 1393189980], [925.0, 1393190040], [923.0, 1393190100], [1052.0, 1393190160], [873.0, 1393190220], [1031.0, 1393190280], [983.0, 1393190340], [824.0, 1393190400], [943.0, 1393190460], [1055.0, 1393190520], [979.0, 1393190580], [953.0, 1393190640], [883.0, 1393190700], [903.0, 1393190760], [899.0, 1393190820], [897.0, 1393190880], [861.0, 1393190940], [995.0, 1393191000], [971.0, 1393191060], [962.0, 1393191120], [1030.0, 1393191180], [1003.0, 1393191240], [947.0, 1393191300], [952.0, 1393191360], [966.0, 1393191420], [914.0, 1393191480], [849.0, 1393191540], [959.0, 1393191600], [940.0, 1393191660], [869.0, 1393191720], [972.0, 1393191780], [901.0, 1393191840], [1001.0, 1393191900], [937.0, 1393191960], [856.0, 1393192020], [850.0, 1393192080], [894.0, 1393192140], [952.0, 1393192200], [952.0, 1393192260], [1018.0, 1393192320], [1087.0, 1393192380], [1084.0, 1393192440], [1008.0, 1393192500], [959.0, 139319
@cdgraff
cdgraff / install-ffmpeg-amazon-linux.sh
Last active August 29, 2015 14:10 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
Shell Script to install FFMpeg into Amazon Linux - Updated 4/12/2014
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@cdgraff
cdgraff / install-avconv-amazon-linux-2014.09.sh
Last active December 27, 2016 11:19
install-avconv-amazon-linux-2014.09
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
# and modified to works with libav and some extra improvements
# Updated 09/01/2015 by Alejandro Ferrari (www.wmconsulting.info)
# Tested with Amazon Linux 2014.09 and Centos 6.6
# can download Docker image with AVCONV build from here:
# URL Docker
if [ "`/usr/bin/whoami`" != "root" ]; then
#! /bin/bash
sudo yum install -y gcc g++ gtk+-devel libjpeg-devel libtiff-devel jasper-devel libpng-devel zlib-devel cmake unzip
sudo yum install -y yum-priorities
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo yum install -y eigen3-devel --enablerepo=epel
pip27 install numpy
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.9/opencv-2.4.9.zip
unzip opencv-2.4.9
cd opencv-2.4.9
@cdgraff
cdgraff / gist:c25c2dcdf2e88c5bb607
Last active August 29, 2015 14:16 — forked from tnolet/gist:7361441
Shell Script to compile Collectd
#!/bin/bash
# Perform installation as root
# Install prereqs
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++ yajl yajl-devel perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
# Get Collectd, untar it, make it and install
cd /usr/local/src
wget http://collectd.org/files/collectd-5.4.2.tar.gz
tar zxvf collectd-5.4.2.tar.gz
--- /usr/src/ixgbevf-2.16.1/src/kcompat.h.orig 2015-02-03 18:34:22.901474028 +0000
+++ /usr/src/ixgbevf-2.16.1/src/kcompat.h 2015-02-03 18:35:32.577440102 +0000
@@ -3219,8 +3219,6 @@
#define u64_stats_update_begin(a) do { } while(0)
#define u64_stats_update_end(a) do { } while(0)
#define u64_stats_fetch_begin(a) do { } while(0)
-#define u64_stats_fetch_retry_bh(a) (0)
-#define u64_stats_fetch_begin_bh(a) (0)
#if (RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,1))
ssh ubuntu@n.n.n.n "bash -s -x" -- <ixgbevf-upgrade.sh
#!/bin/bash
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker