Skip to content

Instantly share code, notes, and snippets.

View ivabus's full-sized avatar
🍺
Converting kvass into code

Ivan Bushchik ivabus

🍺
Converting kvass into code
View GitHub Profile
@ivabus
ivabus / Cargo.toml
Last active March 20, 2024 13:27
Generate cool images from music using FFT
[package]
name = "covergen"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
tiny-skia = "0.11.4"
realfft = "3.3.0"
@ivabus
ivabus / tgvideosticker.sh
Last active January 4, 2024 09:56
Create Telegram video sticker just using one command.
# Usage: ffmpeg_telegram_video_sticker: <video_in> <time <= 3> [<chromakey color in hex>] [<chromakey similarity>]
ffmpeg_telegram_video_sticker() {
PWD_START=$(pwd)
TMPDIR=/tmp/sticker-$(date +%Y-%m-%d-%H:%M:%S)
mkdir $TMPDIR
cp $1 $TMPDIR/
cd $TMPDIR
ffmpeg -i $1 $(if [[ ! -z $3 && ! -z $4 ]]; then echo -vf "chromakey=\#$3:$4:0"; fi) -c copy -c:v png -t $2 tmp.mov
ffmpeg -y -i tmp.mov -r 30 -t $2 -an -c:v libvpx-vp9 -pix_fmt yuva420p -vf 'scale=512:512:force_original_aspect_ratio=decrease' -b:v 350K ${1}_sticker.webm
cp ${1}_sticker.webm $PWD_START/
@ivabus
ivabus / make.conf
Created November 5, 2022 15:51
Gentoo Asahi Linux make.conf
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
CHOST="aarch64-unknown-linux-gnu"
ACCEPT_KEYWORDS="~arm64"
MAKEOPTS="-j8"
LLVM_TARGETS="AArch64"
@ivabus
ivabus / truth.py
Last active October 12, 2023 06:11
Print truth table for given expression
def iterate(l, ost):
if ost == 0: return l
newL = []
for i in l:
for k in "01": newL.append(i + k)
return iterate(newL, ost - 1)
func = input("Input function (in eval format): ")
variables = []
for i in func:
if i in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and not i in variables: variables.append(i)
@ivabus
ivabus / cargo.toml
Last active July 17, 2022 07:38
Ford circles done bad
[package]
name = "untitled"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bracket-color = "0.8.2"
[dependencies.sdl2]
@ivabus
ivabus / nmap.py
Last active July 3, 2023 09:14
nmap launcher on python
#!/usr/bin/env python3
# ---
# dependencies:
# python.org: '>=3.11.3'
# nmap.org: '*'
# ---
import os
import sys
myArgs = list(sys.argv)[0:]