Skip to content

Instantly share code, notes, and snippets.

View arbal's full-sized avatar
👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);

Arbal arbal

👌
new Adaptor(this); // new Adaptor(_humans[].Behavior);
  • Los Angeles, CA
  • 00:56 (UTC -07:00)
View GitHub Profile
@arbal
arbal / compose.yml
Created March 10, 2025 01:47 — forked from Nerahikada/compose.yml
run mitmproxy with tailscale (docker compose)
services:
tailscale:
image: tailscale/tailscale:latest
environment:
- TS_HOSTNAME=mitmproxy
- TS_STATE_DIR=/var/lib/tailscale
- TS_USERSPACE=false
volumes:
- ./tailscale:/var/lib/tailscale
- /dev/net/tun:/dev/net/tun
@arbal
arbal / ffmpeg-scripts.sh
Created March 2, 2025 23:39 — forked from HirbodBehnam/ffmpeg-scripts.sh
FFMpeg scripts I use to convert videos
# Simple FFMPEG scripts I use to convert videos or audios
# The ones with h264_nvenc codec only work with NVidia graphic cards. You also need to install the drives to use them
# The hevc_nvenc codec is pretty fast but the output file size is terrible. So I won't include that in. (Special thanks to Erfan Mojibi)
# The libx265 provides better quality to file size. So we can increase the crf in it (source: https://trac.ffmpeg.org/wiki/Encode/H.265#ConstantRateFactorCRF)
# The tag is provided by @alirezahabib
# Simple convert from webm to mp4. ACC audio codec at 128kb/s. Change 24 to change the quality (higher is worse)
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v h264_nvenc -cq:v 24 -profile:v high -c:a aac -b:a 128k -strict experimental out.mp4
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v libx264 -crf 24 -c:a aac -b:a 128k -strict experimental out.mp4
ffmpeg -i in.webm -r 10 -vf "scale=-2:720" -c:v libx265 -crf 28 -c:a aac -b:a 128k -tag:v hvc1 -strict experimental out.mp4
@arbal
arbal / screen-resize.applescript
Created February 6, 2025 23:41 — forked from SebastiaanKloos/screen-resize.applescript
Resize current screen, center current screen & capture window with CleanShot
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Screenshot resize
# @raycast.mode silent
# Optional parameters:
# @raycast.icon 📸
# @raycast.packageName Utilities
@arbal
arbal / SCAN_CORRUPTED_VIDEOS.md
Created January 28, 2025 20:59 — forked from ridvanaltun/SCAN_CORRUPTED_VIDEOS.md
How to check if a video file is corrupted?

Download ffmpeg from here, download *-win64-gpl.zip for Windows.

Install ffmpeg for Ubuntu

sudo apt install ffmpeg

Below command will give you a log file. If no error found, the log file will be empty.

@arbal
arbal / _verify-repair-permissions-disk.md
Created January 22, 2025 19:04 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@arbal
arbal / recommended-transcoding.sh
Created January 9, 2025 23:49 — forked from jungin500/recommended-transcoding.sh
FFmpeg recommended GPU transcoding command sets
@arbal
arbal / decode-dyn-uti.swift
Created January 8, 2025 21:09 — forked from jtbandes/decode-dyn-uti.swift
Dynamic UTI decoding
/// Decodes a dynamically-generated Uniform Type Identifier for inspection purposes. (**NOT FOR PRODUCTION USE!**)
/// Many, many thanks to http://alastairs-place.net/blog/2012/06/06/utis-are-better-than-you-think-and-heres-why/
///
/// <https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html#//apple_ref/doc/uid/TP40001319-CH202-BCGCDHIJ>
func decodeDynUTI(_ uti: String) -> String?
{
let vec = Array("abcdefghkmnpqrstuvwxyz0123456789")
let encoded = Array(uti).suffix(from: 5)
var result: [UInt8] = []
@arbal
arbal / diskusage_by_ext.sh
Created January 8, 2025 16:37 — forked from dannyNK/diskusage_by_ext.sh
Lists disk usage of files in the current folder by file extension
# Based on answer from Yuval here: https://askubuntu.com/a/1214458/687179
# output pairs in the format: `filename size`.
# I used `nawk` because it's faster.
find . -type f -print0 | xargs -0 stat -f'%N %z' | awk '
{
split($1, a, "."); # first token is filename
ext = a[length(a)]; # only take the extension part of the filename
size = $2; # second token is file size
total_size[ext] += size; # sum file sizes by extension
}
@arbal
arbal / doh_test.sh
Created December 13, 2024 00:07 — forked from dtmsecurity/doh_test.sh
DNS over HTTPS (DoH) Resolver GET Test Script
#!/bin/bash
printf "===START dns.google.com===\n"
curl -k -H "accept: application/dns-json" "https://dns.google.com/resolve?name=example.com&type=AAAA"
printf "\n===END dns.google.com===\n"
printf "===START cloudflare-dns.com===\n"
curl -k -H "accept: application/dns-json" "https://cloudflare-dns.com/dns-query?name=example.com&type=AAAA"
printf "\n===END cloudflare-dns.com===\n"
printf "===START 1.1.1.1===\n"
curl -k -H "accept: application/dns-json" "https://1.1.1.1/dns-query?name=example.com&type=AAAA"
printf "\n===END 1.1.1.1===\n"
@arbal
arbal / installmicrok8s.md
Created December 11, 2024 16:15 — forked from Monarch73/installmicrok8s.md
Install microk8s in proxmox

Installing microk8s in an LXC container (i.e.: proxmox)

This is an roundition of https://gist.github.com/acj/3cb5674670e6145fa4f355b3239165c7 which got a bit messy

  1. Create a LXC container through the Proxmox web interface (ie.: ubuntu.23-10-lts)
    • untick "unpriviledged" container
    • in memory, set swap to 1024
    • set mem to at least 4096
    • in network, make sure you assign static ip-adress to the container
  • create container but don't start it.