Skip to content

Instantly share code, notes, and snippets.

View aoirint's full-sized avatar
🐱

aoirint aoirint

🐱
View GitHub Profile
@aoirint
aoirint / loop_until_success.sh
Created April 24, 2020 18:18
Loop command until success
until command ; do sleep 5 ; done
# {NUMBER}.png -> {NUMBER+1}.png
files = sorted(os.listdir('./'), key=lambda file: int(file[:-4]))
for file in reversed(files):
k = int(file[:-4]) + 1
os.rename(file, '%d.png' % k)
// ID.ext
Array.from(document.querySelectorAll('.css-9pa8cd')).map(e => e.src).filter(s => s.startsWith('https://pbs.twimg.com/media/')).map(s => s.slice(0,s.lastIndexOf('&'))+'&name=4096x4096').map(s => [s,s.slice(s.lastIndexOf('/')+1, s.lastIndexOf('?'))+'.'+new URL(s).searchParams.get('format')]).map(a => a.join(' ')).join('\n')
// index_ID.ext
Array.from(document.querySelectorAll('.css-9pa8cd')).map(e => e.src).filter(s => s.startsWith('https://pbs.twimg.com/media/')).map(s => s.slice(0,s.lastIndexOf('&'))+'&name=4096x4096').map((s,i) => [s,i+'_'+s.slice(s.lastIndexOf('/')+1, s.lastIndexOf('?'))+'.'+new URL(s).searchParams.get('format')]).map(a => a.join(' ')).join('\n')
@aoirint
aoirint / wgetf.py
Last active April 30, 2020 16:35
wget url,file list
#!/usr/bin/python3
import sys
import subprocess
import time
file = sys.argv[1]
interval = int(sys.argv[2])
with open(file, 'r') as fp:

/etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
sudo sysctl -p
@aoirint
aoirint / docker-compose.yml
Last active May 4, 2020 04:25
MariaDB (MySQL) utf8mb4 database docker-compose.yml
version: '3'
services:
db:
image: mariadb
#image: jsurf/rpi-mariadb
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --innodb_file_format=barracuda
restart: always
volumes:
- ./db:/var/lib/mysql
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="OBS Cam" exclusive_caps=1
ffmpeg -an -listen 3 -i rtmp://127.0.0.1:1935/live -f v4l2 -vcodec rawvideo /dev/video10

sudo modprobe -r v4l2loopback
Join from Browser
https://zoom.us/wc/join/{meeting_id}