Skip to content

Instantly share code, notes, and snippets.

View greenrobot's full-sized avatar

Markus Junginger greenrobot

View GitHub Profile
@greenrobot
greenrobot / gcc-for-nvidia-install.sh
Created June 18, 2021 12:07
NVIDIA driver problems: install/update script expects gcc but system's default is clang
update-alternatives --set cc /usr/bin/gcc
update-alternatives --set c++ /usr/bin/g++
cc --version
c++ --version
apt install nvidia-driver-460
update-alternatives --set cc /usr/bin/clang
update-alternatives --set c++ /usr/bin/clang++
cc --version
@greenrobot
greenrobot / CBoxTest_box_relations.cpp
Created January 12, 2022 08:00
Example of how to put, query and remove many-to-many database relations using ObjectBox C API
TEST_CASE("C-Box-relations", "") {
CTestEnv env;
env.enableManyEntity();
obx_schema_id test_id = obx_store_entity_id(env.store(), "TestEntityCpp");
obx_id ta_id = env.putTestEntity(0, "ta");
obx_id tb_id = env.putTestEntity(0, "tb");
obx_id tc_id = env.putTestEntity(0, "tc");
pactl load-module module-loopback latency_msec=1000
#switch off:
#pactl unload-module module-loopback
@greenrobot
greenrobot / hibernate.sh
Created November 10, 2022 08:13
Hibernate Linux (Ubuntu 22.04) with freeing caches before
#!/bin/bash
free -h
echo "Pruning caches..."
sync
echo 3 | sudo tee /proc/sys/vm/drop_caches
free -h
echo "Hibernating..."
sudo systemctl hibernate