Helpful info for working with ISO images and USB formatting/partitioning.
automout home and source profile when SSH login:
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 bash | |
LOG_PATH="/home/$(whoami)/log/speedtest.log" | |
if result=$(/usr/bin/speedtest --simple); then | |
parsed_result=$(printf "${result}\"" | sed ':a;N;$!ba;s/\n/" /g' | sed 's/: /="/g') | |
printf "[$(date)] ${parsed_result}\n" >> "${LOG_PATH}" | |
else | |
printf "[$(date)] error\n" >> "${LOG_PATH}" | |
exit 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
#!/usr/bin/env python | |
import fileinput | |
import datetime | |
input_lines = [] | |
for line in fileinput.input(): | |
input_lines.append(line) | |
ping_key,ping_val,ping_unit = input_lines[0].split(" ") | |
download_key,download_val,download_unit = input_lines[1].split(" ") |
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 bash | |
DATE_TAG="$(date -u +"%Y")-$(date -u +"%m")" | |
CSV_PATH="/home/$(whoami)/log/speedtest.$(hostname).${DATE_TAG}.csv" | |
LOG_PATH="/home/$(whoami)/log/speedtest.$(hostname).${DATE_TAG}.csv.log" | |
# ensure the path exists | |
mkdir -p $(dirname "${CSV_PATH}") | |
# add the header row if the file does not exist |
Some notes on how to install and configure lxc/lxd containers.
Read the 'getting started' docs first:
Lots of good examples:
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 python3 | |
import os | |
import subprocess | |
cwd = os.getcwd() | |
file_list = [f for f in os.listdir(cwd) if f.endswith('.sublime-project')] | |
fl_len = len(file_list) | |
if fl_len == 0: | |
print("sublime-project file not found") |