Skip to content

Instantly share code, notes, and snippets.

View dmgolembiowski's full-sized avatar

David M. Golembiowski dmgolembiowski

View GitHub Profile
To From Method
string of code literal code std::stringify!{}
string of code syntax tree !quote(#syntax_tree).to_string()
string of code TokenStream .to_string()
string of syntax literal code format!("{:?}",parse2::<SynType>(quote! {...}).expect(...)
string of syntax syntax tree format!("{:?}"),…), format!("{:#?}"),…)
string of tokens literal code format!("{:?}",quote! {...})
string of tokens TokenStream format!("{:?}"),…), format!("{:#?}"),…)
syn::Error TokenStream .to_compile_error() [see Rule #7]
syntax tree literal code parse_quote!(…)
@dmgolembiowski
dmgolembiowski / build.rs
Created July 27, 2023 18:26 — forked from Ciantic/build.rs
Some in-memory stuff I threw away
use std::io::Write;
use std::{env, path::Path};
use std::{fs::OpenOptions, path::PathBuf};
use regex::Regex;
fn main() {
let dir = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("lib");
println!("cargo:rustc-link-search=native={}", dir.display());
@dmgolembiowski
dmgolembiowski / pi3_browser-only.md
Created June 17, 2023 00:00 — forked from bheisig/pi3_browser-only.md
Run Raspberry 3 in digital signage mode with Chromium Web browser on a TV screen
@dmgolembiowski
dmgolembiowski / camp.py
Created April 5, 2023 19:07 — forked from marskar/camp.py
CAMP stands for git commit --add --message && git push
import git
repo = git.Repo()
changed_file_lists = [
[file.a_path
for file in repo.index.diff(None).iter_change_type(change_type)]
for change_type in ('D', 'M')
]

Fedora

Setup a Separate Boot Device

device=/dev/sda
sudo wipefs --all $device
sudo dd if=/dev/zero of=$device bs=102400 count=2000
sudo parted $device --script mklabel gpt
sudo parted --script $device mkpart --align optimal efi fat32 4MiB 1GiB

Kubernetes hybrid cluster (Linux+Windows) on Hyper-V with local subnet and internet access

Prepare Host

Install CLI utils on your host machine

Kubectl

Helm

@dmgolembiowski
dmgolembiowski / post-install-arch-linux-setup.md
Created January 25, 2023 23:11 — forked from 0snap/post-install-arch-linux-setup.md
Post-Installation Cheat Sheet for Arch Linux

Post-Installation Cheat Sheet for Arch Linux

This guide uses yay as the preferred AUR helper of choice.

Troubleshoot initial 'I have no Internet problems'

In case you did a fresh install and are now missing packages, yet cannot connect to the internet, simply boot via live-iso and arch-chroot into your system.

$ cryptsetup luksOpen /dev/nvme0n1p2 cryptroot      # only relevant in case of encrypted partition

$ mount /dev/mapper/cryptroot /mnt

Getting a streamable link is done by the client.

You basically need to send the service a detailed list of the type of media you can play, and it will give you a transcode URL to call if it thinks you need transcoding in order to play this file.

If you don't and can play the file directly it won't give you a transcode URL.

POST <server_address>/Items/<item_id>/PlaybackInfo?UserId=<current_user_id>
@dmgolembiowski
dmgolembiowski / about.md
Created January 12, 2023 01:37 — forked from icedterminal/about.md
Jellyfin + NGINX