Dumping ground for freestanding scripts I make.
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 | |
set -euo pipefail | |
op item get 'GPG' --fields GPG.publickey | rg '(-----BEGIN.*?-----)(.*?)(-----END.*?-----)' --replace='${1} | |
${2} | |
${3}' | fold -w 65 > public.pem | |
op item get 'GPG' --fields GPG.secretsubkeys | rg '(-----BEGIN.*?-----)(.*?)(-----END.*?-----)' --replace='${1} |
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 { App, Chart, YamlOutputType } from "cdk8s"; | |
import { Construct } from "constructs"; | |
import * as k8s from "./imports/k8s"; | |
/** | |
* Utility type to extract the `*Props` type from the constructor of a {@link Construct}. | |
*/ | |
type ConstructProps<T extends abstract new (...args: any) => any> = | |
ConstructorParameters<T> extends [ | |
scope: Construct, |
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
#!/usr/bin/env bash | |
set -euo pipefail -x | |
for input in *.mkv; do | |
# map to sonarr-managed files | |
n="$(echo "$input" | awk '{print $6}')" | |
target="$(ls '/data/media/tv/Rurouni Kenshin (2023)/Season 01/'*"S01E$n"*'.mkv')" | |
ass_en="${target%.*}.en.ass" |
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
#!/usr/bin/env sh | |
set -e | |
# Omitting logic to deal with Git since this is just an example | |
if [ -z "${SSH_ORIGINAL_COMMAND}" ]; then | |
echo "Hi ${USER}! You've successfully authenticated, but GitHub does not provide shell access." | |
exit 1 | |
else |
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
use async_ssh2_lite::ssh2::Session; | |
use async_ssh2_lite::AsyncSession; | |
use criterion::Criterion; | |
use criterion::{criterion_group, criterion_main}; | |
use std::io::prelude::*; | |
use tokio::io::AsyncReadExt; | |
async fn ssh2_spawn_blocking() { | |
tokio::task::spawn_blocking(|| { | |
let tcp = std::net::TcpStream::connect("127.0.0.1:2222").unwrap(); |
We can't make this file beautiful and searchable because it's too large.
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
RegionName,ParkName,ParkType,Year,TRV | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1904, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1905, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1906, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1907, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1908, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1909, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1910, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1911, | |
Alaska Region,Alagnak Wild River,National Wild & Scenic River,1912, |
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
{ bzip2 | |
, dpkg | |
, fetchFromGitHub | |
, lib | |
, libnghttp2 | |
, libssh2 | |
, lz4 | |
, openssl | |
, pkg-config | |
, python3 |
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
#![feature(test)] | |
extern crate test; | |
fn main() {} | |
#[cfg(test)] | |
mod tests { | |
use rayon::prelude::*; | |
use std::sync::atomic::{AtomicI32, Ordering}; |
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 continuumio/anaconda3 | |
RUN pip install duckdb investpy | |
WORKDIR /workdir | |
RUN useradd --create-home user && \ | |
chown user:user /workdir | |
USER user | |
CMD ["jupyter-lab", "--no-browser", "--ip=0.0.0.0", "--ServerApp.token="] |
NewerOlder