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
import re | |
def nit_is_valid(nit): | |
if not nit: | |
return True | |
nit_regex = re.compile(r'^\d+(-?\d|k|K)?$') | |
if not nit_regex.match(nit): | |
return False |
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
## WordOps (https://wordops.net/) migration guide/script. | |
# - This is still in development. | |
# - most commands will work just as they are. | |
# - Keep in mind there are some manual instructions. | |
## Wordops setup in new server | |
# This is the easiest way to get all the dependencies going in the new host. | |
# 1. Install |
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
const axios = require('axios'); | |
let header = ''; | |
for (let block = 1685551; block < 1685704; block++) { | |
axios.post('http://127.0.0.1:18081/json_rpc', '{"jsonrpc":"2.0","id":"0","method":"get_block_header_by_height","params":{"height":' + parseInt(block) + '}}').then(resp => { | |
header = resp.data.result.block_header | |
console.log(header.height + ', ' + header.timestamp + ', ' + header.difficulty) | |
}) | |
} |
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 | |
/usr/bin/docker run -ti ubuntu | |
IFS=$'\n' | |
TODAY=$(/bin/date +"%Y-%m-%d") | |
/usr/bin/docker ps -a -f ancestor=ubuntu --format "{{.ID}} {{.CreatedAt}} {{.Status}}" | while read cont | |
do | |
IFS=' ' | |
array=($cont) |
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 | |
IFS=$'\n' | |
TODAY=$(/bin/date +"%Y-%m-%d") | |
#CONTAINERS=$(sudo docker ps -a -f ancestor=ubuntu --format "table {{.ID}} {{.CreatedAt}} {{.Status}}") | |
/usr/bin/docker ps -a -f ancestor=ubuntu --format "{{.ID}} {{.CreatedAt}} {{.Status}}" | while read cont | |
do | |
IFS=' ' | |
array=($cont) |
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/sh -e | |
if [ $# != 3 ] | |
then | |
echo "usage: $0 <src-port> <dst-host> <dst-port>" | |
exit 0 | |
fi | |
TMP=`mktemp -d` | |
BACK=$TMP/pipe.back |
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
/* | |
* Number of threads. You can configure them below. Cryptonight uses 2MB of memory, so the optimal setting | |
* here is the size of your L3 cache divided by 2. Intel mid-to-high end desktop processors have 2MB of L3 | |
* cache per physical core. Low end cpus can have 1.5 or 1 MB while Xeons can have 2, 2.5 or 3MB per core. | |
*/ | |
"cpu_thread_num" : 1, | |
/* | |
* Thread configuration for each thread. Make sure it matches the number above. | |
* low_power_mode - This mode will double the cache usage, and double the single thread performance. It will |
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
/* | |
* Number of threads. You can configure them below. Cryptonight uses 2MB of memory, so the optimal setting | |
* here is the size of your L3 cache divided by 2. Intel mid-to-high end desktop processors have 2MB of L3 | |
* cache per physical core. Low end cpus can have 1.5 or 1 MB while Xeons can have 2, 2.5 or 3MB per core. | |
*/ | |
"cpu_thread_num" : 2, | |
/* | |
* Thread configuration for each thread. Make sure it matches the number above. | |
* low_power_mode - This mode will double the cache usage, and double the single thread performance. It will |