Skip to content

Instantly share code, notes, and snippets.

View macbre's full-sized avatar
🏠
Working from home

Maciej Brencz macbre

🏠
Working from home
View GitHub Profile
@macbre
macbre / readme.md
Last active December 26, 2025 17:46
retropie

Troubleshooting

libavcodec.so.58: cannot open shared object file

$ cat /dev/shm/runcommand.log 
Parameters: 
Executing: /opt/retropie/emulators/retroarch/bin/retroarch -L /opt/retropie/libretrocores/lr-quicknes/quicknes_libretro.so --config /opt/retropie/configs/nes/retroarch.cfg "/home/pi/RetroPie/roms/nes/Super Mario Bros. 3 (Europe).nes" --appendconfig /dev/shm/retroarch.cfg
/opt/retropie/emulators/retroarch/bin/retroarch: error while loading shared libraries: libavcodec.so.58: cannot open shared object file: No such file or directory
/opt/retropie/emulators/retroarch/bin/retroarch: error while loading shared libraries: libavformat.so.58: cannot open shared object file: No such file or directory
@macbre
macbre / boot.txt
Last active December 17, 2025 19:40
Alix 6d2
INIT: Entering runlevel: 2
Booting 'voyage-linux-03Jan10'
root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
kernel /vmlinuz root=LABEL=ROOT_FS console=ttyS0,115200n8
[Linux-bzImage, setup=0x3000, size=0x163bd0]
initrd /initrd.img
[Linux-initrd @ 0xfa87000, 0x56834b bytes]
@macbre
macbre / multiformat-wp-api-response.php
Created May 30, 2024 11:36 — forked from petenelson/multiformat-wp-api-response.php
WordPress: Example of returning non-JSON results from the WP-API
<?php
// reference https://github.com/WP-API/WP-API/blob/develop/lib/infrastructure/class-wp-rest-server.php
// serve_request() function
add_filter( 'rest_pre_serve_request', 'multiformat_rest_pre_serve_request', 10, 4 );
function multiformat_rest_pre_serve_request( $served, $result, $request, $server ) {
// assumes 'format' was passed into the intial API route
// example: https://baconipsum.com/wp-json/baconipsum/test-response?format=text
@macbre
macbre / docker-compose.yml
Created May 1, 2024 19:37 — forked from lfache/docker-compose.yml
Mattermost docker-compose.yml with Traefik
version: "3"
services:
db:
build: db
read_only: true
restart: unless-stopped
volumes:
- ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
environment:
@macbre
macbre / .gitignore
Last active March 16, 2024 14:09
farerskiekadry.geo
.idea/
@macbre
macbre / truncate_docker_logs.sh
Created November 2, 2023 11:59
Docker utils
#!/bin/bash
# https://docs.docker.com/engine/reference/commandline/ps/#format
df -h /
for container in $(docker ps --format "{{.Names}}")
do
echo "Truncating logs for the '${container}' container ..."
# https://forums.docker.com/t/how-to-limit-or-rotate-docker-container-logs/112378/9
@macbre
macbre / .gitignore
Last active July 14, 2023 14:52
py-facebook-feed
# Byte-compiled / optimized / DLL files
__pycache__/
.pytest_cache/
*.py[cod]
*$py.class
*.swp
# C extensions
*.so
@macbre
macbre / example.ts
Created January 23, 2023 13:32
Async fs.exists()
import { fsExists } from './utils';
if ( ! ( await fsExists( folder ) ) ) {
// ...
}
// open any Daft page and go the dev console
clear();
const data = JSON.parse(document.querySelector('script[id="__NEXT_DATA__"]').textContent);
const listing = data.props.pageProps.listing;
console.log( listing.title );
// grab the images
const images = listing.media.images.map( img => img['size1440x960'] );