Skip to content

Instantly share code, notes, and snippets.

View jcelerier's full-sized avatar
🏳️‍🌈
bash the fash

Jean-Michaël Celerier jcelerier

🏳️‍🌈
bash the fash
View GitHub Profile
@jcelerier
jcelerier / psx_extract.sh
Created August 20, 2015 19:27
Script to extract PSX roms in 7z / bin / ape format.
#!/bin/bash -eux
# Extracts and load PSX games that are distributed in .7z / .ape format.
# Requires : ffmpeg, perl, cdemu, ecm2bin
GAME_FOLDER="$1"
EXTRACT_FOLDER=/tmp/game
rm -rf "$EXTRACT_FOLDER"
mkdir "$EXTRACT_FOLDER"
cp -rf "$GAME_FOLDER"/* "$EXTRACT_FOLDER"
@jcelerier
jcelerier / glibc.md
Created October 6, 2023 12:41 — forked from wagenet/glibc.md
glibc Versions

glibc Versions

List of oldest supported version of top 10 Linux Distros and their glibc version according to distrowatch.com.

Summary

Out of all versions with published EOLs, 2.12 is the oldest glibc still active, found in CentOS 6.8.

If CentOS 6 and 7 are eliminated, the oldest glibc is 2.23 in Ubuntu and Slackware.

@jcelerier
jcelerier / stream.sh
Created October 2, 2023 12:33 — forked from philhartung/stream.sh
Stream a video via network to OBS with low latency (<100ms)
#!/bin/sh
# host is the IP of the receiving computer
host="192.168.0.101"
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-h264, width=1920, height=1080, framerate=30/1 ! rtph264pay ! udpsink host=$host port=5004
#include <QAction>
#include <QApplication>
#include <QLineEdit>
#include <QMenu>
#include <QMessageBox>
#include <QPushButton>
#include <QTableWidget>
#include <QVBoxLayout>
struct Form : QWidget {
@jcelerier
jcelerier / optimized2.cpp
Created July 25, 2022 17:58
counting words in c++
#include <algorithm>
#include <boost/container/small_vector.hpp>
#include <fmt/format.h>
#include <robin_hood.h>
static constexpr inline char to_lower(char c) noexcept {
return ((c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c);
}
@jcelerier
jcelerier / script.sh
Last active April 10, 2022 21:04
Apply an audio lowpass on every frame of a gif
#!/bin/sh
# Invocation : script.sh name-of-the.gif
# Find out the size
SIZE=$(identify $1 | egrep --only-matching '[0-9]+x[0-9]+' | head -n 1)
mkdir -p frames
rm -rf frames/*
# Extract individual frames
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/frame.h>
#include <libavutil/mem.h>
}
#include <cassert>
#include <iostream>
@jcelerier
jcelerier / LICENSE
Created November 28, 2020 17:54 — forked from targodan/LICENSE
Complementing code for my blog post "Decoding audio files with ffmpeg": https://www.targodan.de/post/decoding-audio-files-with-ffmpeg
The MIT License (MIT)
Copyright (c) 2016 Luca Corbatto
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
#include <ossia/network/value/value.hpp>
#include <ossia/editor/curve/curve_segment/easing.hpp>
#include <iostream>
#include <functional>
struct value_interpolator
{
double progress;
std::function<double(double start, double end, double progress)> easing;
@jcelerier
jcelerier / H264_Decoder.cpp
Created April 23, 2019 14:53 — forked from roxlu/H264_Decoder.cpp
LibAV parser and decoder example with openGL (YUV420 -> RGB shader).
#include "H264_Decoder.h"
H264_Decoder::H264_Decoder(h264_decoder_callback frameCallback, void* user)
:codec(NULL)
,codec_context(NULL)
,parser(NULL)
,fp(NULL)
,frame(0)
,cb_frame(frameCallback)
,cb_user(user)