Skip to content

Instantly share code, notes, and snippets.

View neithanmo's full-sized avatar

Natanael Mojica neithanmo

View GitHub Profile
@extremecoders-re
extremecoders-re / qemu-networking.md
Last active May 4, 2024 05:55
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@utilForever
utilForever / SimpleReflection.cpp
Created August 25, 2016 01:54
Simple reflection on C++17 [Very simple approach to convert any struct (up to N members) to a tuple using C++17 structured bindings and the idea from Boost.DI]
#include <tuple>
#include <type_traits>
#include <cassert>
template <class T, class... TArgs> decltype(void(T{std::declval<TArgs>()...}), std::true_type{}) test_is_braces_constructible(int);
template <class, class...> std::false_type test_is_braces_constructible(...);
template <class T, class... TArgs> using is_braces_constructible = decltype(test_is_braces_constructible<T, TArgs...>(0));
struct any_type {
template<class T>
@gre
gre / simple luma.glsl
Last active August 29, 2015 14:02 — forked from glslioadmin/TEMPLATE.glsl
GLSL.io Transition (v1)
// This template should ONLY be used for DEVELOPMENT
#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D from, to;
uniform float progress;
uniform vec2 resolution;
uniform sampler2D luma;
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@strezh
strezh / GStreamer-1.0 some strings.sh
Last active October 2, 2023 09:00
GStreamer-1.0 personal cheat sheet
#!/bin/bash
# play YUV444 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
videoparse width=1920 height=1080 framerate=25/1 format=GST_VIDEO_FORMAT_Y444 ! \
videoconvert ! \
autovideosink
# play YUV422 FULL HD file
gst-launch-1.0 -v filesrc location=size_1920x1080.yuv ! \
@hiccupzhu
hiccupzhu / GStreamer sample
Created November 15, 2012 09:20
Using GStreamer gst_parse_bin_from_description
#include <gst/gst.h>
static const char* demux_cmd = "filesrc location=/mnt/hgfs/E/media/source/IceAgeTrailer.mpg ! mpegpsdemux";
#define DISABLE_MUX 1
#if DISABLE_MUX
static const char* enc_video_cmd = "queue ! ffdec_mpeg2video ! ffmpegcolorspace ! queue ! xvimagesink";
static const char* enc_audio_cmd = "queue ! mad ! queue ! audioconvert ! alsasink";
#else