Posts by Year

2024

My first patch to libc++

3 minute read

I listened to an older cppcast episode and it mentioned that the C++17 mathematical special functions are not yet included in llvm’s standard library libc++....

Better git diff

less than 1 minute read

The output of git calls, e.g. git diff, can be improved. Instead of only showing changed lines it can highlight the parts of a line that actually changed. Se...

VSCode freezes on XFCE

less than 1 minute read

VSCode might freeze on a freshly installed Manjaro running XFCE whenever one opens a folder containing a git repository.

C++ Attributes

5 minute read

C++ code can contain attributes (e.g. [[deprecated]]). These serve different purposes, ranging from silencing compiler warnings to changing optimization stra...

C++ CRTP vs concepts

1 minute read

CRTP is infamous for its complexity. You can use C++20 concepts to reimplement the feature.

C++ Initialization Flow Chart

less than 1 minute read

C++ is infamous for its overly complex initialization processes. It is even worse than one would anticipate (with basic knowledge of the language). There is ...

Source code visualization

1 minute read

Starting to work on a large code base usually involves reading lots of code and building up a mental structure of the code base. There are tools that can aid...

Talk: Expression templates

6 minute read

Talk: Expression Templates for Efficient, Generic Finance Code - Bowie Owens - CppCon 2019

Talk: std::chrono in finance

1 minute read

Talk: Using std::chrono Calendar Dates for Finance in Cpp - Daniel Hanson - CppCon 2022

Talk: Forwarding References

5 minute read

Talk: CppCon23: Back to Basics: Forwarding References - How to Forward Parameters in Modern C++ - Mateusz Pusz 2023

Manjaro’s pamac in dark mode

less than 1 minute read

Manjaro’s pamac (gui alternative to pacman) does not adhere to the global theme set via the “Appearance” menu. You additionally need to set the GTK_THEME var...

Linux: Add menu entry to desktop environment

less than 1 minute read

One can add custom entries to the program list in graphical desktop environments such as XFCE. You can either right-click on the menu or add a “.desktop” fil...

C++: in-class-initializer

less than 1 minute read

C++ is infamous for its extremely complex initialization. Since C++11 one can initialize class members directly at point of declaration. The official name is...

C++: Placeholder _

1 minute read

C++ is on its way to get a placeholder variable _ similar to other languages, e.g., Python, rust.

Talk: libclang tutorial

1 minute read

https://youtu.be/VqCkCDFLSsc Tutorial video about using libclang. ~30min from 2013. LibclangLibrary to access clang's AST for source code. Contains ...

CMake: Linking against system libraries

less than 1 minute read

Usecase: You want to make use of some system-wide installed library. Install the library using your linux package manager. Most installed libraries can be...

Manjaro: Newest Kernel not booted automatically

2 minute read

Problem: You installed a new kernel in Manjaro either via GUI tool or via the commandline tool mhwd-kernel. After a restart it usually is selected by defaul...

Turbo Introduction of C++20 modules

2 minute read

