This file contains hidden or 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 | |
# lockscreen-mining.sh script to start your miner or whatever while the screen is locked | |
XMRIG_BINARY=xmrig | |
XMRIG_CONFIG=/home/jsantos/opt/xmrig.json | |
start_miner () { | |
if pgrep -x $XMRIG_BINARY > /dev/null | |
then |
This file contains hidden or 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
# Small guide to create a LUKS disk on top of a bcache device using an SSD and HDD | |
# Setup | |
# /dev/sda cache device (SSD) | |
# /dev/sdb backing device (HDD) | |
# Create the bcache | |
# --block should match the sector size of the backing device | |
# --bucket should match the cache size of the cache device | |
# You can ommit these two arguments and just use the default values |
This file contains hidden or 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 | |
KEYID=<KEY ID FOR YOUR NEW ENCRYPTING KEY> | |
cd ~/.password-store | |
for f in $(find . -name '*.gpg'); do | |
oldpass=$(gpg -d $f) | |
echo $oldpass | gpg -r $KEYID -e > $f | |
chmod 600 $f |
This file contains hidden or 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 | |
start_time="$(date -u +%s.%N)" | |
while true | |
do | |
elapsed_time="$(date -u +%s.%N)" | |
echo "battery:$(cat /sys/class/power_supply/BAT1/capacity) seconds:$(bc <<<"($elapsed_time - $start_time)/60") uptime:$(uptime)" | |
echo "battery:$(cat /sys/class/power_supply/BAT1/capacity) seconds:$(bc <<<"($elapsed_time - $start_time)/60") uptime:$(uptime)" > uptime.txt | |
sleep 30 |
This file contains hidden or 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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream websocket { | |
server cockpithost:9090; | |
} | |
server { |
This file contains hidden or 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
package cgd | |
import ( | |
"errors" | |
"os" | |
"strconv" | |
"strings" | |
"sync" | |
"time" |