Wondering whether it would be a good idea to re-implement AppImage tools in Golang.
Advantages:
- Maintainable, easy code (unlike "modern C++")
- Short compilation times
- Statically linked binaries, no dependencies
- Synergies with snap?
- Fun?
package myexec | |
import ( | |
"bufio" | |
"bytes" | |
"context" | |
"fmt" | |
"io" | |
"os" | |
"os/exec" |
Hello, brethren :-)
As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".
git archive --format=tar.gz -o /tmp/my-repo.tar.gz --prefix=my-repo/ master
More detailed version: https://til.simonwillison.net/git/git-archive
This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.
The key point here is to specify Accept=yes
, which will make the socket accept connections (behaving like inetd) and pass
only the resulting connection socket to the service handler.
#include <getopt.h> | |
#include <iostream> | |
int num = -1; | |
bool is_beep = false; | |
float sigma = 2.034; | |
std::string write_file = "default_file.txt"; | |
void PrintHelp() | |
{ |
/* | |
* A simple example of json string parsing with json-c. | |
* | |
* clang -Wall -g -I/usr/include/json-c/ -o json_parser json_parser.c -ljson-c | |
*/ | |
#include <json.h> | |
#include <stdio.h> | |
int main() { | |
struct json_object *jobj; |
""" | |
A file lock implementation that tries to avoid platform specific | |
issues. It is inspired by a whole bunch of different implementations | |
listed below. | |
- https://bitbucket.org/jaraco/yg.lockfile/src/6c448dcbf6e5/yg/lockfile/__init__.py | |
- http://svn.zope.org/zc.lockfile/trunk/src/zc/lockfile/__init__.py?rev=121133&view=markup | |
- http://stackoverflow.com/questions/489861/locking-a-file-in-python | |
- http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ | |
- http://packages.python.org/lockfile/lockfile.html |