Old school libraries use splitting into hpp/cpp files. Mayor drawbacks: leaking of macros (hpp can be different at library's consumer side than at library p...

Back to Top ↑

2023

profiling c++ under linux using gprof

less than 1 minute read

In-depth tutorial: https://www.thegeekstuff.com/2012/08/gprof-tutorial/ Summary: Compile with -pg compiler flag (gcc/clang). Executing binary gives gmon.o...

terminator: useful multi-window terminal emulator

less than 1 minute read

one can set terminator up to start with pre-defined layout and terminals. important distinction: layout defines where and how a window should be setup and a...

fast linker: mold

less than 1 minute read

Install mold on your linux box. Enable mold for gcc/clang by supplying -fuse-ld=mold, e.g. clang -fuse-ld=mold a.cpp Enable in CMake by supplying argu...

Boost Test + QuantLib

1 minute read

QuantLib has unit tests built in which are based on Boost Test. How to build: $ cmake --build build --preset=MyPreset$ cmake --build build/MyPreset --targ...

CMake presets

less than 1 minute read

CMake can group settings together via presets. Usage: $ cmake --presets=<PRESET>autocomplete with <tab> key See $<ROOT>/CMakePresets.j...

Code OSS - VSCode unbranded: use Microsoft store

less than 1 minute read

How to use MS extension store in unbranded VSCode edition (e.g. Manjaro code OSS) $ sudo vim /usr/lib/code/product.json "extensionsGallery": {"serviceUr...

Back to Top ↑

2022

git: change name/email of commits

2 minute read

Use case: local commits contain personalized information, i.e. your personal email address, and you want to get rid of them.

Epson Printer ET-2750 stuck in bootup

1 minute read

Problem The Epson printer is stuck while booting up and shows the message "Set Jig". This can happen for a variety of reasons, mostly because a firmwar...

Unclog printer head

1 minute read

Problem Inkjet printers, such as Epson ET-2750, dry out quite regular. This results in a clogged printer head which shows as artificats in print outs, e.g...

git: changing server

1 minute read

Problem: You want to switch the repo from a server where you don't have root access to another where you do. Copying from local machine to the new server ...

git: copying local repository to server

less than 1 minute read

Setup: You have a local machine which can access a server via ssh (user: git). git is installed on the server. Problem: You setup a git repo locally, star...

Back to Top ↑

2021

Regular printing for ink-jet printers

2 minute read

Ink-jet printers might dry out if they don't print in regular intervals. The intervals depend on multiple factors, e.g. room temperature, ink quality. Some ...

i3: Map application to workspace

less than 1 minute read

When using i3: Applications can be moved automatically to specific workspaces at start of the app. Do the following: Start the app Run in a terminal xpro...

Back to Top ↑

2020

tmux: session initialization

2 minute read

use case: you need to connect to multiple hosts at once and leave the connections active even as you log out from the entry node. network layout: remote m...

pdfs zusammenfuegen

1 minute read

zuerst schaue ob das programm pdfunite installiert ist oeffne terminal fuehre folgenden befehl aus $ pdfunite -v wenn das programm nicht installiert ist k...

time syncronization: ntp via systemd

less than 1 minute read

enabling time synchronization via systemd the following is needed check time before $ timedatectl status enabling ntp $ timedatectl set-ntp true check syste...

Resize encrypted LUKS volume

less than 1 minute read

A default encrypted installation of standard distributions (manjaro, fedora, etc.) create LVM-LUKS volumes. The process of resizing is easy. start live-cd s...

raspbian: enable ssh for headless install

less than 1 minute read

raspbian OS can enable ssh by default. this is handy for a headless install. mount boot partition: $ sudo mount /dev/mmcblk0p1 /mnt create ssh file: $ sudo...

Back to Top ↑

2019

Update local git clone: new TAGS

less than 1 minute read

When you have a local clone of a remote repository and want to update it: pulling will not get all the new tags... run the following [code language="bash" co...

Synology: SEC_ERROR_REVOKED_CERTIFICATE

less than 1 minute read

updating your synology to DSM6.2.2 will lead to a certificate error. it cannot renew the letsencrypt certificate anymore. current workaround: pre: ports 80,...

Back to Top ↑

2018

Arch: find package for specific command

less than 1 minute read

The problem is: How do you find the package for a given command? Two solutions are presented. Use the program pkgfile. Use pacman. Update database: $ sudo...

ssh config: include multiple files

less than 1 minute read

it is useful to split up the ssh config file. do as follows create config folder $ mkdir ~/.ssh/config.d create multiple config files in that folder (I grou...

Back to Top ↑

2017

arch: disable linux error beep

less than 1 minute read

this beep comes up in terminals and for each error in matlab. just annoying.... fix this by disabling the right kernel module. append to /etc/modprobe.d/b...

arch+matlab: setup opengl rendering

less than 1 minute read

hardware accelerated rendering needs enabling. check out the arch-wiki page. i needed to install the intel graphics driver. explained here. to set the openg...

thunderbird: export message filters

less than 1 minute read

one can export/import/backup the message filters but it's more involved than it should be. the message filters are in single files within your home directory...

Latex+beamer: dual screen presentation

1 minute read

you can include notes into your slides. just use \note{txt} inside of your frame environment. you can also make use of overlays and align all notes in itemiz...

Latex: change numbering style of figures/tables

less than 1 minute read

put this in your preamble [code language="latex"] % figures/tables should be labeled: 1,2,3,4,... \renewcommand{\thefigure}{\arabic{figure}} \renewcommand{\t...

Install Firefox Nightly binaries from Mozilla

less than 1 minute read

Installation process is similar to the one for Thunderbird Daily (see this blog post). differences: binary download link: # wget "https://download.mozilla.o...

Install Thunderbird Daily binaries from mozilla

2 minute read

Thunderbird Daily can be installed in most distros directly from their repos but more often than not it is outdated (they usually disable automatic updates)....

git: find out which files are ignored and why

less than 1 minute read

i had a very large global ignore list (tex/vim/linux/python specific stuff) and in this one repo git didnt add one specific folder. as it turned out the glob...

backups with rsnapshot

2 minute read

a centralized backup server can easily be set up with rsnapshot. This program can pull specified remote folders with rsync. install rsnapshot edit the confi...

RPi: automount USB drives via fstab

less than 1 minute read

for mounting external usb drives one can use fstab. each column has its specific meaning (see here for definitions). for external usb drives it is important ...

Ubuntu/Mint/Debian: Install current TeXstudio

less than 1 minute read

one can include the ppa from opensuse for the most current texstudio version: add the ppa's key to your keychain: $ wget -nv http://download.opensuse.org/re...

Install firefox nightly on ubuntu/mint

less than 1 minute read

for the nightly builds of firefox do the following: just include the following ppa:$ sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa update and install...

Mint: install current owncloud-client

less than 1 minute read

the version in mint's repos is out-dated and to install the new one, just add opensuse's repo for owncloud. check out this entry for ubuntu 16.04: https://so...

raspi: install/configure owncloud

less than 1 minute read

installation process as in this link. just change one step: download the newest owncloud client from their website. to reset the admin password: sudo -u www-...

raspi: dyndns via ddclient

less than 1 minute read

to get dyndns on raspi install: ddclient setup config file: /etc/ddclient.conf example for strato server: link setup second config file (/etc/default/ddclien...

Mint: install and configure MATLAB

1 minute read

installation: installation download matlab iso files mount first cd run the installer (install.sh or similar) from within $HOME: $ cd $HOME; /path/to/cd1/i...

raspi: change hostname

less than 1 minute read

do the following: sudo vim /etc/hosts change last line: 127.0.1.1 XYZ where XYZ should be the new name you want sudo vim /etc/hostname replace the name ...

raspi: mount usb drives on bootup

less than 1 minute read

to auto mount usb drives on bootup one can simply add some lines to the /etc/fstab file: UUID=e0a4c8da-67d1-423d-939c-4dc8249079f0 /mnt/small btrfs rw,defaul...

SL7: enable EPEL repos

less than 1 minute read

there is a vast repo for packages not (officially?) maintainted by redhat. to enable this repo (called EPEL) the following steps are needed: get and install...

SL7: fastest mirrors

less than 1 minute read

to enable the automatic checking for fastest mirrors within yum install the following plugin: $ sudo yum install yum-plugin-fastestmirror check that plugins ...

SL7: install owncloud-client

less than 1 minute read

the install process for owncloud-client within scientific linux 7.x is quite easy (do as root): [code language="bash"] $ cd /etc/yum.repos.d/ $ wget http://d...

wordlists: most common words

less than 1 minute read

for password attacks one needs good password lists. the following are quite nice: in kali: /usr/share/wordlists lots of different lists, mostly aquired from...

sshd: secure config file

2 minute read

the ssh daemon is a entry point to many servers. it should be secured!! the following /etc/ssh/sshd_config is secure and very restrivtive: [code language="ba...

synology: ssh

2 minute read

the synology's nas boxes have their own will concerning ssh. enable ssh service: at first one needs to enable the ssh service within the web-gui (link: syno...

install virtualbox on mint/ubuntu/debian

less than 1 minute read

the most current virtualbox version is available from the official virtualbox repository. to activate it follow this guide: virtualbox.com

rsync backup only over night

less than 1 minute read

it is kinda nice to have a rsync job running while the bandwidth is not needed otherwise. start a main script each night (using cron) the main script uses t...

rsync backup script

1 minute read

everyone needs a rsync backup script at some point in their life ;)   this is the one i wrote in the last couple minutes/hours/days/years ... it syncs a loca...

exiftool: renaming pictures

less than 1 minute read

rename pictures according to their exifdata time stemp: [code] exiftool "-FileName<CreateDate" -d "%Y%m%d_%H%M%S_%%c.%%e" . [/code] ...

firefox: beef up privacy

less than 1 minute read

change the user agent string: open: about:config add the following: right click -> new -> string: general.useragent.override input string (e.g., mos...

raspi: log network traffic (vnstat)

less than 1 minute read

to monitor the network traffic one can use the tool vnstat install vnstat setup database for interface: vnstat -u -i eth0 start/enable service usage: update...

raspi: change ssh login banner

less than 1 minute read

you need to edit the file: /etc/motd as well as the sshd config: /etc/ssh/sshd_config: Change the setting PrintLastLog to "no", this will disable the "Last l...

raspi: automatically spin external hdd down

1 minute read

the raspberry pi cannot spin external hard drives down. the program hdparm worked perfectly for me. i followed this guide (htpcguides.com). just some slight ...

raspi: install torrent server

less than 1 minute read

the raspberry pi is a perfect device for a 24/7 torrent server. one can install the torrent server: deluge. i followed this guide (howtogeek.com) to install ...

Back to Top ↑

2016

git ignore files (especially global)

less than 1 minute read

one can create gitignore files for specific repos and also globally. github offers gitignore templates for lots of different things: frameworks, languages, e...

git config

less than 1 minute read

edit the file: $HOME/.gitconfig [code language="bash"] [alias] co = checkout ci = commit st = status br = branch hist = log --pretty=format:\"%h %ad | %...

dtrx: extract multiple formats

less than 1 minute read

there is a handy tool to extract archives of almost any kind. it goes by the name of .... dtrx!!! checkout the links: dtrx homepage tecmint.com

virtualbox:not booting (grub)

less than 1 minute read

I recently installed a unix system with virtualbox and after reboot it woudnt start at all - no output.. I started a live cd and reinstalled grub. worked lik...

raspi: time via ntp

less than 1 minute read

the ntpserver is just a waist of memory for a raspi and its enough to synchro the time every couple hours. follow this: right time zone: [code]$ sudo dpkg-r...

vuln: auditing source code

less than 1 minute read

most common vulnerabilities: memory corruption: same data copied into memmory parts not assigned for it. often comes with these functions: strcat, strcpy, ...

it basics: types and number representation

1 minute read

types (int,long,..) often vary in size and therfore one uses standard types: qtypes_t where q is a qualifier, type is the base type, s is the width in bits a...

machine level code

1 minute read

eip: address in memory of next instruction registers: some hold important addresses other used for temporary data on 32-bit architecture 8 registers are us...

compiler

1 minute read

a compiler translates source code into machine level code preprocessor: inlcudes and macros are expanded compiler: generates assembly code compiler: generat...

git usage

less than 1 minute read

super easy explanation given in this link the usual workflow for changing is as follows: local changes add: local index commit: local head push: reposito...

openssl for ssl certs

less than 1 minute read

openssl can work well with ssl certs. the following links explains the following points in detail: create private keys (domain.key) create certificate reque...

use mmcli for sending SMS

1 minute read

I use an UMTS modem with my raspberry pi 1. the package mmcli is quite useful for handling the modem (e.g., sending SMS,..) list modems:[code language="bas...

vimrc

2 minute read

this is a little vimrc that is just about right for small purposes.. (edit the file ~/.vimrc for user specific changes and /etc/vimrc?? for systemwide config...

arch: pacman automatic download

less than 1 minute read

This little post explains how to enable download for packages of pacman. It uses a systemd service. Create the download service (note the option -w for just ...

edit zsh prompt

1 minute read

append to .zshrc in home folder to import file: $ vim ~/.zshrc ... source .zshrc-prompt create .zshrc-prompt in home dir: [code language="bash" collapse="t...

Install Tipp10 under debian-based distros

less than 1 minute read

Install the 10-finger practice-typing program "Tipp10". It features addaptive lessons concerning indiviual typing errors, and much more.. install 32-bit lib...

virtualbox mount shared

less than 1 minute read

to mount a shared folder, I had to mount it by cmdline: sudo mount -t vboxsf share ~/host

texlive install: minimal version

less than 1 minute read

I tried to install a smaller version of texlive on a linux mint system. the following packages are sufficient for my needs (math+science orientied): texlive ...

1 minute read

to enable automatic updates install: [code language="bash"] $ apt install unattended-upgrades [/code] check and uncomment in the config file as needed, well ...

use encrypted folders

less than 1 minute read

mounting already encrypted folders: sudo mount -t ecryptfs <folder> <folder> -o key=passphrase,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptf...

turn num lock on at startup

less than 1 minute read

install numlockx and edit config: vim /etc/mdm/Init/Default if [ -x /usr/bin/numlockx ]; then /usr/bin/numlockx on fi source: http://unix.stackexchange.com/...

custom python3.x install (on mint)

less than 1 minute read

follow instructions from: http://grahamwideman.wikispaces.com/Python-+Installation+on+Linux note the following: use (latest) python version that you want us...

bash extract function

1 minute read

it's convenient to define this function in your bashrc, s.t. you dont have to think of all the different file formats while extracting. source: https://coder...

python image library

less than 1 minute read

for editing pictures with python from PIL import Image im = Image.open("foo.png") pix = im.load() pix[x,y] = value im.show() im.save("new.jpg") source: http...

pdf editing

less than 1 minute read

install the following program: pdftk simple cutting: pdftk myDocument.pdf cat 1-9 26-end output removedPages.pdf cutting multiple files: pdftk A=one.pdf B=t...

Back to Top ↑