-
Notifications
You must be signed in to change notification settings - Fork 1
/
reference
32 lines (27 loc) · 3.26 KB
/
reference
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
mkfs.ext4 -v -T largefile4 -m 0 $partition
mkfs.xfs $partition
journalctl -fu rsync.service
find /farm/sites/ -mtime -1 -name '*.plot' -ls 2> /dev/null | wc -l
chia show -c | awk '
/Connections|Type|FARMER|WALLET/ { print }
/SB Height/ {ph[$3] += 1}
END {
msg="Peer heights:\n"
for (h in ph) {
msg = msg h ":" ph[h] "\n"
}
print msg
}
' | sort
for n in (chia show -c | grep -B 1 255206 | sed 's/.*\([0-9a-f]\{8\}\)\.\.\..*/\1/' | grep -v -e '--'| sort --unique); chia show --remove-connection $n; end
mdadm --create --verbose /dev/md0 --chunk=1024K --level=0 --raid-devices=2 /dev/nvme[0-1]n1
for d in (df | grep ' /farm/sites/' | sed -E 's;^/dev/([a-z]+).*;\1;'); echo 'bfq' | sudo tee /sys/block/$d/queue/scheduler; end
for x in (python -c 'to_remove = [50, 20]; import pathlib; site_root = pathlib.Path("/farm/sites"); subpath = pathlib.Path("original"); directories = sorted(site_root.glob(str(pathlib.Path("*", subpath)))); all_plots = [list(directory.glob("*.plot")) for directory in directories]; all_plots = [plots for plots in all_plots if len(plots) > 0]; selected_plots = [plot for count, some_plots in zip(to_remove, all_plots) for plot in some_plots[:count]]; print("\n".join(str(plot) for plot in selected_plots))'); echo $x; end
ls -1 | tr _ : | sed 's/\.p.*//' | tail -n 20 | /farm/plotman/venv/bin/python -c 'import sys; import pendulum; import toolz; lines = [line.strip() for line in sys.stdin.readlines()]; dates = [pendulum.parse(line) for line in lines]; deltas = [new - old for old, new in toolz.sliding_window(2, dates)]; print("\n".join(f"{delta.in_minutes()} {24 * 60 * 60 / delta.in_seconds():.1f}" for delta in deltas))'
# for disk in (ls /dev/sd* | grep -vE '[0-9]$' |sort); echo --- $disk (df --output=target $disk | sed 1d); sudo smartctl --xall $disk | grep -E '(Start_Stop_Count|Power-Off_Retract_Count)'; end
for pair in (df --output=target,source | sed 1d | grep /farm/sites | sort); set mount (echo $pair | awk '{print $1}'); set partition (echo $pair | awk '{print $2}'); set disk (echo $partition | sed 's/[0-9]\+//'); set date (date --iso-8601=n); echo --- $mount $disk $partition $date; sudo smartctl --xall $disk | grep -E '(Start_Stop_Count|Power-Off_Retract_Count)'; end
# while true; for disk in (ls /dev/sd* | grep -vE '[0-9]$' |sort); set mount (df --output=target $disk | sed 1d); echo --- $disk $mount; end
# while true; for pair in (df --output=target,source | sed 1d | grep /farm/sites | sort); set mount (echo $pair | awk '{print $1}'); set disk (echo $pair | awk '{print $2}'); set date (date --iso-8601=n); echo --- $mount $disk $date; echo $date > $mount/stay_awake; end; sleep (math '5*60'); end
while true; for pair in (df --output=target,source | sed 1d | grep /farm/sites | sort); set mount (echo $pair | awk '{print $1}'); set disk (echo $pair | awk '{print $2}'); set date (date --iso-8601=n); echo --- $mount $disk $date; head --bytes 500 (ls $mount/**/*.plot | shuf --head-count 1) > /dev/null; end; echo; sleep (math '5*60'); end
bash -c 'echo; echo; echo \# --- $(date --iso-8601=s) >> /etc/fstab && cat fstab >> /etc/fstab'
for d in $(df -h | grep -E '/farm/(sites|back40)' | sed 's/.*% //' | sort); do echo "$d " p-$(ls $d/pool.xch* | wc -l) o-$(ls $d/original | wc -l); done