Skip to content

Instantly share code, notes, and snippets.

View joaoantoniocardoso's full-sized avatar
🎯
Focusing

João Antônio Cardoso joaoantoniocardoso

🎯
Focusing
View GitHub Profile
#!/bin/sh -exu
dev=$1
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
}
# RPi1/Zero (armv6h):
@joaoantoniocardoso
joaoantoniocardoso / freecad-build.sh
Created April 24, 2019 16:26
Script to build freecad at arch-linux from git sources without Ship module.
#Defines development directory:
FREECAD_DEV_DIR=~/freecad
CURRENT_DIR=$(pwd)
echo "> Development dir: $FREECAD_DEV_DIR."
echo "> Note that you are at: $CURRENT_DIR."
# Installing needed packages from a package-manager
echo "> Installing needed packages from a package-manager"
yay -S --needed boost-libs curl desktop-file-utils glew hicolor-icon-theme jsoncpp libspnav med opencascade shiboken2 xerces-c pyside2 python-matplotlib python-netcdf4 python-pivy qt5-svg qt5-webkit qt5-webengine boost cmake eigen git gcc-fortran pyside2-tools swig qt5-tools pybind11 python36
@joaoantoniocardoso
joaoantoniocardoso / compiling_OpenFOAM-4.x.md
Last active December 19, 2023 17:00
Compiling OpenFOAM-4.x at 2019 on Linux with ZSH, GCC 9.1

PROBLEM

I was trying to install Helix-OS on my Arch Linux at 2019 with ZSH and GCC 8.1 and because it is quite old it recommends OpenFOAM-4.1.

Naturally, there is no package for older OpenFOAM on AUR, so it need to be built from the sources and of course we have to solve some compatibility issues and here is a collection of fixes found on the internet :)

Get the sources

Note that using the folder names with sufix 4.1 for version 4.1 would help some of the scripts.

mkdir -p $HOME/OpenFOAM

uint8_t machine_clk = 0;
void machine_init(void)
{
TCCR2A = (1 << WGM21) | (0 << WGM20) // Timer 2 in Mode 2 = CTC (clear on compar e)
| (0 << COM2A1) | (0 << COM2A0) // do nothing with OC2A
| (0 << COM2B1) | (0 << COM2B0); // do nothing with OC2B
TCCR2B = (0 << WGM22) // Timer 0 in Mode 2 = CTC (clear on compar e)
| (0 << FOC0A) | (0 << FOC0B) // dont force outputs
| (1 << CS22) // clock enabled, prescaller = 1024
///////////////////////////
//main.c
///////////////////////////
extern void delay(int milli);
extern long long mult(long a, long b);
#define MS_DELAY 1000
int main(void)