Skip to content

Instantly share code, notes, and snippets.

View rszamszur's full-sized avatar
✌️
Live like there’s no tomorrow.

Radosław Szamszur rszamszur

✌️
Live like there’s no tomorrow.
  • Here, Now.
  • 08:32 (UTC +02:00)
View GitHub Profile
@r2r-dev
r2r-dev / .bazelrc
Last active March 6, 2024 16:01
java_starlark_repl
build --noenable_bzlmod --java_runtime_version=remotejdk_11
@r2r-dev
r2r-dev / HOWTO.md
Last active April 5, 2022 16:07
quick and dirty lazy /nix/store

Create a lazy /nix/store filesystem using nixfs.py

  1. Grab static nix from https://hydra.nixos.org/build/170454219/download/1/nix and place in the same dir as py script
  2. Install fusepy (on nix: nix-shell -p python3Packages.fusepy)
  3. Ensure your /etc/fuse.conf contains user_allow_other
  4. Create workdirs: mkdir -p $(pwd)/{fakenix,workdir} && mkdir -p $(pwd)/fakenix/nix/store
  5. Mount our fs: python nixfs.py $(pwd)/fakenix $(pwd)/workdir
  6. Run some container image with workdir mounted: docker run -v $(pwd)/workdir/nix:/nix ubuntu:latest
  7. Try running some command, for example: /nix/store/pqpa3glx3iqd0cavslmr0lfkzgq1iias-cowsay-3.03+dfsg2/bin/cowsay thefuck?

@GuillaumeDesforges
GuillaumeDesforges / nixos_python_patch_venv_bins.md
Last active April 21, 2025 03:30
How to: make Python dependencies installed via pip work on NixOS

EDIT: check out fix-python instead, make Python run "as usual" on NixOS!

How to: make Python dependencies installed via pip work on NixOS

The issue

  • You are using NixOS
  • You start working on a Python project
  • You manage the dependencies in a classic Python virtual environment using pip or poetry
@r2r-dev
r2r-dev / bash-anywhere.sh
Last active March 18, 2022 07:19
Bring your own shell together with your script. Stop giving a damn about {zsh, ksh, csh, ash, dash, fish} compatibility and focus on the actual work.
#!/bin/sh -
if [ "$1" != "--wrapped" ]; then
echo "[uw] start"
WD="$(mktemp -d)"
echo "[uw] download deps"
curl -L -s https://github.com/robxu9/bash-static/releases/download/5.1.016-1.2.2/bash-linux-x86_64 \
-o "${WD}/bsh" && chmod +x "${WD}/bsh"
curl -L -s http://landley.net/toybox/downloads/binaries/0.8.6/toybox-x86_64 \
@r2r-dev
r2r-dev / bigquery
Last active May 12, 2022 22:12
query github api for metadata and project structure for given list of repositories. output results as csv, remove repository copies and preview results using fzf
SELECT
files.repo_name
FROM (
SELECT
DISTINCT path,
repo_name,
id
FROM
`bigquery-public-data.github_repos.files`
WHERE
@jonlabelle
jonlabelle / compare_versions.sh
Last active October 6, 2023 19:02
Compare Semver Versions in Bash
#!/usr/bin/env bash
#
# Performs a simple semver comparison of the two arguments.
#
# Original: https://github.com/mritd/shell_scripts/blob/master/version.sh
# Snippet: https://jonlabelle.com/snippets/view/shell/compare-semver-versions-in-bash
# Gist: https://gist.github.com/jonlabelle/6691d740f404b9736116c22195a8d706
#
@cyrenity
cyrenity / k8s-using-talos-in-vms.md
Last active May 7, 2025 17:41
Setup kubernetes cluster using Talos (Lab)

Setup Kubernetes cluster in minutes using Talos

1. Get talosctl

Download and install talosctl binary

wget https://github.com/talos-systems/talos/releases/download/v0.8.1/talosctl-linux-amd64
@se79419ed
se79419ed / glassdoor.txt
Created January 7, 2021 15:39
bookmarklet to remove hardsell overlay from glassdoor.com
javascript:(function(){
document.getElementsByClassName('hardsellOverlay')[0].remove();
document.getElementsByTagName("body")[0].style.overflow = "scroll";
let style = document.createElement('style');
style.innerHTML = `
#LoginModal {
display: none!important;
}
`;
document.head.appendChild(style);
@adisbladis
adisbladis / podman-shell.nix
Last active May 10, 2025 16:27
Use podman within a nix-shell
{ pkgs ? import <nixpkgs> {} }:
let
# To use this shell.nix on NixOS your user needs to be configured as such:
# users.extraUsers.adisbladis = {
# subUidRanges = [{ startUid = 100000; count = 65536; }];
# subGidRanges = [{ startGid = 100000; count = 65536; }];
# };
@CMCDragonkai
CMCDragonkai / nix_inputs.md
Last active May 15, 2025 12:59
Understanding Nix Inputs #nix

Understanding Nix Inputs

Every Nix derivation produces a Nix store output that has 3 things:

  • Executables
  • Libraries
  • Data

Executables are always exported using the PATH environment variable. This is pretty much automatic.