Skip to content

Instantly share code, notes, and snippets.

View mister-good-deal's full-sized avatar

Romain Laneuville mister-good-deal

View GitHub Profile
@mister-good-deal
mister-good-deal / GmockTest.cpp
Created May 2, 2024 07:08
Testing GMock mock methods injection
#include <gmock/gmock.h>
#include <gtest/gtest.h>
class MyClass {
public:
virtual ~MyClass() = default;
virtual void methodA() {
std::cout << "Base MyClass::methodA called\n"; // Confirming methodA execution
methodB();
@mister-good-deal
mister-good-deal / run_portainer_ee_on_nas.sh
Last active December 30, 2023 16:58
Run portainer ee instance on Synology NAS
docker run -p 8010:8010 -p 9000:9000 -p 9443:9443 --detach --name=portainer --restart=always --pull=always -v /var/run/docker.sock:/var/run/docker.sock -v /volume1/docker/portainer:/data portainer/portainer-ee:latest
@mister-good-deal
mister-good-deal / project-code-stats.md
Last active June 11, 2019 12:58
Project code statistics

CLOC

sudo apt install cloc

exemple

cloc project-root-dir --exclude-dir=.idea,build,cmake-build-debug,any-external-lib

@mister-good-deal
mister-good-deal / ubuntu_18.04_startup.sh
Last active October 25, 2019 10:20
Ubuntu 18.04 reinstall
# Dist updates / upgrade
sudo apt update -y
sudo apt upgrade -y
# Sublime Text and CUDA apt channels
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
@mister-good-deal
mister-good-deal / localhost-ssl-conf.md
Last active September 14, 2022 09:49
Add localhost SSL certificate on ubuntu for Apache

Localhost SSL config tuto

cd /etc/ssl

Create localhost CA authority

sudo openssl genrsa -des3 -out private/localhost-CA.key 2048

sudo openssl req -x509 -new -nodes -key private/localhost-CA.key -sha256 -days 1825 -out certs/localhost-CA.pem

@mister-good-deal
mister-good-deal / qt_git_compile.md
Last active April 8, 2019 11:48
Helper commands to compile git from source

GIT

repo: git://code.qt.io/qt/qt5.git

submodules: sudo git submodule foreach git [command]

clean directory: git clean -fdX

Compilation

git init
git remote add -f origin <url_github>
git config core.sparseCheckout true
echo "dir1/dir2/dir3" >> .git/info/sparse-checkout
git pull origin master
cd {PATH}
git init
git commit -m 'I fucked you' --allow-empty
git remote add origin {url}
git push --force --set-upstream origin master
@mister-good-deal
mister-good-deal / disable_foreign_key.sql
Created June 12, 2015 12:35
Disable foreign key MySQL ennoying constraints
SET FOREIGN_KEY_CHECKS = 0;