| Method | Result |
|---|
| This is gist. | |
| There are many like it, but this one is mine. | |
| It is my life. | |
| I must master it as I must master my life. | |
| Without me gist is useless. | |
| Without gist, I am useless. |
| /* | |
| * Simple sound playback using ALSA API and libasound. | |
| * | |
| * Compile: | |
| * $ cc -o play sound_playback.c -lasound | |
| * | |
| * Usage: | |
| * $ ./play <sample_rate> <channels> <seconds> < <file> | |
| * | |
| * Examples: |
| # Instrument binaries, pgo data to /data/pgo, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-generate=/data/pgo' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 | |
| # Run instrumented program, generate and write pgo data | |
| ./runIt | |
| # Use profile data and feed into gcc, correct for threading counter noise, serial make is important to not confuse the pgo generator | |
| env CXXFLAGS='-march=native -fprofile-dir=/data/pgo -fprofile-use=/data/pgo -fprofile-correction' cmake .. -DCMAKE_BUILD_TYPE=Release | |
| make -j 1 |
Transcoding FLAC music to Opus:
ffmpeg is a highly useful application for converting music and videos. However, audio transcoding is limited to a a single core. If you have a large FLAC archive and you wanted to compress it into the efficient Opus codec, it would take forever with the fastest processor to complete, unless you were to take advantage of all cores in your CPU.
parallel 'ffmpeg -v 0 -i "{}" -c:a libopus -b:a 128k "{.}.opus"' ::: $(find -type f -name '*.flac')
Transcoding Videos to VP9:
This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.
Create keyfile:
dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkeyNote that packages often have a series of optdepends - optional dependencies - which are packages that provide additional functionality to the application, albeit not strictly required for running it. When installing a package, pacman will list its optional dependencies among the output messages, but they will not be found in pacman.log: use the pacman -Si (see Querying package databases) command to view the optional dependencies of a package, together with short descriptions of their functionality.
To install a single package or list of packages (including dependencies), issue the following command:
I use dotfiles to personalize *nix type of machines. But I'm new to personalizing Windows 10. So I'm collecting information here first before adding these to the dotfiles. I'm not sure if these will ever move to dotfiles though.
| # return code is either 0 (success) or 1 (fail), so you can use it straight-up in logical statements | |
| coinflip() { return $(($RANDOM%2)); } | |
| coinflip && echo "heads" || echo "tails" |
Hello. I've decided to share a lot more of my knowledge in public forums from now on, and to not divert any of my focus away from improving the world in a way that stays written in history.
This Gist is about discussing on how to improve AV1 decoding performance on 2 fronts: improving performance through more efficient decoding, and through decoding aware encoding.
Here are many tips on how to improve decoding performance on any machine: