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
// Run with target-cpu="native" | |
// Commit history at https://git.plobos.xyz/Playground/1brc/src/branch/main/src/main/rust | |
use std::{ | |
fs::File, | |
io::BufReader, | |
thread, | |
}; | |
use std::collections::HashMap; | |
use std::fmt::Display; |
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 sh | |
# Run this on an air-gapped computer with an encrypted hard drive to set up GPG keys on your yubikey. | |
# Derived from https://github.com/drduh/YubiKey-Guide | |
# Assumes OS has already been prepared (packages, services, etc) -- see dr duh guide. | |
# Does not configure PINs on the yubikey. If no admin pin is provided, the default 12345678 is used. | |
# | |
# Usage: gpg_add_yubi.sh gpg-backup.tar.gz gpg_passhrase [yubikey_admin_pin] | |
######################################################################## | |
# Safety and portability |
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 | |
# customizable | |
LIST_DATA="#{window_name} #{pane_title} #{pane_current_path} #{pane_current_command}" | |
FZF_COMMAND="fzf-tmux -p --delimiter=: --with-nth 4 --color=hl:2" | |
# do not change | |
TARGET_SPEC="#{session_name}:#{window_id}:#{pane_id}:" | |
# select pane |
Set of scripts to deploy locally, vault and configure TLS server and user certificates for testing TLS AUTH.
credit to @reard3n (https://github.com/reard3n) and @v6 (https://github.com/v6) for the gist this grew from
This was tested using Vagrant and Ubuntu
- On the OS of your choice copy VaultCASetup.sh script locally and update any variables that would be specific to your environment and/or
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::str; | |
fn main() { | |
// -- FROM: vec of chars -- | |
let src1: Vec<char> = vec!['j','{','"','i','m','m','y','"','}']; | |
// to String | |
let string1: String = src1.iter().collect::<String>(); | |
// to str | |
let str1: &str = &src1.iter().collect::<String>(); | |
// to vec of byte |
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 | |
for d in /sys/kernel/iommu_groups/*/devices/*; do | |
n=${d#*/iommu_groups/*}; n=${n%%/*} | |
printf 'IOMMU Group %s ' "$n" | |
lspci -nns "${d##*/}" | |
done |
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
const net = require('net'); | |
const LISTENING_PORT = 443; | |
const HTTPS_PORT = 4443; | |
const SSH_PORT = 22; | |
var proxySwitch = function(connection) { | |
connection.once('data', function(buffer) { | |
// A TLS handshake record starts with byte 22. | |
if (buffer[0] === 22) { |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
NewerOlder