Skip to content

Instantly share code, notes, and snippets.

View TheBestTvarynka's full-sized avatar
๐Ÿฆ€
I'm currently rewriting all in Rust

Pavlo Myroniuk TheBestTvarynka

๐Ÿฆ€
I'm currently rewriting all in Rust
View GitHub Profile
@TheBestTvarynka
TheBestTvarynka / logging.rs
Created May 9, 2025 09:56
tracing_stdout_logger
fn init_logger() {
use std::io;
use tracing_subscriber::prelude::*;
use tracing_subscriber::EnvFilter;
let logging_filter: EnvFilter = EnvFilter::builder()
.with_default_directive("trace".parse().unwrap())
.from_env_lossy();
@TheBestTvarynka
TheBestTvarynka / cmds_notes.sh
Last active November 19, 2024 17:07
cmds_notes.sh
readelf -Ws --dyn-syms /usr/lib/pkcs11-spy.so
nm -D /usr/local/lib/libykcs11.so
objdump -T /usr/local/lib/libykcs11.so
readelf -d /usr/local/lib/libykcs11.so
chmod 400 ~/.ssh/id_rsa
# set up dns ubuntu: https://askubuntu.com/a/1407182
sudo mkdir /etc/systemd/resolved.conf.d/
sudo nano /etc/systemd/resolved.conf.d/dns_servers.conf
@TheBestTvarynka
TheBestTvarynka / windows_notes.txt
Created February 21, 2024 10:06
windows_notes.txt
# https://serverfault.com/a/708970
w32tm /config /manualpeerlist:"ntp_server" /syncfromflags:manual /reliable:yes /update
use std::str::FromStr;
#[derive(Debug)]
pub struct TokenInfo {
pub a: String,
pub b: String
}
impl FromStr for TokenInfo {
type Err = std::io::Error;
@TheBestTvarynka
TheBestTvarynka / wireshark_notes.sh
Last active January 8, 2023 16:30
wireshark_notes
# filder by the IP address
ip.addr == 10.10.10.77
# filter by the IP address and protocol
ip.addr == 10.10.10.77 and tls
# Show only traffic in the LAN (192.168.x.x), between workstations and servers โ€“ no Internet:
ip.src==192.168.0.0/16 and ip.dst==192.168.0.0/16
@TheBestTvarynka
TheBestTvarynka / Cargo.toml
Last active February 29, 2024 19:09
aes256 cbc example
[package]
name = "aes-cbc-example"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
aes = "0.8.2"
cbc = "0.1.2"
@TheBestTvarynka
TheBestTvarynka / git_notes.sh
Last active October 14, 2025 10:34
git-notes
# reset commit author saving commit date
git commit --amend --reset-author --no-edit --date="$(git log -n 1 --format=%aD)"
# last commit with date
git log --pretty=format:"%h%x09%an%x09%ad%x09%s" | head -n 1
# one commit changes
git show ff10697de4f
# last commit to unstaged
@TheBestTvarynka
TheBestTvarynka / openssl_notes.sh
Last active June 18, 2025 13:06
openssl notes
# make pfx (without a CA)
openssl pkcs12 -export -out hand.pfx -inkey rsa.plain.key -in certificate.cer
# remove RSA key password
openssl rsa -in 03b8620d-12ff-48ee-b036-e1cf4c598609.key -out 03b8620d-12ff-48ee-b036-e1cf4c598609.plain.key
# generate RDP certificate
# more info: https://docs.microsoft.com/en-us/answers/questions/376880/rdp-replaces-the-custom-certificate-for-encryption.html
openssl req -x509 -nodes -newkey rsa:2048 -keyout key.pem -out server.pem -days 7300 -subj /CN=dest -addext "extendedKeyUsage = serverAuth"
pub struct Money(pub PgMoney);
impl<'de> de::Deserialize<'de> for Money {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: de::Deserializer<'de>,
{
struct Visitor;
impl<'de> de::Visitor<'de> for Visitor {
@TheBestTvarynka
TheBestTvarynka / github_emoji.md
Last active December 6, 2020 18:06 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue: