Skip to content

Instantly share code, notes, and snippets.

Fetch only a known branch

git fetch --depth=5 origin feature/BSD-745-db-simulation

Switch-rename existing branch

git switch feature/BSD-745-db-simulation
git switch -c BSD-745 --track origin/feature/BSD-745-db-simulation

Branch from current

git checkout -b feature/BSD-713

To make Pageant automatically run and load keys at startup:
- Find the location of pageant.exe
- Windows key + R to open the 'run' dialog box
- Type: 'shell:startup' in the dialog box
- Create a shortcut to the pageant.exe and put into this startup folder.

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <[email protected]>
" Last change: 2008 Jul 02
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
@akochepasov
akochepasov / cuda_debug_symbols.txt
Created May 22, 2024 05:13
Install symbols for CUDA (obfuscated)
readelf -n /usr/local/cuda/lib64/libcudart.so
# ... Build ID: 70f26eb93e24216ffc0e93ccd8da31612d277030
# Open https://cudatoolkit-symbols.nvidia.com/libcudart.so/70f26eb93e24216ffc0e93ccd8da31612d277030/index.html to find out a filename
wget https://cudatoolkit-symbols.nvidia.com/libcudart.so/70f26eb93e24216ffc0e93ccd8da31612d277030/libcudart.so.12.2.128.sym
eu-unstrip /usr/local/cuda-12.2/targets/x86_64-linux/lib/libcudart.so.12.2.128 libcudart.so.12.2.128.sym –o /usr/local/cuda-12.2/targets/x86_64-linux/lib/libcudart.so.12.2.128
# Or deploy as symbol file
cp libcudart.so.12.2.128.sym /usr/lib/debug/.build-id/70/f26eb93e24216ffc0e93ccd8da31612d277030.debug
@akochepasov
akochepasov / perf_flamegraph.txt
Last active May 22, 2024 05:15
Run perf, make flamegraph
# https://www.brendangregg.com/perf.html
/usr/local/bin/perf record -g -e cpu-clock -F 99 <bin_file>
/usr/local/bin/perf script | stackcollapse-perf.pl | flamegraph.pl > mm_flame.svg
@akochepasov
akochepasov / docker_commands.md
Last active February 26, 2025 18:37
Docker commands

List docker containers running

docker ps docker container ls # same

Attach to a working container (Name555 is NAME)

docker exec -it Name555 bash

Create a docker image

docker build -t Tag123:v2 . # Uses local Dockerfile docker build -f Dockerfile22 -t Tag123:v2 .

@akochepasov
akochepasov / chrono.cpp
Created November 21, 2024 18:39
Working with c++ std::chrono
#include <cstdlib>
#include <iostream>
#include <chrono>
using std::chrono::steady_clock;
using std::chrono::system_clock;
constexpr inline std::chrono::seconds timeout1 =
std::chrono::seconds(60 * 60);
constexpr inline std::chrono::minutes timeout2 =
@akochepasov
akochepasov / cmake.sh
Created November 21, 2024 18:41
cmake common command lines
# Configure
cmake -Bbuild/release -DCMAKE_BUILD_TYPE=RelWithDebInfo -GNinja -S.
# Build
cmake --build build/release --target program_exe
# Test
ctest --verbose --test-dir build/release/
@akochepasov
akochepasov / deb_commands.txt
Created February 13, 2025 16:59
debian packages
dpkg-deb -R the_package.deb tmp
apt install the_package.deb
apt remove the_package.deb