Skip to content

Instantly share code, notes, and snippets.

View makopov's full-sized avatar

Michael Akopov makopov

View GitHub Profile
@makopov
makopov / ticker.sh
Created March 22, 2023 05:18
This gets ticker information from Yahoo and prints it in your command line
#!/usr/bin/env bash
set -e
LANG=C
LC_NUMERIC=C
SYMBOLS=("$@")
if ! $(type jq > /dev/null 2>&1); then
echo "'jq' is not in the PATH. (See: https://stedolan.github.io/jq/)"
@makopov
makopov / antminer_status.sh
Created February 22, 2018 18:49
Bash script to get current hashing rate of miner and reboot when its low. Emailing you of the event with hash rate and that the system is back online.
#!/usr/bin/env bash
# This bash script is used to login to the antminer, determine hash rate, check if its below a threshold.
# If it is then reboot the miner, email the hashrate and the event.
# Wait 90 seconds (per the antminer docs), email out an uptime to verify that its resumed.
# Using sshpass since my version of antminer wipes all ssh keys upon reboot
# Replace passwords, IP's and email address as needed
# Get the current hash rate
hash_rate=$(sshpass -p "password" ssh -o StrictHostKeyChecking=no root@10.10.10.10 "cgminer-api | grep '\[GHS av\]' | cut -b 16-20")