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
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
enum { | |
ERR_MISSING_OCTETS = 1, | |
ERR_EXTRA_OCTETS, | |
ERR_INVALID_OCTET |
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
use std::{fmt, io, result}; | |
/// Result of a hexdump. | |
pub type Result<T> = result::Result<T, io::Error>; | |
/// Hexdump provides functionality to output a hexdump to a provided io::Write object. | |
/// The default Write is io::stdout(). | |
/// | |
/// Examples: | |
/// ```rust |
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
#!/bin/bash | |
## TLS Workshop Playground | |
## NOTICE: This script is intended for learning purposes only. | |
# These functions will set environmental variables in your terminal session, | |
# all beginning with "tls_". Use tls-reset to clean up all variables and remove | |
# generated temporary files (in the case of asym-gen). | |
# Print a help message | |
function tls-help { |
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
[package] | |
name = "tmp" | |
version = "0.1.0" | |
authors = ["Miccah Castorina <[email protected]>"] | |
edition = "2018" | |
[dependencies] | |
clap-v3 = { version = "3.0.0-beta.1", features = ["yaml"] } | |
rustyline = "6.2.0" | |
serde_yaml = "0.8" |
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
#!/bin/bash | |
# Usage: | |
# set_opts 'h,help v:,value: l,list' | |
# OPTS=$(get_opts "$@") | |
# if [[ $? -ne 0 ]]; then | |
# exit 1 | |
# fi | |
# eval set -- "$OPTS" | |
# while true; do |
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
#include "queue.h" | |
void queue_init(struct queue *q) { | |
q->start = 0; | |
q->end = 0; | |
} | |
uint8_t queue_enqueue(struct queue *q, void (*task)(void*), void *arg) { | |
if (queue_full(q)) | |
return 1; | |
q->tasks[q->end] = task; |