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.
  • 09:52 (UTC +02:00)
View GitHub Profile
@rszamszur
rszamszur / rc.lua
Last active December 13, 2022 13:36
Tyr host custom rc.lua
-- If LuaRocks is installed, make sure that packages installed through it are
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
pcall(require, "luarocks.loader")
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
@rszamszur
rszamszur / k8s-using-talos-in-vms.md
Created May 24, 2022 11:55 — forked from cyrenity/k8s-using-talos-in-vms.md
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
@rszamszur
rszamszur / compare_versions.sh
Created April 5, 2022 17:49 — forked from jonlabelle/compare_versions.sh
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
#
@rszamszur
rszamszur / nixos_python_patch_venv_bins.md
Created April 5, 2022 15:51 — forked from GuillaumeDesforges/nixos_python_patch_venv_bins.md
How to: make Python dependencies installed via pip work 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

You won't be able to import some of those libraries.

@rszamszur
rszamszur / HOWTO.md
Created April 5, 2022 14:21 — forked from r2r-dev/HOWTO.md
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?

@rszamszur
rszamszur / README.md
Created March 26, 2022 22:08 — forked from sans-serif/README.md
[Awesome WM] Random, unique Wallpaper for every tag

Random, unique Wallpaper for every tag in awesome wm

Awesome version >= 3.5

About

This is a way to get a random and unique wallpaper for every tag (or rather the last selected tab, since multiple tags can be selected) in the awesome window manager. The wallpapers are selected randomly from a provided path (which should only contain suitable pictures) and the algorithm guarantees a unique wallpaper for every tag.

Where to place

In the config file for awesome wm, which should be located at

@rszamszur
rszamszur / bash-anywhere.sh
Created March 17, 2022 20:44 — forked from r2r-dev/bash-anywhere.sh
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 \
@rszamszur
rszamszur / copy.js
Last active October 3, 2021 14:22
Recursive shallow copy
function recursiveShallowCopy(target, source) {
const isObject = (obj) => obj && typeof obj === 'object';
if (!isObject(target) || !isObject(source)) {
return source;
}
for (const [key, value] of Object.entries(source)) {
if (Array.isArray(value)) {
target[key] = recursiveShallowCopy([], value)
} else if (isObject(value)) {
@rszamszur
rszamszur / glassdoor.js
Last active February 2, 2023 04:09 — forked from se79419ed/glassdoor.txt
remove hardsell overlay from glassdoor.com
// By the time you will be using this, there is a high probability that glassdoor will change selectors
// or even implementation of hardsell overlay.
// Usage: Copy and paste in console, or use some extension to do it for you, for example:
// https://chrome.google.com/webstore/detail/user-javascript-and-css/nbhcbdghjpllgmfilhnhkllmkecfmpld?hl=en
function remove(){
document.getElementById('ContentWallHardsell').remove();
document.getElementsByTagName("body")[0].style.overflow = "scroll";
let style = document.createElement('style');
style.innerHTML = `
#LoginModal {
@rszamszur
rszamszur / backup_remarkable.sh
Created August 29, 2021 18:13
Backup reMarkable content
#!/usr/bin/env bash
if [ -n "$DEBUG" ]; then
set -x
fi
set -o errexit
set -o nounset
set -o pipefail