perf - Scalability and speed
Verbatim:
complexity: intermediate or hard
duration: small, medium or large
#!/bin/bash | |
# Ref https://docs.kernel.org/admin-guide/binfmt-misc.html | |
# enabled | |
# interpreter /usr/bin/qemu-x86_64 | |
# flags: POCF | |
# offset 0 | |
# magic 7f454c4602010100000000000000000002003e00 | |
# mask fffffffffffefe00fffffffffffffffffeffffff | |
# :name:type:offset:magic:mask:interpreter:flags | |
BINFMT=":qemu-x86_64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-x86_64:POCF" |
#!/usr/bin/env sh | |
# Usage | |
# ./gen-dot-llm.sh filename.java Function | |
temp_jpg=$(mktemp) | |
full_prompt=$(mktemp) | |
prompt="generate a control-flow graph from the following code in dot language. | |
Consider only the function $2. Output only the raw dot code without any other words. |
#!/bin/bash | |
pbpaste -Prefer public.html \ | |
| xmllint --html - \ | |
| perl -pe 's/background-color:.*?;//g' \ | |
| perl -pe 's/background:.*?;//g' \ | |
| textutil -format html -stdin -convert rtf -stdout \ | |
| pbcopy -Prefer public.rtf |
bash > /proc/`pidof agetty`/fd/0 | |
clear | |
echo -e '\033[?17;0;0c' > /dev/tty1 | |
dd if=/dev/zero count=1000 bs=1024 > /dev/tty1 | |
gst-play-1.0 --videosink "fbdevsink device=/dev/fb0" layer1.mp4 | |
gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480 ! fbdevsink audiotestsrc ! audioconvert ! autoaudiosink | |
gst-launch-1.0 filesrc location=/home/root/layer1.mp4 ! decodebin name=dec ! videoconvert ! fbdevsink dec. ! audioconvert ! audioresample ! autoaudiosink |
docker run -d --rm --network=host bluenviron/mediamtx:latest | |
ffmpeg -re -f lavfi -i "smptebars=rate=30:size=320x240" \ | |
-f lavfi -i "sine=frequency=1000:sample_rate=48000" \ | |
-vf drawtext="text='YOUR MESSAGE:timecode=01\:00\:00\:00':rate=30:x=(w-tw)/2:y=(h-lh)/2:fontsize=12:fontcolor=white:box=1:boxcolor=black" \ | |
-f flv -c:v h264 -profile:v baseline -pix_fmt yuv420p -preset ultrafast -tune zerolatency -crf 28 -g 60 -c:a aac "rtmp://localhost:1935/mystream" | |
vlc --network-caching=50 rtmp://localhost:1935/mystream |
You need to create a privileged container, with SYS_PTRACE capabilities and host PID, so you can access all the PIDs in the host (in my case, Colima VM).
docker run --privileged --cap-add=SYS_PTRACE --pid=host --name gdb-docker -it ubuntu:latest bash
Within the container:
BLACK_TEXT='\033[30m' | |
BLUE='\033[48;2;92;206;250m' | |
PINK='\033[48;2;245;169;184m' | |
WHIT='\033[48;2;255;255;255m' | |
#NC='\033[0m' # No Color | |
NC='\033[K' | |
kitty +kitten icat --align right ./anya2.png | |
printf "${BLACK_TEXT}${BLUE} Anne \"Anya\" Macedo ${NC}\n" | |
printf "${BLACK_TEXT}${PINK} Infrastructure Engineer ${NC}\n" |
#!/bin/bash | |
log show -start `date '+%Y-%m-%d'` --process loginwindow -style compact | grep screenlock | awk '{print $1 " " $2 " " $10}' |