ssd_show_data() {
local location="${1:-0}" # In bytes
sudo dd if=/dev/nvme0n1 bs=1 count=9000 skip="${location}" status=none | hd
}
# ssd_write_data <data_message> [location]
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
| // isValidHex indicates if value is a proper hex strings that can be contained | |
| // with the given number of bits | |
| func isValidHex(value string, bits int) bool { | |
| str := strings.ToLower(value) | |
| precZeros := true | |
| bitcount := 0 | |
| for _, c := range str { | |
| // Ensure the rune is a HEX character | |
| if !strings.Contains("0123456789abcdef", string(c)) { | |
| return false |
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
| import CRAND "crypto/rand" | |
| // GenMQTTClientID generates a random client id for mqtt | |
| func GenMQTTClientID(prefix string) (string, error) { | |
| r, err := CRAND.Int(CRAND.Reader, new(big.Int).SetInt64(100000)) | |
| if err != nil { | |
| return "", fmt.Errorf("Failed to generate MQTT client ID: %v", err) | |
| } | |
| return prefix + r.String(), nil | |
| } |
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
| /* | |
| * sample_noise.c | |
| * | |
| * Created on: Sep 10, 2018 | |
| * Author: Craig Hesling | |
| */ | |
| #include <xdc/runtime/System.h> | |
| #include <ti/sysbios/BIOS.h> // BIOS_WAIT_FOREVER | |
| #include <ti/sysbios/knl/Event.h> |
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
| # This is an example ddclient configuration that uses fetch-nest-wan-ipv4.sh | |
| # and Cloudflare. | |
| # The fetch-nest-wan-ipv4.sh script must be in whatever working directory ddclient | |
| # is run from, or change the below path to the command to be absolute. | |
| ###################################################################### | |
| ## | |
| ## Define default global variables with lines like: | |
| ## var=value [, var=value]* | |
| ## These values will be used for each following host unless overridden |
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
| #include <atomic> | |
| #include <chrono> | |
| #include <iostream> | |
| #include <semaphore> | |
| #include <thread> | |
| /* | |
| * g++ -std=c++20 context-switch-vs-spin-wait.cc && ./a.out | |
| */ |
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 | |
| # Craig Hesling | |
| # | |
| # Find a change in Git's vast dangling blob/commmit archive. | |
| # | |
| # Usage: find-change.bash <grep-pattern1> [<grep-patter2> [grep-patterns...]] | |
| mapfile -t LOST < <(git fsck --lost-found) | |
| PATTERNS=( "$@" ) |
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
| FROM debian:latest | |
| ENV USER me | |
| RUN useradd --create-home --user-group "${USER}" | |
| # HOME will be set already within the container, after setting user, but we | |
| # set it here to be usable from within this Dockerfile. | |
| ENV HOME "/home/${USER}" | |
| WORKDIR "${HOME}" | |
| RUN pwd |
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
| # This is an example ddclient configuration that uses fetch-nest-wan-ipv4.sh | |
| # and Cloudflare. | |
| # The fetch-nest-wan-ipv4.sh script must be in whatever working directory ddclient | |
| # is run from, or change the below path to the command to be absolute. | |
| ###################################################################### | |
| ## | |
| ## Define default global variables with lines like: | |
| ## var=value [, var=value]* | |
| ## These values will be used for each following host unless overridden |
OlderNewer