Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
ZiTAL / config.fish
Created April 22, 2024 08:25
fish: use full path in terminal
# .config/fish/config.fish
if status is-interactive
# Commands to run in interactive sessions can go here
set -g fish_prompt_pwd_dir_length 0
end
@ZiTAL
ZiTAL / 001.sh
Last active April 19, 2024 07:38
ffmpeg examples
#/bin/bash
# resize and crop
# ffmpeg: 1440x1072 -> 1452x1080 -> 1440x1080 rockchip h264_rkmpp
ffmpeg-rockchip -i input.mp4 -b:v 2472k -vcodec h264_rkmpp -s 1452x1080 -r 30 -g 60 -b:a 160k -ar 44100 -threads 4 tmp.mp4
ffmpeg-rockchip -i tmp.mp4 -b:v 2472k -vcodec h264_rkmpp -s 1440x1080 -r 30 -g 60 -filter:v \"crop=1440:1080:6:0\" -aspect 4:3 -acodec copy -threads 4 output.mp4
@ZiTAL
ZiTAL / db.py
Last active April 16, 2024 16:18
Dragoi Bola: Twitch plataforman 24/7 martxan!
import os
import sys
import subprocess
import re
import tempfile
from datetime import timedelta
from collections import OrderedDict
sys.path.append('../../')
from src.TwitchFfmpeg import TwitchFfmpeg, TwitchConfig
@ZiTAL
ZiTAL / iptables.sh
Last active February 23, 2024 12:11
debian gnu/linux: redirect ports to work locally
#!/bin/bash
# reset iptables rules
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
@ZiTAL
ZiTAL / didomi.js
Created January 31, 2024 15:04
js violentmonkey: remove didomi cookies remover
// ==UserScript==
// @name Remove Didomi
// @namespace Violentmonkey Scripts
// @author zital
// @match *://*/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function()
@ZiTAL
ZiTAL / BlackMagicVideohub.py
Last active January 26, 2024 11:00
python: Black Magic Videohub route out in
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# based on: https://github.com/harmanhobbit/smarthubctl/blob/main/smarthubctl.py
import socket
class BlackMagicVideohub:
def __init__(self, config):
@ZiTAL
ZiTAL / mosquitto.md
Created January 15, 2024 09:45
podman: Create a mosquitto server and connect from container's python script

MOSQUITTO SERVER

  1. install mosquitto
apt-get install mosquitto mosquitto-clients
  1. add config to create server
echo "allow_anonymous true"  >  /etc/mosquitto/conf.d/nework.conf
@ZiTAL
ZiTAL / pdm-n.md
Last active January 12, 2024 11:12
podman: create a pod with a node simple application through nginx web server

dependencies

su
apt-get install podman golang-github-containernetworking-plugin-dnsname
cd /usr/lib/podman
wget https://github.com/containers/gvisor-tap-vsock/releases/download/v0.7.1/gvproxy-linux-amd64
mv gvproxy-linux-amd64 gvproxy
chmod +x gvproxy
exit
@ZiTAL
ZiTAL / podman.md
Last active January 12, 2024 08:14
podman: zerotik heroiera

podman

  1. add container sources to download from
echo "unqualified-search-registries = ['docker.io', 'ghrc.io', 'quay.io']" > .config/containers/registries.conf
  1. search container
podman search busybox
@ZiTAL
ZiTAL / elhuyar.py
Last active January 11, 2024 07:55
python: elhuyar-i hitzak itzultzeko eskatzeko script-a
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import requests
import re
from lxml import html
def printError(search):
print("Errorea gertatu da, ziur aski sartu duzun hitza ez da hiztegian agertzen")