Skip to content

Instantly share code, notes, and snippets.

@ralphotowo
ralphotowo / comparer.py
Created March 16, 2016 16:27 — forked from th0ma5w/comparer.py
CSV logging script for stock dump1090
#!/usr/bin/python
#
# CSV logging script for stock dump1090
#
# Uses the Requests library to compare the state of planes in view
# and prints changes to standard out
#
# Start dump1090
# modify this script to point to your dump1090 URL if different
# run the script and pipe the output to a file eg:
@ralphotowo
ralphotowo / rPi3-ap-setup.sh
Created April 2, 2016 14:59 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
if [[ $# -ne 1 ]];
then echo "You need to pass a password!"
echo "Usage:"
@ralphotowo
ralphotowo / Ruby 2.0 on CentOS 6
Created July 5, 2016 22:44 — forked from rtacconi/Ruby 2.0 on CentOS 6
Compile Ruby 2.0 p647 on CentOS 6
#!/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 groupinstall "Development Tools"
yum -y install libxslt-devel libyaml-devel libxml2-devel gdbm-devel libffi-devel zlib-devel openssl-devel libyaml-devel readline-devel curl-devel openssl-devel pcre-devel git memcached-devel valgrind-devel mysql-devel ImageMagick-devel ImageMagick
@ralphotowo
ralphotowo / etc init.d unicorn-redmine
Created July 6, 2016 01:22 — forked from shrkw/etc init.d unicorn-redmine
init script for unicorn on RHEL, Cent OS, Scientific Linux way
#!/bin/sh
#
# unicorn_redmine Startup script for unicorn for redmine
#
# chkconfig: - 86 14
# processname: unicorn_rails
# pidfile: /opt/redmine/tmp/pids/unicorn.pid
# description: Rails application server for Redmine
#
### BEGIN INIT INFO
@ralphotowo
ralphotowo / collectd.conf
Created April 16, 2017 21:11 — forked from uffsalot/collectd.conf
sample collectd.conf
FQDNLookup true
Interval 120
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
LoadPlugin disk
@ralphotowo
ralphotowo / collectd.conf
Created April 17, 2017 21:19 — forked from anthony-kam/collectd.conf
Collectd.conf with pretty generic metrics
### collectd.conf config file (Collectd 5.5)
FQDNLookup true
Interval 300
Timeout 2
ReadThreads 5
LoadPlugin syslog
@ralphotowo
ralphotowo / munch.c
Created April 19, 2017 16:23
C app (munch.c) to gobble up memory
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv) {
int max = -1;
int mb = 0;
char* buffer;
if(argc > 1)
@ralphotowo
ralphotowo / MySQL Replication Check
Created May 4, 2017 09:36 — forked from ssimpson89/MySQL Replication Check
Just a simple Mysql Replication Health Check script I wrote. You can put this in a cron.
#!/bin/bash
### VARIABLES ### \
EMAIL=""
SERVER=$(hostname)
MYSQL_CHECK=$(mysql -e "SHOW VARIABLES LIKE '%version%';" || echo 1)
LAST_ERRNO=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Last_Errno" | awk '{ print $2 }')
SECONDS_BEHIND_MASTER=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G"| grep "Seconds_Behind_Master" | awk '{ print $2 }')
IO_IS_RUNNING=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Slave_IO_Running" | awk '{ print $2 }')
SQL_IS_RUNNING=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Slave_SQL_Running" | awk '{ print $2 }')
@ralphotowo
ralphotowo / db-connect-test.php
Created May 13, 2017 14:31 — forked from M165437/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
@ralphotowo
ralphotowo / gist:fe8ec3d7ec10f510dbcc3120f16ce019
Created June 11, 2017 10:37 — forked from nkokkos/gist:4f8c8d56bba3762a11fa
cache_store.yml and redis.yml files
#cache_store.yml file:
production:
cache_store: redis_store
servers:
- redis://localhost
database: 1
#redis.yml file:
production: