Skip to content

Instantly share code, notes, and snippets.

theeye-io

Block or report user

Report or block theeye-io

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@theeye-io
theeye-io / calculateUserByHour.sh
Created Mar 4, 2018
This scripts calculates the total worked hours by Ticker user for a given date.
View calculateUserByHour.sh
#!/bin/bash
token="YourToken"
user="YourUser"
id="YourID"
startsDay="2018-02-01"
endsDay="2018-02-28"
users=$(curl -s -H "Authorization: Token token=$token" \
-H "User-Agent: Theeye ($user)" \
https://www.tickspot.com/$id/api/v2/users|jq '.[]| "\(.id) \(.email)"')
for interactano in ${users//" "/"|"}
@theeye-io
theeye-io / checkRDSFreeSpace.sh
Created Feb 18, 2018
This script monitors free storage for a given database and limit.
View checkRDSFreeSpace.sh
#!/bin/bash
if [ $# -ne 2 ];then echo "Run $0 db-instance-identifier freeStorageLimit" ; exit ; fi
database=$1
limit=$2
region=$(/usr/bin/curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
conv=$(echo '1024^3' | bc)
freeStorage=$(aws cloudwatch --region ${region} get-metric-statistics --start-time $(date -u +%FT%T --date '1 minute ago') --end-time $(date -u +%FT%T) --period 60 --namespace AWS/RDS --statistics Maximum --dimensions Name=DBInstanceIdentifier,Value=${database} --metric-name FreeStorageSpace | jq -r '.Datapoints[].Maximum')
@theeye-io
theeye-io / upgradebitcoresegwit.sh
Last active Dec 29, 2017
Upgrade your bitcore full node for segwit according to https://blog.bitpay.com/bitcore-segwit-activation/
View upgradebitcoresegwit.sh
#!/bin/bash
version="1.14.5"
wget https://github.com/btc1/bitcoin/releases/download/v$version/bitcoin-$version-x86_64-linux-gnu.tar.gz
wget https://github.com/btc1/bitcoin/releases/download/v$version/SHA256SUMS
sha256sum=$(sha256sum bitcoin-$version-x86_64-linux-gnu.tar.gz|awk '{ print $1 }')
grep $sha256sum SHA256SUMS
if [ $? -eq 0 ];then
#Install
tar zxvf bitcoin-$version-x86_64-linux-gnu.tar.gz
#Replace bitcoind binary
@theeye-io
theeye-io / UptimeLessThanOneMinute.sh
Created Oct 10, 2017
This script verifies if a Linux host ran less than 1 minute.
View UptimeLessThanOneMinute.sh
read -d. uptime < /proc/uptime
if (( uptime > 1 ))
then
echo failure
else
echo normal
fi
@theeye-io
theeye-io / monitorBitcoindSyncPercentage.sh
Last active Jul 25, 2017
For a $1 Path It verifies if $2 log sync is below 99%
View monitorBitcoindSyncPercentage.sh
#!/bin/bash
cd $1
lastPercentageInteger=$(tail $2|grep Percentage|cut -d':' -f6|tail -n1|cut -d'.' -f1|tr -d ' ')
if [ $lastPercentageInteger -lt 99 ];then
echo "Percentage is $lastPercentageInteger which is lower than 99";
echo failure
else
echo normal
fi
@theeye-io
theeye-io / monitorIfpriceGoesDown.sh
Created May 22, 2017
Bash Script monitor to get ETH pricing and compare if pricing is going down.
View monitorIfpriceGoesDown.sh
#!/bin/bash
#This script gets a minum percent as a warning threshold for monitoring ETH value in USD decrease.
#Receives
# {
# "ask": 156.36401186,
# "bid": 156.08050201,
# "high": "160",
# "last": "156.38627418",
# "low": "125.27376294",
# "timestamp": "1495427025",
@theeye-io
theeye-io / parsesOracleUsageTable.sh
Last active May 16, 2017
Based on a query from oracle database, remove unused and malformed lines and return pretty output
View parsesOracleUsageTable.sh
#!/bin/bash
limit=$1
file=$2
echo "Checking $file . Limit $limit"
echo
# remove trash lines and apply format
# output get out in two columns NAME > VALUE
@theeye-io
theeye-io / solarisIOStatCheck.sh
Last active May 16, 2017
Connect via ssh , run iostat command , and parse
View solarisIOStatCheck.sh
#!/bin/bash
#
# Script Parameters.
# ==============
# @param $1 device
# @param $2 limit
# @param $3 column
#
# do man iostat for more data
# columns
@theeye-io
theeye-io / checkResponseTime.js
Created May 10, 2017
Response Time Check using curl and nodejs
View checkResponseTime.js
var exec = require('child_process').exec;
var url = process.argv[2];
var threshold = parseFloat(process.argv[3]);
var eventName;
var state;
var cmd = 'curl -o /dev/null -s -w %{time_total} ' + url;
@theeye-io
theeye-io / mailqueuemonitor.sh
Created Apr 19, 2017
This Script Monitors Linux mail queue
View mailqueuemonitor.sh
#!/bin/bash
mailq_count=`/usr/bin/mailq | /usr/bin/tail -n1 | /usr/bin/gawk '{print $5}'`
mailq_count=`expr $mailq_count + 0`
echo "Mail count on Server is $mailq_count"
result="normal"
if [ $mailq_count -gt $1 ]; then
result="failure"
fi
echo $result
You can’t perform that action at this time.