Skip to content

Instantly share code, notes, and snippets.

View xdubx's full-sized avatar
🎯
Focusing

xdubx

🎯
Focusing
  • Replace GbR
  • Germany
View GitHub Profile
@xdubx
xdubx / gist:54a735c5a6c934331c0753157540fbe7
Last active January 6, 2025 13:36
yubiko key piv as ssh debian
ykman piv keys generate -a RSA2048 --pin-policy=NEVER --touch-policy=ALWAYS 9a public.pem
ykman piv certificates generate --subject "CN=SSH key" --valid-days 3650 9a public.pem
# add lib to ssh agend
ssh-add -s /usr/lib/x86_64-linux-gnu/libykcs11.so
# convert key for server
ssh-keygen -i -m PKCS8 -f public.pem
@xdubx
xdubx / save_frame_as_jpeg.c
Created February 2, 2021 00:04 — forked from tyraeltong/save_frame_as_jpeg.c
Save an AVFrame as a JPEG file using FFmpeg
int save_frame_as_jpeg(AVCodecContext *pCodecCtx, AVFrame *pFrame, int FrameNo) {
AVCodec *jpegCodec = avcodec_find_encoder(AV_CODEC_ID_JPEG2000);
if (!jpegCodec) {
return -1;
}
AVCodecContext *jpegContext = avcodec_alloc_context3(jpegCodec);
if (!jpegContext) {
return -1;
}