This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
# Monitor and conditionally reboot the rig miner. | |
# (Uses `coldreboot` instead of `mine restart`.) | |
# Tested on SMOS 1.2. | |
# Start configuration. | |
# 1. name your cards and their minimal Mh/s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
nvram set wan_hwaddr=`nvram get def_hwaddr` | |
ifconfig `nvram get wan_ifname` down | |
ifconfig `nvram get wan_ifname` hw ether `nvram get def_hwaddr` | |
ifconfig `nvram get wan_ifname` up | |
kill -USR2 $(pidof udhcpc) 2> /dev/null | |
killall udhcpc 2> /dev/null | |
/usr/sbin/udhcpc -i `nvram get wan_ifname` -p /var/run/udhcpc/pid -s /tmp/udhcpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sample usage (crontab): | |
# 55 11 * * * /home/monitor/bin/email_http_response_code.pl | |
my $email = 'YOUR EMAIL ADDRESS'; #example: root@google.com | |
my $website = 'YOUR WEBSITE URL'; #example: http://google.com | |
my $date_now = localtime; | |
my $result_http_code = `curl -sL -w '%{http_code} %{url_effective}' '$website' -o /dev/null`; | |
$result_http_code =~ s/(\S+)$/($1)/; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.++;$.+=$-,$-=$.-$-,print$.,$/for+1..64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import multiprocessing | |
import requests | |
Host = 'http://www.example.com' | |
Username = 'YOUR USERNAME' | |
Password = 'YOUR PASSWORD' | |
Urls = ('about', 'admin', 'newticket' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fibonacci(prev, next, stop) { | |
if (next >= stop) return prev; | |
try { | |
fibonacci.cache.push(prev); | |
} | |
catch (e) { | |
if (e.name === 'TypeError') { | |
fibonacci.cache = []; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use File::Basename; | |
list_direcrory(shift, 1); | |
sub list_direcrory { | |
my ($root, $c) = @_; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Check for arbitrage bet. | |
* | |
* @class Arbitrage | |
*/ | |
var Arbitrage = Arbitrage || {}; | |
var args = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Thst is not the optimal formula, don't use it. | |
* This is just another solution for the algorithm | |
* Tower of Hanoi. | |
*/ | |
if (Array.prototype.last === undefined) { | |
Array.prototype.last = function () { | |
return this.length ? this[this.length - 1] : 0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function quickSort(list) { | |
if (!list.length) return []; | |
var left = [], | |
right = [], | |
center = list[0]; | |
for (var i = 1; i < list.length; i++) { | |
if (list[i] < center) { | |
left.push(list[i]); |
OlderNewer