Skip to content

Instantly share code, notes, and snippets.

View yorgabr's full-sized avatar

Márcio Siqueira yorgabr

View GitHub Profile
@yorgabr
yorgabr / ensure_clean_venv_here.sh
Last active December 2, 2025 12:53
Recreate a clean, non-relocatable-safe Python venv for the current project and fix common issues (broken shebangs, symlinked python, missing pip). Also *optionally* configures CNTLM proxy for pip during this run.
#!/usr/bin/env bash
# ----------------------------------------------------------------------------
# ensure_clean_venv_here.sh
# Recreate a clean, non-relocatable-safe Python venv for the current project
# and fix common issues (broken shebangs, symlinked python, missing pip).
# Also optionally configures CNTLM proxy for pip during this run.
#
# Copyright (c) 2025 [Yorga Babuscan](yorgabr@gmail.com)
#
# License: GNU General Public License v3.0 or later (GPL-3.0+)
@yorgabr
yorgabr / fastest_cygwin_mirror.ps1
Last active December 12, 2017 17:48
Use this small script to come across the fastest Cygwin Setup mirror for your location.
function purge-any-pending-job {Get-Job | Remove-Job}
$measure_mirror_latency = {
Param([string] $argument)
$mirror_url = ($argument -split ";")[0]
$sum_url = "$($mirror_url)x86_64/sha512.sum"
$req = [System.Net.WebRequest]::Create($sum_url)
$req.Timeout = 2000
try {
$dur = (Measure-Command {