Skip to content

Instantly share code, notes, and snippets.

View misuzu's full-sized avatar

misuzu

  • Kharkiv, Ukraine
  • 22:13 (UTC +03:00)
View GitHub Profile
@InternetUnexplorer
InternetUnexplorer / command-not-found.sh
Last active March 17, 2024 11:53
Improved home-manager nix-locate configuration, with an auto-updated index and a better command-not-found handler
# Adapted from https://github.com/bennofs/nix-index/blob/master/command-not-found.sh
command_not_found_handle () {
if [ -n "${MC_SID-}" ] || ! [ -t 1 ]; then
>&2 echo "$1: command not found"
return 127
fi
echo -n "searching nix-index..."
ATTRS=$(@nix-locate@ --minimal --no-group --type x --type s --top-level --whole-name --at-root "/bin/$1")
@akihikodaki
akihikodaki / README.en.md
Last active April 20, 2024 02:43
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@dankor
dankor / README.md
Last active April 2, 2024 14:30
Як отримувати гроші з Upwork через свого ФОПа

Як отримувати гроші з Upwork через свого ФОПа

Це коротка інструкція про те, як бути білим фрілансером. Почав писати для себе, бо не все знайшов в інтернеті. І вирішив, що це корисно всім, хто працює на біржі Upwork і хоче розібратися як легально там заробляти. Тут є офіційна стаття, яку я вирішив доповнити конкретним своїм прикладом.

Що для цього потрібно?

  • Мати відкритого фопа з відповідними кведами
  • Мати відкритий фопівський гривневий і доларовий рахунки

ФОП

Про відкриття фопа і його облікування не буду розписувати. Якщо у вас фопа немає, то краще звернутися до консалтингових компаній, які на цьому спеціалізуються. Єдине, на чому я хотів би зупинитися, це кведи. Бажано, щоб вони збігалися з послугами, які ви надаватимете. Наприклад, «Software Development» відповідає найкраще «62.01 Комп'ютерне програмування». Якщо у вас інші, то пошукайте те, чому найбільше відповідаєт

{ runCommand, patchelf, coreutils, binutils-unwrapped, find-libs }:
targetPrefix: inputPackage:
runCommand (inputPackage.pname + "-portable") {
inherit inputPackage targetPrefix;
} ''
set -euo pipefail
cp -a "$inputPackage" "$out"
@glittershark
glittershark / orjson.nix
Created March 28, 2020 18:46
Horrible, hacky packaging of orjson with Nix
{ fetchFromGitHub
, python
, maturin
, arrow
, dataclasses
, numpy
, pendulum
, psutil
, pytest
, pytz
@lheckemann
lheckemann / 0-nixos-tmpfs.md
Last active July 11, 2023 11:58
NixOS: switch-root to tmpfs

Build a NixOS config, copy it to a tmpfs, and enter it, shutting the running userspace (but not the kernel) down. This can be useful e.g. for repartitioning the system or switching it to a new zfs pool, without the need for extra installation media, and is a little faster than most other volatile system methods (e.g. kexec, classic USB or CD installer), since the store is in RAM and uncompressed right from the get-go. It also copies the SSH host keys from the building system to maintain the chain of trust in a remote system.

@tbutts
tbutts / tmux-migrate-options.py
Last active February 29, 2024 08:11
For tmux configs: Merge deprecated/removed -fg, -bg, and -attr options into the -style option
#!/usr/bin/env python
# vim: set fileencoding=utf-8
#
# USAGE:
# Back up your tmux old config, run the script and redirect stdout to your conf
# file. Example:
#
# $ cp ~/.tmux.conf ~/.tmux.conf.orig
# $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf
#
#!/bin/bash
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
then
echo "Usage:"