Skip to content

Instantly share code, notes, and snippets.

View cfbastarz's full-sized avatar
🌎

Carlos Frederico Bastarz cfbastarz

🌎
View GitHub Profile
@cfbastarz
cfbastarz / gist:25d97773cd2d75cd43a26e53fbf329d3
Created January 2, 2026 19:36
Compilção MPAS stochastic physics
# Code checkout
git clone --recursive https://github.com/dtcenter/MPAS-Model.git
cd MPAS-Model
git checkout remotes/origin/gsl/MPAS_stoch_physics
cd src/core_atmosphere
rm -rf stochastic_physics
@cfbastarz
cfbastarz / gist:4ae2533e727e941dc7c64fcdf904fac1
Last active August 21, 2024 17:32
Publish a complex package to PyPi

Publish a Complex Package to PyPi

By a complex package, I mean a package with pure Python code as well as code in other languages like C, Fortran, etc.

Note: I am assuming that your setup.py already works, and I will show you how to create a manylinux Python wheel. You will need Docker for this.

The manylinux Wheel 🛞

To create a distribution of your Python package with statically linked libraries (i.e., a self-contained package), you need to use a Linux distribution that provides all necessary dependencies. This is where manylinux comes in handy.

@cfbastarz
cfbastarz / gist:ea3a57c367e73caf9e12db3ec2106d33
Last active August 21, 2024 17:34
Publish a simple package to PyPi

Publish a Simple Package to PyPi

A guide on how to publish a simple package (i.e., pure Python) to PyPi.

Set Up Your ~/.pypirc

First, set up your ~/.pypirc to make things a little easier:

[distutils]
@cfbastarz
cfbastarz / setrecanlANLSMT.TQ0126L042.2020090100.Linux
Created November 30, 2023 21:02
Script de submissão para processo recanl do oensMB09 na egeon
#! /bin/bash -x
#SBATCH --output=/mnt/beegfs/carlos.bastarz/oensMB09/recanl/output/setrecanlANLSMT.TQ0126L042.2020090100.Linux.23112411:33.out
#SBATCH --error=/mnt/beegfs/carlos.bastarz/oensMB09/recanl/output/setrecanlANLSMT.TQ0126L042.2020090100.Linux.23112411:33.err
#SBATCH --time=00:30:00
#SBATCH --tasks-per-node=1
#SBATCH --nodes=1
#SBATCH --job-name=RECANL
#SBATCH --partition=PESQ1
@cfbastarz
cfbastarz / setnmc1modg.TQ0126L042.2020052600.headnode
Created November 28, 2023 16:07
Script de submissão para o BAM na egeon
#! /bin/bash -x
#SBATCH --output=/mnt/beegfs/carlos.bastarz/oensMB09/model/exec_SMT2020052600.NMC/setout/Out.model.2020052600.MPI64.out
#SBATCH --error=/mnt/beegfs/carlos.bastarz/oensMB09/model/exec_SMT2020052600.NMC/setout/Out.model.2020052600.MPI64.err
#SBATCH --time=04:00:00
#SBATCH --tasks-per-node=64
#SBATCH --nodes=1
#SBATCH --job-name=BAMNMC
#SBATCH --partition=PESQ1
@cfbastarz
cfbastarz / gist:2c00f9f6373d3ade7ce8ec890bd1c302
Created November 16, 2023 19:24
Switch KDE Akonadi from MySQL to PostGRES
akonadi stop
sudo apt-get install akonadi-server akonadi-backend-postgresql
cd $HOME/.config/akonadi/
cp akonadiserverrc akonadiserverrc.bak
cat << EOF > $HOME/.config/akonadi/akonadiserverrc
[Debug]
Tracer=null
[%General]
Driver=QPSQL
@cfbastarz
cfbastarz / gist:2183bb74f1003150e82830b7eaa353f4
Created October 4, 2023 11:51
Extract audio to mp3 from mkv video file
ffmpeg -i "2023-10-02 13-42-57.mkv" -vn -c:a libmp3lame -y "2023-10-02 13-42-57.mp3"
@cfbastarz
cfbastarz / gist:a1b926784b91adcc02f4605210c533ea
Created September 6, 2023 12:46
Create a pdf file (chop, rotate and convert png to pdf)
# Chop the figures (in my case, figures were in landscape mode)
for i in $(ls *.png); do j=$(echo $i | sed "s,.png,-chop.png,g"); convert $i -gravity South -chop 0x10 -gravity North -chop 0x50 -gravity East -chop 296x0 -gravity West -chop 296x0 $j; done
# Rotate the figures 90 degrees (clockwise)
for i in $(ls *-chop.png); do j=$(echo $i | sed "s,-chop.png,-chop-rot90.png,g"); convert $i -rotate 90 $j; done
# Convert all figures to PDF
for i in $(ls *-chop-rot90.png); do j=$(echo $i | sed "s,-chop-rot90.png,.pdf,g"); convert $i $j; done
# Unite all PDF (21) files into one
@cfbastarz
cfbastarz / cria_links_icn-fct.sh
Last active June 16, 2023 17:42
Script para lincar arquivos de análise como se fossem previsões
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
# In Catalina, do as follows:
# Plug the external display
# sudo mkdir -p /Library/Displays/Contents/Resources/Overrides
# cd /Library/Displays/Contents/Resources/Overrides
# sudo curl -O this_script.rb
# sudo ./this_script.rb