Skip to content

Instantly share code, notes, and snippets.

View Kreyren's full-sized avatar

KREYREN Kreyren

  • Fixer, The @base48 Hackerspace
  • Kralovec, Czech Republic
View GitHub Profile
@Kreyren
Kreyren / gist:cccf642ce672fd8f127ed128cf27749b
Last active October 27, 2025 17:19
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:

#!/usr/bin/busybox sh
# Created by Jacob Hrbek <kreyren@rixotstudio.cz> under GPLv3 <https://www.gnu.org/licenses/gpl-3.0.en.html> with the help in freenode.net/#bash in 28/05/2020 11:09 CET
# shellcheck shell=sh
set -e
die() {
case "$2" in
*) printf 'FATAL: %s\n' "$3 $1"

I'm trying to install Mafia I on Linux which refuses to detect the CD.

Mafia I in Czech version has three CDs which are required to be inserted during the installation

I've deprecated a CD drive so this is downloaded from torrent (i own the phyicall copy of the game)

ISSUE

CDs are not detected during installation which seems to be looking for a CD called MAFIA_CD_1 witch A1.dta file (which is what i've understand from the err messages)

The ISO is mounted using sudo mount -o loop /path/to/mntdir /path/to/iso and set in winecfg to be autodetected (using CD-ROM and setting a label to MAFIA_CD_1 does not work)

Disclaimer: This is implemented as legal defence agains bad actors like (allegedly) dis.cool (https://www.reddit.com/r/discordapp/comments/eeoxwa/discool_collects_and_illegally_stores_your/)
By joining and actively or non-actively using this server (I.e having your account on this server) you agree that the informations provided in the timeline of your account being on this server are your own intellectual property that you are sharing as non-redistributable content for the purpose of communication.
Violation of this agreenment is considered as a direct violation of your right to your intellectual property and therefore is it prohibited under a sanction defined by the law.
You are not required to accept this agreement to the extent defined by the law to be considered as valid since you did not sign it. However nothing else grants you the permission of using this server. These actions are prohibited by law if you do not accept this agreement. Therefore by using this server you explicitly agree with these
@Kreyren
Kreyren / gist:3e55e9a754e58956e1690e38b1888de7
Last active March 20, 2020 10:44
HELP-WANTED: blackscreen on amdgpu load after bootloader

After bootloader i'm getting blackscreen

monitor outputing eqvivalent of no input message

i belive that this is being triggered on initialization of amdgpu since it's happening at the point where display usually changes the resolution and adding amdgpu.si_support=0 radeon.si_support=0 in kerneli cli allows me to boot and use GUI.

This is also happening on systemrescuecd with image that worked before on this system

This issue appeared suddenly while playing witcher2 after debian sandbox update

@Kreyren
Kreyren / MasterOfCCalculator.sh
Created January 20, 2020 15:11
Became master of C programming under 1,24sec using one short command!
( die(){ printf 'FATAL: %s\n' "$1" ;} ; mkdir -p "$HOME/C-Calculator/src" && printf '%s\n' "#include <stdio.h>" "#include <stddef.h>" '' "int main() {" " // Using float instead of double since it takes less space -> Experimenting if this is better then double" " float num1;" " float num2;" " char op; // Operator" " // Ask for user-input" " printf(\"%s\\n\",\"Enter first number: \");" " scanf(\"%f\", &num1);" " printf(\"%s\\n\", \"Enter an operator: \");" " scanf(\" %c\", &op);" " printf(\"%s\\n\",\"Enter Second number: \");" " scanf(\"%f\", &num2);" " // Action" " if(op == '+') {" " printf(\"Result: %f\\n\", num1 + num2);" " return 0;" " } else if(op == '-') {" " printf(\"Result: %f\\n\", num1 - num2);" " return 0;" " } else if(op == '*' || op == 'x') {" " printf(\"Result: %f\\n\", num1 * num2);" " return 0;" " } else if (op == '/' || op == ':') {" " printf(\"Result: %f\\n\", num1 / num2);" ' return 0;' '
@Kreyren
Kreyren / MasterOfCPing.sh
Created January 20, 2020 14:38
Became C programmer under 0,41sec
rm -r "$HOME/C-ping" ; ( mkdir -p "$HOME/C-ping/src" && printf '%s\n' '#include <stdio.h>' '' 'int main() {' ' printf("%s\n", "ping");' '}' > "$HOME/C-ping/src/main.c" && { cd "$HOME/C-ping/" || printf 'FATAL: %s\n' 'KURVA FUCK' ; } && gcc "$HOME/C-ping/src/main.c" && chmod +x "$HOME/C-ping/a.out" ; "/$HOME/C-ping/a.out" )
#!/bin/sh
# Created by Jacob Hrbek <kreyren@rixotstudio.cz> under the terms of GPL-3 (https://www.gnu.org/licenses/gpl-3.0.en.html) in 2020
# Created for https://bugs.winehq.org/show_bug.cgi?id=45546#c26
MAINTAINER="kreyren@rixotstudio.cz"
# Simplified assertion
die() { printf 'FATAL: %s\n' "$2" ; exit "$1" ;}
# Simplified output handling
@Kreyren
Kreyren / extage.sh
Created December 9, 2019 08:00
Fetch gentoo's portage on target
#!/bin/sh
# Copyright 2019 Jacob Hrbek <kreyren@rixotstudio.cz>
# Distributed under the terms of the GNU General Public License v3 (https://www.gnu.org/licenses/gpl-3.0.en.html) or later
die() { printf 'FATAL: %s\n' "$1" ; exit 1 ;}
debug() { printf 'DEBUG: %s\n' "$1" ;}
edo() {
$@ ; case $? in
0) ;;
*) die "$@ returned $?"
esac