Skip to content

Instantly share code, notes, and snippets.

View zeddee's full-sized avatar

Zed zeddee

View GitHub Profile
@zeddee
zeddee / print_bits.c
Created November 8, 2025 12:11
rudimentary bit printer
#ifndef PRINT_BITS_C
#define PRINT_BITS_C
#include <stdio.h>
#include <limits.h>
extern void print_bits(unsigned bits)
{
int WIDTH = sizeof(bits) * CHAR_BIT;
char bit_repr[WIDTH];
dnf install -y epel-release
dnf install -y zsh git unzip tcpdump neovim tmux jq fzf ripgrep
lchsh root <<<echo "/bin/zsh"
mkdir -p "${HOME}/.config/nvim/"
## https://builtin.com/software-engineering-perspectives/neovim-configuration
cat<<"EOF">"${HOME}/.config/nvim/init.vim"
set nocompatible " disable compatibility to old-time vi
@zeddee
zeddee / bash_strict_mode.md
Created March 1, 2025 15:26 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+Zcn4rCDcMcpwLNlETVEszgmbgnDETUSJ9N7Qc0MmK zeddee@hayabusa
data.x_nvd.cpeMatches.vendor: "canonical" AND
(
data.x_nvd.cpeMatches.version_criteria_match: /20\.[0-9]{2}/ OR (
(data.x_nvd.cpeMatches.version_start_including: /20\.[0-9]{2}/ OR data.x_nvd.cpeMatches.version_start_excluding: /20\.[0-9]{2}/) AND
(data.x_nvd.cpeMatches.version_end_including: /20\.[0-9]{2}/ OR data.x_nvd.cpeMatches.version_end_excluding: /20\.[0-9]{2}/)
)
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""Run with pytest
"""
import csv
from typing import List, Iterable
from io import StringIO
from copy import copy
TEST_DATA_WITH_SPACES = StringIO("""# "first_seen_utc","sha256_hash","md5_hash","sha1_hash","reporter","file_name","file_type_guess","mime_type","signature","clamav","vtpercent","imphash","ssdeep","tlsh"
"2023-08-21 22:53:38", "fd834695fc878b5ed5178dad8,6cf30130adf4a7ac88d5997f8eb7814ca41f211", "db896ff1c3a206de4da48748f0a4731d", "28e85fe7ff3e99fd2c629db98690ecf72194ba7c", "SquiblydooBlog", "installer-package.exe.zip", "zip", "application/zip", "n/a", "n/a", "n/a", "n/a", "24576:2KyTK3lpgjVaC5CAfmXAYpDRvGGOtL0DBlkyYXPGEIwP:WCPeVa4/fkAqD9U8BKJ+EI8", "T139F5EEE784C42CC293FF041525A3EF6032BE2584A138D24F7C591CDB688DD95AA5FBB9"
@zeddee
zeddee / rust-bitwise-example.rs
Last active August 12, 2023 14:28
Rust bitwise operations example
// Following: https://dev.to/somedood/bitmasks-a-very-esoteric-and-impractical-way-of-managing-booleans-1hlf
fn repr(label: &str, num: i8) {
/* Convenience function that prints `num`, which must be an i8,
as its 8-bit representation, and as an integer.
We use `{:#010b}` because when printing with `{:#}`, the number
of padded values on the left includes the initial `0b`.
E.g. `repr("Anything", 1)` prints this output:
use rand::Rng;
use std::collections::HashMap;
use std::ops::Range;
use std::sync::mpsc;
use std::thread;
use std::time::Duration;
fn sleep(range: Range<usize>) {
thread::sleep(Duration::from_millis(
rand::thread_rng().gen_range(range) as u64
"""Copyright 2023 zed@shootbird.work
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,