Skip to content

Instantly share code, notes, and snippets.

@zyphlar
zyphlar / detect_signal.grc
Created May 22, 2019 03:21
Trying to detect when there's a signal on a frequency
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.11'?>
<flow_graph>
<timestamp>Tue May 21 15:46:50 2019</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@zyphlar
zyphlar / REFILE-WATERMARK.md
Last active May 18, 2019 19:48
Adds Watermarking ability to Refile

Usage:

#fill_watermark_text(img, width, height, text, gravity = "Center")
attachment_url(object, :attachment, :fill_watermark_text, 800, 600, "My Watermark")
@zyphlar
zyphlar / cloudwatch-alarm-to-slack.js
Last active February 6, 2019 12:00
See comments
'use strict';
/**
* See http://notes.webutvikling.org/send-aws-cloudwatch-alarms-to-slack/ for instructions
* But I like this code better because the snsToSlack.js code doesn't parse the CloudWatch JSON
*
* Follow these steps to configure the webhook in Slack:
*
* 1. Navigate to https://<your-team-domain>.slack.com/services/new
*
@zyphlar
zyphlar / nagios-newmonitor.sh
Created March 16, 2012 17:51
Script to add new monitors in Nagios
#!/bin/bash
# newpingmonitor.sh
# Sets up monitoring for new basic ping monitors in nagios
# Ths script may be called remotely
E_BADARGS=65
if [ ! -n "$1" ]
then
echo "Usage: `basename $0` <servername> <ip address>"
@zyphlar
zyphlar / nag.php
Created January 26, 2012 02:59
Nagios PHP querier
<?php
// nag.php by Will Bradley, www.zyphon.com/arduino-nagios
// Script to parse Nagios status.dat and present it in simplified HTML.
// Also grabs graph images from /pnp4nagios if you edit pnp4nagios' apache.conf to not require authentication.
//
// Based on statusXML.php by Jason Antman
//
// +----------------------------------------------------------------------+
// | PHP EMS Tools http://www.php-ems-tools.com |
// +----------------------------------------------------------------------+
@zyphlar
zyphlar / stanford-prison-cites.txt
Last active June 14, 2018 15:20
stanford-prison-cites
Sarah asserts, "I knew there were some sketchy things about the Stanford prison
experiment but whew this piece!"
Dan asserts, "A rare situation where even I don't care about the truth, either
they weren't monsters and we shouldn't say they were, or they were made monsters
and we still shouldn't say they were. Either way, grant them their peace. And we
should still worry about deference to authority."
Sarah asserts, "Not sure you caught the implications — that the basic premise of
the experiment, that there's a monster in all of us, exonerates systems... A
@zyphlar
zyphlar / create_elastic_cloud_watcher.sh
Last active December 15, 2017 02:34
Creates a Slack-compatible watcher for elastic.co cluster size
curl -u admin -p -XPUT 'https://your_elasticsearch_url:9243/_watcher/watch/cluster_size_watch' -d '{
"trigger" : {
"schedule" : { "interval" : "60s" }
},
"input" : {
"http" : {
"request" : {
"host" : "your_elasticsearch_url",
"port" : 9243,
"scheme" : "https",
twitter
https://twitter.com/MidcourseJam/status/900211595044945920
videobot
https://twitter.com/DSA_Phoenix/status/900205150643658753
videobot
https://twitter.com/Walldo/status/900201042813603841
videobot
@zyphlar
zyphlar / form-field-json-cookies.js
Created October 4, 2012 07:08
Storing & retrieving form fields in a JSON cookie
/* Storing & retrieving form fields in a JSON cookie
* copyright Will Bradley, 2012, released under a CC-BY license
*
* Change all instances of "myform" as necessary.
* Cookie will be stored under the current URL, but
* it won't include any hidden fields, etc.
*/
function setCookie(c_name,value,expireminutes)
{
@zyphlar
zyphlar / output.txt
Last active December 23, 2016 03:18
Calculating subnet masks with PHP
string(14) "--- Binary ---"
string(44) "Base 11000000101010000000000100001110"
string(44) "Mask 11111111111111111111111000000000"
string(44) "BaseNet 11000000101010000000000000000000"
string(44) "Incrementer 00000000000000000000001000000000"
string(44) "Final 11000000101010000000001000000000"
string(10) "--- IP ---"
string(24) "Base 192.168.1.14"
string(25) "Mask 255.255.254.0"
string(23) "BaseNet 192.168.0.0"