Inheritance and Virtual Table are often used to create interface in C++ polymorphic class
What if ... there were another way to do this ?
easier, cleaner, faster and more reliable
This article explains how to useCRTP
, [std::variant
](https://en.cppreference.com/w/cpp/utility/variant andstd::visit
to increase code performance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
See https://www.pragmaticlinux.com/2020/10/start-a-virtualbox-vm-on-boot-with-systemd/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @brief Helper to read key value pairs | |
# @details | |
# Read kv in the form <key>=<value> | |
# The script cleans whitespaces first and will remove any newlines | |
# @see https://stackoverflow.com/a/27918723/1267320 | |
read_kvp() | |
{ | |
file="$1" | |
while IFS="=" read -r key value; do | |
# clean whitespaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options | |
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full. | |
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}… | |
Getting help: | |
-h — print basic options | |
-h long — print more options | |
-h full — print all options (including all format and codec specific options, very long) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zfs list -H -o name -t snapshot | xargs -n1 zfs destroy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ zfs destroy -nv system/usr/jails@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/pg93@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/mysql55@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/pg94@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/empty@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/toiler@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/pg90@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/ansible@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/snapshots@BeforeUpgradingBaseJailFrom9.1To9.3 | |
would destroy system/usr/jails/ansible-slave@BeforeUpgradingBaseJailFrom9.1To9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <X11/Xlib.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
Display *display; | |
Window window; | |
XEvent event; | |
int s; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MODEM="$(mmcli -L | grep -o '/org/freedesktop/ModemManager1/Modem/[0-9]*' | head -1)" | |
BEARER="$(mmcli -m $MODEM --list-bearers | grep -o '/org/freedesktop/ModemManager1/Bearer/[0-9]*' | head -1)" | |
mkdir -p /run/systemd/network | |
connect() { | |
MODEM="$(mmcli -L | grep -o '/org/freedesktop/ModemManager1/Modem/[0-9]*' | head -1)" | |
# hardcode all the things !! (this is for mobile vikings) |
We can use socat
to create 2 virtual serial ports that are connected to each
other locally. This can be useful for debugging serial port applications. Or
simulating serial port communication. Or running 2 legacy programs that only
communicate with each other over serial ports, such as old DOS games. And of
course, for education, since serial communication is probably the most simple
communication protocol there is, RS232 is considered at the bottom of the OSI
stack, at the "Physical Layer". See: http://electronics.stackexchange.com/questions/31171/internet-vs-serial-communication