Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / conda_update_all_envs.sh
Last active November 10, 2025 08:50
Update all conda enviroment, optionally using another executable like mamba and dry run option setting from cli.
# define CONDACOMMAND externally to overwrite this, I use conda or mamba
# default is to use mamba, a looooot faster
CONDACOMMAND=${1:-'mamba'}
# DRYRUNCONDACOMMAND : is set to anything, just print the commands
if [ -z $DRYRUNCONDACOMMAND ]
then
echo "DRYRUNCONDACOMMAND is unset, this is the real stuff"
DRYRUNCONDACOMMAND=''
else
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active October 5, 2025 16:50
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

# from : 10 terminal commands to speed up your Mac | defaults-write.com
# https://www.defaults-write.com/10-terminal-commands-to-speed-up-macos-sierra-on-your-mac/
#1. Disable animations when opening and closing windows.
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
#2. Disable animations when opening a Quick Look window.
defaults write -g QLPanelAnimationDuration -float 0
#3. Accelerated playback when adjusting the window size (Cocoa applications).
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
#4. Disable animation when opening the Info window in Finder (cmd⌘ + i).
defaults write com.apple.finder DisableAllAnimations -bool true
@kidpixo
kidpixo / PostGIS 2.0 Cheatsheet.md
Last active September 2, 2025 09:49
PostGIS 2.0 Cheatsheet
@kidpixo
kidpixo / convert_audio_ffmpeg.py
Last active February 4, 2025 12:35
Python audio compressor using ffmpeg with Opus support for highly efficient speech compression. Supports batch processing, dry runs, and customizable bitrates.
#!/usr/bin/env python
"""
This module provides a command-line tool for compressing audio files using ffmpeg.
It supports various audio formats (Opus, AAC, OGG, MP3), customizable bitrates,
mono/stereo conversion, parallel processing, and dry-run mode. It also handles
input and output directories and provides sensible default settings.
Key features:
@kidpixo
kidpixo / crypted_backup_usb.sh
Last active June 7, 2024 10:21
Script to create and handle rsync backup on crypted external usb as LVM on LUKS
#!/bin/bash
backup_check_disk() {
########################################################################
# Function to check the current external disk
#
# This function iterates over a list of paths of possible external disks
# and checks if each path exists. It returns the basename of the first
# path that exists.
#
# Returns:
#------------------------------------------------
# Name : yt-streamer
# Input : youtube URL
# Purpose : stream url video from youtube to mpv. see:
# https://github.com/ytdl-org/yt-dlp/issues/2124#issuecomment-32429104
# Dependencies : yt-dlp, mpv
#------------------------------------------------
yt-streamer() {
# add help option == print and exit
if [[ "$1" == "-h" ]] || [[ -z "$1" ]]
@kidpixo
kidpixo / crypted_backup_usb.sh
Created April 11, 2024 10:11
function to mount and decrpyt one of the USB disks in a list
#!/bin/bash
check_backup_disk() {
local -a EXTERNAL_DISK_PATHS=(
"/dev/disk/by-id/usb-SOME_EXTERNAL_USB_XXXXXXXXXXXXXXX-0:0"
"/dev/disk/by-id/usb-SOME_External_USB_3.0_XXXXXXXXXXXXXX-0:0"
)
CURRENT_DISK=""
for path in "${EXTERNAL_DISK_PATHS[@]}"; do
if [[ -e "$path" ]]; then
@kidpixo
kidpixo / check_kernel_version.py
Created January 15, 2024 09:32
python script for Arch based distro : check loaded kernel, pacman latest kernel and show in color if they the same (green) or different (red).
#!/usr/bin/env python3
import subprocess
import re
PACMAN_KERNEL_VERSION = subprocess.getoutput("pacman -Qi linux | sed -n -e '/Version/p'").split(':')[1].strip().split('.')
RUNNING_KERNEL_VERSION = subprocess.getoutput("uname -a") .split(' ')[2].strip().split('.')
if len(RUNNING_KERNEL_VERSION) != 4:
tmp=re.split(r'-', RUNNING_KERNEL_VERSION[-1],1)
RUNNING_KERNEL_VERSION[-1] = tmp[0]