Skip to content

Instantly share code, notes, and snippets.

@oskar456
oskar456 / videocuttter.sh
Created July 2, 2020 18:29
Cut a video out of a long recording with fade in and out and volume normalization
#!/bin/bash
INFILE="input_video.mp4"
FPS=30
get_seconds() {
local seconds=0
IFS=":" read -ra T <<< "$1"
for x in "${T[@]}"; do
seconds=$(echo "$seconds * 60 + $x" | bc)
@oskar456
oskar456 / happykaktus.py
Created February 24, 2020 15:09
Scrap mujkaktus.cz and send news to a Telegram channel
#!/usr/bin/env python3
import lxml.html
import urllib.request
from pathlib import Path
import requests
telegram_bot_token = "FIXME"
telegram_group_name = "@kvetinac"
@oskar456
oskar456 / wgcf.py
Last active February 17, 2024 12:47
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
@oskar456
oskar456 / walk_sk_nsec3_ds.py
Created May 8, 2019 00:08
Walk NSEC3 chain of .SK TLD in order to discover zones with secure delegation
#!/usr/bin/env python3
from hashlib import sha1
from base64 import b32encode
import csv
from collections import OrderedDict
from itertools import zip_longest
import dns.name
from dns.rdtypes.ANY.NSEC3 import b32_normal_to_hex
@oskar456
oskar456 / grabivysilani.py
Created March 10, 2019 21:03
Grab TV series from iVysilani with CC and AD
#!/usr/bin/env python3
import subprocess
import youtube_dl
import click
from pprint import pprint
@click.command()
@oskar456
oskar456 / rpsl_to_fred.py
Created October 29, 2018 11:56
Convert RIPE DB domain dump into Fred-akm data file
#!/usr/bin/env python3
import gzip
import hashlib
import sys
from collections import defaultdict
def read_db_dump(fname="ripe.db.domain.gz"):
obj = None
@oskar456
oskar456 / cert_deploy_check.py
Created September 19, 2018 15:15
Get hostname list from CT logs, via certspotter, check if hostnames offer valid certificate path.
#!/usr/bin/env python3
import ssl
import socket
from pathlib import Path
def get_cert_hostnames():
path = Path("~/.certspotter/certs/").expanduser()
@oskar456
oskar456 / screencast.sh
Last active August 3, 2018 08:38
FFmpeg record my desktop
#!/bin/sh
SCREEN_SIZE="1920x1080"
ORIGIN="0,0"
# For dual screen setup where projected is on the right side of the desktop:
#ORIGIN="1920,0"
ffmpeg -vaapi_device /dev/dri/renderD128 -framerate 25 -video_size $SCREEN_SIZE \
-f x11grab -i :0+$ORIGIN -f pulse -ac 2 -i default -vf 'format=nv12,hwupload' \
-c:v h264_vaapi -c:a aac screencast-$(date +%H%M%S).mkv
@oskar456
oskar456 / ledclock.py
Created May 1, 2018 09:28
PyGTK Cairo LED studio clock
#! /usr/bin/env python2
import pygtk
pygtk.require('2.0')
import gtk
import glib
import cairo
import math
import datetime
# Create a GTK+ widget on which we will draw using Cairo
@oskar456
oskar456 / ctlogspotter.py
Created April 13, 2018 08:55
Preprocess Certificate Transparency log list for Cert Spotter
#!/usr/bin/env python3
import requests
import json
log_list = "https://www.gstatic.com/ct/log_list/log_list.json"
logs = requests.get(log_list).json()
outlogs = []
for log in logs["logs"]: