Skip to content

Instantly share code, notes, and snippets.

View jmftrindade's full-sized avatar
:shipit:
õ.Õ

Joana Trindade jmftrindade

:shipit:
õ.Õ
View GitHub Profile

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@jmftrindade
jmftrindade / README.md
Created August 14, 2019 06:04 — forked from rstacruz/README.md
How to install Docker in Mac, Windows, and Linux

Getting Docker

Docker is available for Linux, MacOS, and Windows.

MacOS

Docker for Mac is best installed with Homebrew and Homebrew Cask. For other ways to install on MacOS, see Install Docker for Mac in Docker's docs.

brew cask install docker # Install Docker
@jmftrindade
jmftrindade / shuf.md
Last active February 26, 2021 06:58
generate rand numbers within a range
$ start=10
$ end=100
$ n=5
$ shuf -i $start-$end -n $n -r
@jmftrindade
jmftrindade / awk.md
Last active August 24, 2021 22:03
AWK oneliners
@jmftrindade
jmftrindade / crontab.md
Created October 4, 2019 16:45
crontab and related
@jmftrindade
jmftrindade / README.md
Created November 1, 2019 21:43 — forked from maxrothman/README.md
Music searching

Music searching

This gist contains some tools I wrote to solve a problem I ran into when archiving folk tunes. Once I had 30+ tunes in the archive, it became hard to tell whether any particular tune I came across was already in the archive or not, and I'm usually not able to remember a tune note-for-note. The solution to this problem was to build a tool that could search for music scores based on an approximately-similar snippet.

Details

These tools are tuned to my particular setup, but the core should be generalizable. Here are the assumptions the code makes:

  • Scores are stored as compressed MusicXML (.mxl) files
  • The scores and both scripts are stored in the same directory
@jmftrindade
jmftrindade / systemd.md
Last active May 27, 2020 14:29
systemd

List all enabled services

systemctl list-unit-files --type service --state enabled,generated

List all running services

systemctl list-units --type service --state running
@jmftrindade
jmftrindade / ffmpeg.md
Last active February 26, 2021 17:36
ffmpeg

MP4 with PNG

fmpeg -loop 1 -i image.png -i song.mp3 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -profile:v baseline -level 3.0 -shortest video.mp4

GIF to MP4

ffmpeg -i loop.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" loop.mp4
@jmftrindade
jmftrindade / cpu.md
Last active February 26, 2021 06:56
cpu

Physical vs logical cores

lscpu --all --extended
@jmftrindade
jmftrindade / nvram.md
Last active April 21, 2022 20:25
NVRAM and related

Installing ndctl, pmdk and ipmctl:

Keep the installation directories around for both of these libs, as the only way to uninstall them is by going into the original install dirs, and then make uninstall.

Required for both ndctl and pmdk:

$ apt install pkg-config
$ export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH}