Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am oza6ut0ne on github.
  • I am oza6ut0ne (https://keybase.io/oza6ut0ne) on keybase.
  • I have a public key whose fingerprint is DDFC 084B C69C FAE7 B03C 1265 2D1D C89B 9CB7 8E25

To claim this, I am signing this object:

@oza6ut0ne
oza6ut0ne / wol.py
Last active September 28, 2022 14:34
#!/usr/bin/env python3
import argparse
import binascii
import ipaddress
import platform
import socket
import struct
import sys
from logging import getLogger, INFO, NullHandler, StreamHandler
import argparse
import socket
import sys
import time
from datetime import datetime
import emoji
import pytchat
use std::{io::{self, prelude::*}, mem, fs};
use std::any::Any;
fn dump(v: &dyn Any) -> Result<(), io::Error> {
let mut f = fs::OpenOptions::new()
.read(true)
.open("/proc/self/mem")?;
f.seek(io::SeekFrom::Start(&v as *const _ as u64))?;
let mut buffer: Vec<u8> = (0..mem::size_of_val(v)).map(|_| 0).collect();
@oza6ut0ne
oza6ut0ne / remove-gpg-user.sh
Created September 5, 2021 17:07
Git-crypt remove user.
#!/usr/bin/env bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
Import-Module PSReadLine
Import-Module posh-git
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/agnosterplus.omp.json" | Invoke-Expression
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadlineKeyHandler -Key Ctrl+d -Function DeleteCharOrExit
set-PSReadLineKeyHandler -Key Tab -Function MenuComplete
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oza6ut0ne
oza6ut0ne / cast.py
Last active February 3, 2021 13:52
#!/usr/bin/env -S python3 -u
import http.client
import socket
import threading
import time
from http.server import HTTPServer, SimpleHTTPRequestHandler
from itertools import chain, cycle
from pathlib import Path
@oza6ut0ne
oza6ut0ne / Dockerfile
Last active August 8, 2020 00:46
Dockerfiles for Python3 OpenCV
#syntax=docker/dockerfile:experimental
FROM python:3.8.5 as opencv
CMD ipython
WORKDIR /workspace
ENV PYTHONIOENCODING "utf-8"
ARG MAKEFLAGS=""
RUN apt update && \
apt -y install --no-install-recommends \
#!/bin/bash
curl -s https://registry.hub.docker.com/v1/repositories/{$1}/tags | sed "s/,/\n/g" | grep name | cut -d '"' -f 4