Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
ZiTAL / .env
Last active May 15, 2024 07:07
php / laravel: ldap samaccountname
LDAP_DOMAIN="zital.lan"
LDAP_BASEDN="dc=zital,dc=lan"
LDAP_GROUPS='["Group01", "Group02"]'
LDAP_ATTRS='["*"]'
LDAP_HOSTS='["ldap01.zital.lan:389","ldap02.zital.lan:389","ldap02.zital.lan:389"]'
@ZiTAL
ZiTAL / ldap.sh
Created May 15, 2024 06:53
linux: ldap microsoft samaccountname example
#!/bin/bash
HOST="ldap.zital.eus"
BASEDN="dc=zital,dc=lan"
USER="zital@zital.eus"
PASSWD="12345"
ldapsearch -x -H ldap://${HOST} -b ${BASEDN} -D ${USER} -w ${PASSWD} "(samaccountname=${USER})"
@ZiTAL
ZiTAL / modules-rtmp.conf
Created May 11, 2024 18:58
nginx rtmp + ffmpeg
# /etc/nginx/modules-available/rtmp.conf
rtmp {
server {
listen 1935;
chunk_size 4096;
allow publish 127.0.0.1;
deny publish all;
application live {
@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 / 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 May 22, 2024 17:23
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 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 / 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):