Skip to content

Instantly share code, notes, and snippets.

@jborbely
jborbely / build-openssl.bat
Created November 6, 2024 21:08
Build OpenSSL from source on Windows
@echo off
set OPENSSL_VERSION=3.4.0
REM Dependencies
REM * MSVC build tools (https://visualstudio.microsoft.com/vs/community/)
REM > winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.Windows10SDK.20348"
REM * git (https://git-scm.com/downloads/win)
REM > winget install Git.Git
REM * perl (https://strawberryperl.com/)
@jborbely
jborbely / install_pipx.sh
Created August 16, 2024 22:47
Install pipx to ~/.local/bin
#!/bin/bash
set -e
pipx_dir="${HOME}/.local/bin"
mkdir -p $pipx_dir
echo "#!/bin/bash
if [[ \"\$1\" == \"-U\" ]]; then
echo \"Fetching latest pipx tag from GitHub\"
@jborbely
jborbely / install_pipx.bat
Created July 1, 2024 23:50
Install `pipx` to the %LOCALAPPDATA%\Programs\Python\Launcher directory
@echo off
setlocal EnableDelayedExpansion
set pipx_dir=!LOCALAPPDATA!\Programs\Python\Launcher
echo.
if not exist "!pipx_dir!\NUL" mkdir "!pipx_dir!" 2>nul
(echo.@echo off
echo.if "%%1" == "-U" (
echo. setlocal enabledelayedexpansion
@jborbely
jborbely / viasala_hmp110.py
Created March 8, 2023 21:01
Read the data registers of a Vaisala HMP110 probe
import struct
# pip install pymodbus[serial]
from pymodbus.client import ModbusSerialClient
from pymodbus.exceptions import ModbusIOException
def read_holding_registers():
def unpack(r, i):
a, b = r.registers[i-1:i+1]
@jborbely
jborbely / gaussian_blur_movie.py
Created March 11, 2019 08:31
interacting with ImageJ from Python
"""
Creates a movie of an image that starts off blurry and gradually comes into focus.
"""
from msl.loadlib import LoadLibrary
jar = LoadLibrary('ij.jar')
ij = jar.lib.ij
def make_movie(url=None, start_sigma=30, nframes=100, fps=24):
@jborbely
jborbely / dump_objects.py
Last active April 28, 2025 22:03
Dump a Sphinx objects.inv file to a human-readable file.
"""Dump a Sphinx objects.inv file to a human-readable file.
Examples:
Local file
dump("/path/to/objects.inv")
Python
dump("https://docs.python.org/3")
Numpy