Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
ZiTAL / db.py
Last active May 3, 2024 16:55
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 / porru.js
Last active May 3, 2024 07:14
openttd: automatic translate
/*
install:
npm install prompt-sync --save-dev
npm install testcafe --save-dev
create:
env.json with github credentials: {user: user, passwd: passwd}
exec:
npx testcafe firefox:headless porru.js
@ZiTAL
ZiTAL / parse.py
Last active May 1, 2024 19:01
Mediawiki: How to parse all pages from the Main page and convert it to a pdf
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import requests
import re
class api:
url = 'https://wiki.zital.eus/api.php'
# sep egindakoak ezberdintzeko erabiliko dugu, bestela bukleetan behin eta berriz sartuko da
@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 / 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