Skip to content

Instantly share code, notes, and snippets.

View betolink's full-sized avatar

Luis López betolink

View GitHub Profile
@s-kganz
s-kganz / profile_earthaccess.py
Created May 16, 2025 23:01
Script to recreate open_rasterio leak on HLSL30 granules
import xarray as xr
import rasterio
import rioxarray
import gc
import earthaccess
assert(earthaccess.login(strategy="netrc").authenticated)
# Find a granule, load it into memory, take mean, call gc
gdal_config = {
@rauchg
rauchg / p.sh
Last active May 16, 2025 18:09
Perplexity CLI in pure shell
#!/usr/bin/env bash
function p() {
jq -n \
--arg content "$*" \
'{
"model": "pplx-7b-online",
"messages": [
{
"role": "system",
"content": "Be precise and concise."
@ajelenak
ajelenak / h5stat-extra.py
Last active September 23, 2024 20:43
Additional HDF5 dataset chunk statistics
import argparse
import json
import operator
from collections import defaultdict
from dataclasses import dataclass
from functools import partial, reduce
import os
from typing import Any, Union
from configparser import ConfigParser
from pathlib import Path
@MarcSkovMadsen
MarcSkovMadsen / hvplot_interactive.py
Last active January 3, 2023 20:12
Example of using hvPlot .interactive with Panel
import pandas as pd
import hvplot.pandas
import panel as pn
pn.extension(sizing_mode="stretch_width")
PALETTE = [
"#ff6f69",
"#ffcc5c",
"#88d8b0",
@the-spyke
the-spyke / pipewire.md
Last active June 20, 2025 14:54
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@aleixmorgadas
aleixmorgadas / 1. Fallacies.md
Last active October 2, 2021 04:53
Distributed Systems Fundamentals Questions

Fallacy #1. The network is reliable

  • Why the pattern Client-Response might cause some troubles?
  • What are distributed objects?
  • How we can solve this problem?

Fallacy #2. Latency isn't a problem

  • How many calls do you do between services before replying a syncronous call to the end user?
  • Which pattern is more common in your application? Remote calls or messages?
@wolfv
wolfv / github_actions.yaml
Last active December 20, 2024 02:31
micromamba usage
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
@ajelenak
ajelenak / h5-to-zarr.py
Last active March 29, 2025 23:01
Python code to extract HDF5 chunk locations and add them to Zarr metadata.
# Requirements:
# HDF5 library version 1.10.5 or later
# h5py version 3.0 or later
# pip install git+https://github.com/HDFGroup/zarr-python.git@hdf5
import logging
from urllib.parse import urlparse, urlunparse
import numpy as np
import h5py
import zarr
@pdp7
pdp7 / BeagleBone: sharing Internet connection from Linux laptop with USB.md
Last active March 31, 2025 03:25
BeagleBone: sharing Internet connection from Linux laptop with USB

WARNING: interfaces can enumarate differently:

ufw status
#iptables -F
#iptables --table nat --append POSTROUTING --out-interface wlxe0b94db737c9 -j MASQUERADE
#iptables --table nat --append POSTROUTING --out-interface enp0s20u1u1 -j MASQUERADE
iptables --table nat --append POSTROUTING --out-interface enp0s20u1u2 -j MASQUERADE
#iptables --append FORWARD --in-interface enx1cba8c9bbeb5 -j ACCEPT
#iptables --append FORWARD --in-interface enx9884e391a556 -j ACCEPT
iptables --append FORWARD --in-interface enx9884e391a559 -j ACCEPT
Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
Environment :: Console
Environment :: Console :: Curses
Environment :: Console :: Framebuffer