Skip to content

Instantly share code, notes, and snippets.

@siddolo
siddolo / BorgBackup.md
Created January 2, 2024 15:00
OVH to Borg Backup

Backup

OS: Ubuntu 22.04 LTS

Setup

apt update && apt upgrade
apt install python3 python3-pip borgbackup htop net-tools mariadb-client
pip install --upgrade borgmatic
@siddolo
siddolo / curl.sh
Last active December 14, 2023 16:40
Unauthenticated get app list from LG WebOS store
curl -s 'https://it.lgappstv.com/api/tvapp/retrieveMoreAppList.ajax' \
-H 'Origin: https://it.lgappstv.com' \
--data-raw 'catCode1=&moreYn=Y&orderType=0&appRankCode=&prodCode=P000000029&plfmCode=W22A&curPage=1&rowCount=1812&pageCount=10&totalCount=1812' \
| jq | less
@siddolo
siddolo / Makefile
Created April 20, 2023 23:18
Build & deploy AWS lambda Makefile
FUNCTION_NAME = lambda-name
FUNCTION_ENVIRONMENT = python3.9
AWS_PROFILE = awscli-credential-profile
PWD = $(abspath $(CURDIR))
RELEASE_DST_PATH = $(addprefix $(PWD), /release)
ZIP_EXTRA_IGNORE_PATH_ARGS = -x '.env' \
-x '.gitignore' -x '*/.gitignore' \
-x '.git/**' -x '.git/' \
-x 'release/**' -x 'release/' \
@siddolo
siddolo / ffmpeg-fb-stream-local-obs-recording.sh
Created December 3, 2022 10:58
Useful for concurrent streaming to two destination (for example YouTube + Facebook) with OBS Studio
#!/usr/bin/env bash
# Set OBS to stream on YouTube and local recording as mkv
# Use this script to stream recording on Facebook
ffmpeg -re -i ./recording.mkv \
-acodec aac -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 1280x720 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace \
-vcodec libx264 -preset veryfast -g 30 -r 30 -f flv "rtmps://live-api-s.facebook.com:443/rtmp/[APIKEY]"
@siddolo
siddolo / BeanstalkToCloudWatch-IAMPolicy.json
Created June 8, 2022 14:21
Minimum permission policy for a Beanstalk IAM Role
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"logs:DescribeLogGroups"
],
"Resource": "*"
},
@siddolo
siddolo / unpack-unitywebdata1.0.py
Last active October 8, 2024 10:35
Unpack UnityWebData1.0 used in Unity WebGL games
#!/usr/bin/env python3
# Ref: https://github.com/HearthSim/UnityPack/issues/74
import sys
import os
from unitypack.utils import BinaryReader
SIGNATURE = 'UnityWebData1.0'
class DataFile:
// empty spotify liked songs
const elements = document.querySelectorAll('button[aria-label="Elimina da La tua libreria"]');
Array.from(elements).forEach((element, index) => {
element.click()
});
@siddolo
siddolo / MATRIX.md
Last active September 10, 2021 16:43
@siddolo
siddolo / matrix.js
Created September 10, 2021 16:13
Enter the matrix (thechoiceisyours.whatisthematrix.com reverse engineering)
function stringToBytes(t) {
for (var e = [], i = 0; i < t.length; i++) e.push(255 & t.charCodeAt(i));
return e;
}
function bytesToString(t) {
for (var e = [], i = 0; i < t.length; i++) e.push(String.fromCharCode(t[i]));
return e.join('');
}
@siddolo
siddolo / myservice.service
Created March 30, 2021 10:16
Systemd start script after docker service startup
#/etc/systemd/system/myservice.service
[Unit]
Description=My Scipt Description
After=docker.service
BindsTo=docker.service
#ReloadPropagatedFrom=docker.service
[Service]
ExecStart=/path/to/script.sh