Skip to content

Instantly share code, notes, and snippets.

View bryankaraffa's full-sized avatar
👍

Bryan Karaffa bryankaraffa

👍
View GitHub Profile
#!/bin/bash
user=$DNSMADEEASY_USERNAME
pass=$DNSMADEEASY_PASSWORD
dme_id=$DNSMADEEASY_ID
dme_ip=$CURRENT_IP
# Make the API Request
url="http://www.dnsmadeeasy.com/servlet/updateip?username=${user}&password=${pass}&id=${dme_id}&ip=${dme_ip}";
curl -Is "${url}"
@bryankaraffa
bryankaraffa / my-script.sh
Created July 22, 2016 15:29
Simple script for testing
#!/bin/bash
echo "WRITTEN BY USER:`whomami` ON `date`" >> /tmp/my-testfile
#! /bin/bash
cd /tmp
which gcc 2> /dev/null
if [ "$?" == "0" ]; then
echo "-- gcc detected. Running test application to test for CVE-2015-7547 vulnerability --"
gcc '/tmp/CVE-2015-7547/check.c' -o '/tmp/CVE-2015-7547/check-cve'
@bryankaraffa
bryankaraffa / GenericJMX.conf
Last active April 17, 2017 07:12
collectd-genericjmx
LoadPlugin java
# contrib/GenericJMX.conf
# -----------------------
#
# This is an example config file for the ‘GenericJMX’ plugin, a plugin written
# in Java to receive values via the “Java Management Extensionsâ€<U+009D> (JMX). The
# plugin can be found in the
# bindings/java/org/collectd/java/
# directory of the source distribution.
#
@bryankaraffa
bryankaraffa / check_IpChange.sh
Created December 10, 2015 00:11
Checks to see if the IP of a certain host has changed and restarts the collectd service if it has.
#!/bin/bash -ex
hostname='logstash.calcoasttech.com'
tmp_file='/tmp/logstash_ip.tmp'
ip=`dig +short $hostname`
if [ -f "$tmp_file" ]
then
old_ip=`cat $tmp_file`
http://52.33.44.55/
http://52.25.73.8/
@bryankaraffa
bryankaraffa / function.fillPoints.sql
Last active August 29, 2015 14:20
fillPoints Function
CREATE OR REPLACE FUNCTION fillpoints(amount integer)
RETURNS void AS
$BODY$
DECLARE r_lat FLOAT;
DECLARE r_lon FLOAT;
BEGIN
FOR v_Count IN 1..amount LOOP
r_lat := random()*(-180-180)+180;
r_lon := random()*(-90-90)+90;
INSERT INTO points (name_of_place,location) VALUES ( 'place_'||v_Count, ST_SetSRID( ST_MakePoint( r_lat, r_lon) ,4326) );
@bryankaraffa
bryankaraffa / benchmark-postgis.sql
Last active August 29, 2015 14:20
Creates database, generates random data points, and runs a spatial query to benchmark PostGIS
/* Create point Database */
CREATE DATABASE points
WITH ENCODING='UTF8'
OWNER=postgres
LC_COLLATE='en_US.UTF-8'
LC_CTYPE='en_US.UTF-8'
CONNECTION LIMIT=-1;
/* Select the points database */
\c points;
<!DOCTYPE html>
<html>
<head>
<title>Create a Map</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/dojo/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://js.arcgis.com/3.10/js/esri/css/esri.css">
<style>
html, body, #mapDiv{