Skip to content

Instantly share code, notes, and snippets.

@ald2004
ald2004 / static_inline_example.md
Created July 18, 2022 08:13 — forked from htfy96/static_inline_example.md
static inline vs inline vs static in C++

In this article we compared different behavior of static, inline and static inline free functions in compiled binary. All the following test was done under g++ 7.1.1 on Linux amd64, ELF64.

Test sources

header.hpp

#pragma once

inline int only_inline() { return 42; }
static int only_static() { return 42; }
@ald2004
ald2004 / cool_gpu2.sh
Created July 5, 2022 08:12 — forked from squadbox/cool_gpu2.sh
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
#!/bin/bash
# cool_gpu2.sh This script will enable or disable fixed gpu fan speed
#
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <akohlmey@gmail.com>
# https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness
#
# Modified for newer drivers and removed old work-arounds
@ald2004
ald2004 / instructions.txt
Created July 1, 2022 05:42 — forked from m-ou-se/instructions.txt
Compiling a cross compiler for armv7l-unknown-linux-gnueabihf (RPi3)
wget http://ftp.snt.utwente.nl/pub/software/gnu/binutils/binutils-2.29.tar.xz
wget ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-7.2.0/gcc-7.2.0.tar.xz
wget http://ftp.gnu.org/gnu/glibc/glibc-2.26.tar.xz
tar xvf binutils-2.29.tar.xz
tar xvf gcc-7.2.0.tar.xz
cd binutils-2.29
./configure --target=armv7l-unknown-linux-gnueabihf --disable-multilib
make -j9
sudo make install
cd ..
@ald2004
ald2004 / buildcrossgcc.sh
Created July 1, 2022 05:42 — forked from rikka0w0/buildcrossgcc.sh
Build gcc cross-compiler for armv7l (arm-linux-gnueabi)
#!/bin/sh
mkdir ~/tmp
cd ~/tmp
# See
# Typical ARM triples (see "armv7l-linux-gnueabi")
# https://bgamari.github.io/posts/2019-06-12-arm-terminology.html
# GCC -march options
# https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html