Skip to content

gportay/templates

Repository files navigation

Template of codes

Here remain many examples of source files I have developed for years.

Those examples of code are mostly written in C/C++, Shell/Bash, and make/Makefile. Those languages are the foundations of low-level and system development.

Some of these examples, as zpc-publisher,zpc-subscriber or docker-shell, have served as proof of concept. The primary goal was to get familiar with new libraries; sometimes to mix libraries together as ProtoBuf and ZeroMQ with zpc-publisher,zpc-subscriber. Latter, some have become standalone projects: docker-shell gave birth to dosh.

Others examples, such as getopt or hexdump, are good templates to get started with a brand new project or to reuse code.

C/C++

addressbook - example of how to use protobuf API and create a Makefile

alarm - example of how to use alarm function

blkpg-part - partition table and disk geometry handling utility

daemonize - create daemon process

epoll - example of how to use epoll API

getopt - example of how to use getopt_long function

hexdump - display buffer content in hexadecimal and ascii

ini - simple C ini parser without context

dlrun - example of how to use dl library

line - simple C line parser without context

mime-types - example of how to use regex API

pexec - execute file in an interprocess channel

pthread-signal - example of how to use pthreads and signals

publisher,epoll-publisher,subscriber - simple ZMQ publisher and subscriber applets

sigwaitinfo - example of how to use sigwaitinfo function

sqlite-blob - example of how to insert/replace or select a blob in sqlite

sqlitefs - example of how to use FUSE using in a SQLite database filesystem

strtonargv - convert a string to a list of arguments

uevent - simple C kobject/uevent parser without context

ueventcat - concatenate UEVENT(s) to standard output

verrevcmp - comparison of version numbers

zombize - create zombie process

zpc-publisher,zpc-subscriber - simple ZMQ publisher and subscriber applets using protobuf messages

DOCKER

casync - a webstore for casync with building facilities

MAKEFILE

asm-setup - asm installer written in make

udev - udev rules installer for oneplus devices

openssl - provides implicit rules to generate openssl RSA keys

foreach - build a repository of archive using foreach function

QT/QML

webview - a simple WebViewer based on Qt WebView.

SHELL/BASH

amount - serial-disk auto-mounter

autoextract.sh - make a tar auto-extractable

cleanup.sh - how to implement a shell destructor script in shell

cyberpower-pdu - manages remote outlets

deb-xtar - restore files from nested data.tar.gz archive of a debian package

debootstrap-shell - command interpreter (shell) for debootstrap

docker-shell - run a user shell in a new container with cwd bind mounted

ini-parser.bash - an ini-style parser written in bash for bash

prompt_yes_no - prompt user for a yes/no reply

version-lt.sh - prints the lower version

SED

protodec-c.sed - decompile protobuf C header

SYSTEMD

echo - an example of an echo socket and service for systemd.

AUTHOR

Written by Gaël PORTAY [email protected]

COPYRIGHT

Copyright (c) 2015-2019 Gaël PORTAY

This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.