Skip to content

Instantly share code, notes, and snippets.

@sherwind
sherwind / check_dnsbl.pl
Created August 4, 2010 08:38
A Nagios script that checks if a server is listed in a RBL
#!/usr/bin/perl -wT
# A Nagios script that checks if a server is listed in a RBL
# by Sherwin Daganato <sherwin@daganato.com>, 20070607
$|++;
use strict;
use Getopt::Long;
# --- BEGIN config
Name: phantomjs
Version: 2.0.0
Release: 1%{?dist}
Summary: A headless WebKit with JavaScript API
Group: Applications/Internet
License: BSD-3-Clause
URL: http://phantomjs.org
Source0: https://bitbucket.org/ariya/phantomjs/downloads/%{name}-%{version}-source.zip
@sherwind
sherwind / check_interface_bandwidth.pl
Created April 15, 2017 03:45
Nagios plugin to check network interface throughput
#!/usr/bin/env perl
# Nagios plugin to check network interface throughput
# by Sherwin Daganato, 20170415
use CHI;
use Time::HiRes qw(gettimeofday tv_interval);
use Cwd qw(realpath);
use Monitoring::Plugin;
use List::Util qw(max);
@sherwind
sherwind / retry_cmd.sh
Created April 9, 2018 11:08
bash function to retry command
retry_cmd()
{
attempts=15
false
while [ "${?}" -gt 0 ]; do
if [ "${attempts}" -eq 0 ]; then
logger --tag "$0" -- "Failed to run $*: $output"
return
fi
@sherwind
sherwind / USDJPY Assumption v1.pinescript
Last active April 21, 2018 11:18
USDJPY Assumption v1
//@version=3
//
// Based on the "logical trading" post of Charles Cornley (thanks!).
//
// Indicator States:
//
// Very Bullish (Lime) = USD trend rising and JPY trend falling and Gold trend falling and US 10Y Bond trend falling and
// Dow Jones trend rising and Nasdaq trend rising and Russell 2000 trend rising and
// S&P 500 trend rising and Nikkei 225 trend rising
//
@sherwind
sherwind / Trading the Loonie.pinescript
Created April 21, 2018 15:49
Trading the Loonie (CADUSD)
//@version=3
//
// A port of the trading strategy described at http://technical.traders.com/content/TTlink.asp?mo=12&yr=2015
//
// "In “Trading The Loonie,” which appeared in the December 2015 issue of STOCKS & COMMODITIES, author Markos Katsanos
// explains the heavy correlation between the Canadian dollar and crude oil. He then goes on to describe how one could
// trade this correlation. Using similar logic as that employed in Bollinger Bands, Katsanos has built a study to
// provide buy and sell signals for trading the Canadian dollar future."
//
// See Also:
//@version=3
//
// A port of the MT4 indicator of Mladen Rakic found at https://www.mql5.com/en/forum/179876
// which is based on Dynamic Zones that was originally published in Stocks & Commodities 1996 issue.
//
// Dynamic Zones is meant to be applied to oscillators to get dynamic overbought and oversold levels
// quantified using statistical methods.
//
//
// -----------------------------------------------------------------------------
//@version=3
//
// This volume indicator works best on comparatively small timeframes (15 minutes, for example).
//
// Based on:
// - Normalized Volume Oscillator - indicator for MetaTrader 4 <https://www.mql5.com/en/code/8208>
// - Using Tick Volume in Forex: A Clear NVO Based Example <http://mechanicalforex.com/2010/08/using-tick-volume-in-forex-clear.html>
//
// See also:
// - Are price updates a good proxy for actual traded volume in FX? <https://www.fxstreet.com/education/are-price-updates-a-good-proxy-for-actual-traded-201104220000>
//@version=3
//
// 10-Year Bond Yield Spread using Quandl data
//
// See also:
// - https://seekingalpha.com/article/3697846-drives-foreign-exchange-rate-differentials
// - https://www.babypips.com/learn/forex/interest-rates-101
// - https://www.forexfactory.com/showthread.php?p=3382194#post3382194
//
// -----------------------------------------------------------------------------
//@version=3
//
// Measures buying and selling pressure over a given lookback period.
// As described at http://traders.com/Documentation/FEEDbk_docs/2015/10/TradersTips.html
//
// See also:
// - Are price updates a good proxy for actual traded volume in FX? <https://www.fxstreet.com/education/are-price-updates-a-good-proxy-for-actual-traded-201104220000>
// - Using Tick Volume in Forex: A Clear NVO Based Example <http://mechanicalforex.com/2010/08/using-tick-volume-in-forex-clear.html>
//
// -----------------------------------------------------------------------------