Helper tables for learning and interpreting morse code.
A ._
B _...
C _._.
D _..
E .
#define QUEUE_SIZE 16 | |
int main(int argc, char** argv) { | |
queue_t example = {0, 0, QUEUE_SIZE, malloc(sizeof(void*) * QUEUE_SIZE)}; | |
// Write until queue is full | |
for (int i=0; i<QUEUE_SIZE; i++) { | |
int res = queue_write(&example, (void*)(i+1)); | |
assert((i == QUEUE_SIZE - 1) ? res == -1: res == 0); | |
} |
#include "uart.h" | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <termios.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
#!/bin/bash | |
# https://gist.github.com/ryankurte/bc0d8cff6e73a6bb1950 | |
set -e | |
if [ "$#" -ne 3 ] && [ "$#" -ne 4 ]; then | |
echo "Usage: $0 CA NAME ORG" | |
echo "CA - name of fake CA" | |
echo "NAME - name of fake client" | |
echo "ORG - organisation for both" |
[[runners]] | |
name = "tt708-windows" | |
url = "https://gitlab.com/" | |
token = "[REDACTED]" | |
executor = "shell" | |
shell = "bash" | |
builds_dir="/c/gitlab-runner/builds/" | |
cache_dir="/c/gitlab-runner/cache/" | |
[runners.cache] | |
[runners.cache.s3] |
# place in /etc/systemd/system/whatever.service and install with `systemd install whatever.service` | |
# note that if you change this file you will need to run `systemctl daemon-reload` to get systemd to notice | |
[Unit] | |
Description=A good service description | |
# After networking because we need that | |
After=network.target | |
[Service] |
# Systemd environment file for backup.sh daily backup service | |
# Place in /etc/backup.env | |
# Destination for rsync file system clone | |
BACKUP_DEST=/media/large1/backups/raw | |
# Destination for restic repository | |
RESTIC_REPOSITORY=/media/large1/backups/restic | |
# Restic password file |
#!/bin/sh | |
if [ $TARGET == "x86_64-unknown-linux-gnu" ]; then | |
cargo build --target=$TARGET --release | |
elif [ $TARGET == "x86_64-apple-darwin" ]; then | |
cargo build --target=$TARGET --release | |
elif [ $TARGET == "armv7-unknown-linux-gnueabihf" ]; then | |
sh ./cross-linux-armhf.sh |
SUBSYSTEMS=="usb", ATTRS{modalias}=="usb:v12D1p1F01*", SYMLINK+="hwcdrom", RUN+="/usr/bin/sg_raw /dev/hwcdrom 11 06 20 00 00 00 00 00 01 00" |
#!/bin/bash | |
# Immutable Project-Local Toolchain Setup | |
# Inspired by Python's virtualenv and npm | |
# See http://wp.me/pZZvH-an for more | |
# Run with `source ./armenv.sh` | |
# TODOs: | |
# Add upgrade option | |
# Cleaner toolchain versioning | |
# Detect different toolchain versions and warn if installing new? |