Skip to content

Instantly share code, notes, and snippets.

View Kreyren's full-sized avatar
For Free Ukraine and Russia

KREYREN Kreyren

For Free Ukraine and Russia
  • Kralovec, Czech Republic
View GitHub Profile
#!/bin/sh
# apk add blkid parted dosfstools e2fsprogs wget tar
set -eu
: "${DISK:=/dev/sdb}"
#if [ $DISK = "/dev/sdX" ]; then
# echo "DISK is not set correctly"
# exit
#fi
@Kreyren
Kreyren / gist:308b0a4b99ac998192f30da52623162c
Created November 8, 2021 10:31
Scrapped `steam-run-native` from NixOS
λ nix shell nixpkgs#steam-run-native nixpkgs#bashInteractive -c bash
[~]$ cat "$(command -v steam-run)"
#!/nix/store/phqa311klldrcbwid1i22dwnpfc9dnma-bash-5.1-p8/bin/bash
blacklist=(/nix /dev /proc /etc)
ro_mounts=()
symlinks=()
for i in /nix/store/af2jm007nws9xvwwa9vqzri7g0gg3f1s-steam-run-fhs/*; do
path="/${i##*/}"
if [[ $path == '/etc' ]]; then
@Kreyren
Kreyren / gist:c83ec2fa52dc6e001c753643c7c6c1c1
Created October 2, 2020 03:28
Quick PoC script for file content comparison
#!/bin/sh
# shellcheck shell=sh # Written to be POSIX compatible
# Created by Jacob Hrbek identified using a GPG identifier assigned to an electronic mail <kreyren@rixotstudio.cz> according to keyserver <https://keys.openpgp.org/> assuming said keyserver not hijacked
#set -e # Exit on false
###! Quick assertion wrapper
die() { printf 'FATAL: %s\n' "$2"; exit "$1" ;}

Emacs isn't just an editor, it’s an entire Emacs Lisp interpreter and environment. We can use Emacs Lisp not only to extend and customize our beloved editor, but also to write entire programs and applications. Nic Ferrier’s [elnode][] server is the most ambitious Emacs Lisp application of this sort, but we can start at a smaller scale and try to write our shell scripts and tools with Emacs Lisp.

However, it turns out that writing programs in Emacs Lisp is more intricate than it looks at a first glance. Emacs decades-long history as interactive application have left deep marks in Emacs and Emacs Lisp, which make independent

@Kreyren
Kreyren / thing.md
Last active June 27, 2020 23:22
Krey's trying to be smart while being absolutely dumb with tor and proxies~

Problem

Tor is being blocked on some sites which makes it painful to use

Best known solution

User -> ISP(?) -> Tor -> Proxy -> Internet

This makes the tor traffic visible to the proxy provider so it should be used only on websites that doesn't track you via cookies and fingerprinting so that in the expected scenario the proxy provider is expected to know only that "Someone on onion network is accessing this site" and should be used only to selected sites that block tor

@Kreyren
Kreyren / winehq-smite.md
Created June 24, 2020 01:02
Krey's tracking for SMITE on winehq

TODO: Provide output from:

DRI_PRIME=1 gamemoderun wine start steam://run/386360 | tee -a "SMITE.log"

@Kreyren
Kreyren / gist:b58bd8d198dd3f7227f47127c4de69fa
Last active June 23, 2020 14:46
Help krey being more productive by recommending him games to play~

Help krey being more productive by recommending him games to play on weak notebook

Looking for recommendations of games to play on this system:

kreyren@leonid 
-------------- 
OS: Kreyrock Linux 9999 Anubis x86_64 
Host: 20089 Lenovo G770 
Kernel: 5.6.0-18.1-liquorix-amd64 
@Kreyren
Kreyren / something.md
Created June 14, 2020 21:40
How to make a freenode account for dummies

TLDR for freenode registration is:

  1. Open an IRC client which is either https://webchat.freenode.net or install hexchat https://hexchat.github.io/ (note that the non-windows store version is free)

For Hexchat

  1. Download hexchat 2.1 On Linux hexchat should be packaged by your distribution so you can install it for example using apt install -y hexchat 2.2 On windows use https://hexchat.github.io/downloads.html and download windows 7 executable which is free
  2. Open hexchat and navigate to Server List image
  3. On server list find Freenode
@Kreyren
Kreyren / gist:cccf642ce672fd8f127ed128cf27749b
Last active January 19, 2024 14:26
How to properly setup and install nvidia on Debian/Devuan

OUTDATED: The pinning no longer works.


DISCLAIMER: This is provided as is without any warranty with hope to provide helpful informations

WARNING: Provided as reference to the configuration, you should use your own deduction for a proper configuration, DO NOT COPY-PASTE!

This is a short tutorial to install nvidia drivers on Debian/Devuan by adding non-free repository and then pinning to exclude all non-free packages excluding the one needed for Nvidia GPU to avoid their unexpected install.

@Kreyren
Kreyren / kix.md
Last active June 6, 2020 14:31
Shell function to generate colored paste url

This is a function designed for 'bashrc' to pipe command output with colors

NOTE: Command used has to support piping of colors Example usage: some program with colors | kix

kix() {	printf 'Paste is present on: %s\n' "https://rust-lang.github.io/rust-log-analyzer/log-viewer/#https://cors-anywhere.herokuapp.com/$(curl -n -F 'f:1=<-' http://ix.io 2>/dev/null)" ;}

Example output: