Skip to content

Instantly share code, notes, and snippets.

View Tekunogosu's full-sized avatar
🎯
Focusing

Theysa Tekunogosu

🎯
Focusing
View GitHub Profile
@Tekunogosu
Tekunogosu / AdjustBrightness.py
Created January 4, 2022 17:39
Adjustable brightness script using Xrandr. This may only work for displays that have adjustable brightness levels such as laptops.
#!/usr/bin/env python3
import subprocess, shlex, re, logging, os, sys
# TODO: implement logging
# TODO: implement setting brightness based on specific values as well
home_dir = os.path.expanduser("~")
VAL_STEP = 0.05
UPPER_BOUNDS = 0.90
@Tekunogosu
Tekunogosu / nvidia-driver-realtime.sh
Created September 15, 2022 00:25 — forked from pantor/nvidia-driver-realtime.sh
Installing NVIDIA drivers on a realtime Linux (PREEMPT-RT)
# Tested on Ubuntu 16.04 and X11, 2019
# 1. Download NVIDIA driver as a .run file
# 2. Stop X-Server
sudo service lightdm stop
# 3. Blacklist Nouveau driver
sudo nano /etc/modprobe.d/blacklist-nouveau.conf
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.15.65-gentoo Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo 11.3.0 p4) 11.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.15.59-gentoo Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Gentoo 11.3.0 p4) 11.3.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=110300
CONFIG_CLANG_VERSION=0
CONFIG_AS_IS_GNU=y
CONFIG_AS_VERSION=23800
## Make sure the kernel in use has a real time patch available for it.
## Check the below patch site for a patch for the appropriate kernel
## For gentoo, its usually necessary to emerge a specific version of the kernel as not all version have a patch set
## Using different kernel than the one you're using also allows you to switch between a working version if something goes wrong
## You need to make sure the exact version matches, example: 5.15.65 is exact version I used
## Patch site
## https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.15/
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLineEdit, QLabel
from PyQt5.QtGui import QCursor, QKeyEvent
from PyQt5.QtCore import Qt, QEvent
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
@Tekunogosu
Tekunogosu / gist:b5a21e8bc3395bdc81c4b0ec1a00362a
Created September 2, 2023 05:29
vim regex for gentoo kernel modules
#/lib/modules/6.5.0-gentoo-nox/kernel/virt/lib/irqbypass.ko
:%s/.*\/\([^/]\+\)\.k\{,1\}o\?$/\1/
@Tekunogosu
Tekunogosu / starfieldcustom.ini
Last active February 13, 2024 13:59
starfieldcustom.ini
[Display]
fDefault1stPersonFOV=90
fDefaultFOV=90
fDefaultWorldFOV=90
fFPWorldFOV=90
fTPWorldFOV=90
;bEnableRaytracing=1
;bUseSkyLighting=1
;set to 0 to disable
fMaxAnisotropy=2
@Tekunogosu
Tekunogosu / ktab.py
Created September 26, 2024 02:41
Kitty: Open new tab with set title from within kitty
#!/usr/bin/env python3
# create a new tab and set the title
# make sure to update your ~/.conf/kitty/kitty.conf to enable: allow_remote_control on
import subprocess
import argparse
import sys
def open_kitty_tab_with_title(title: str) -> None:
# The command to open a new tab with the specified title
@Tekunogosu
Tekunogosu / Cargo.toml
Last active September 26, 2024 04:50
Small cli program to open a new tab in kitty. There are no options here; this was an exercise in rust and optimizations for release builds. The binary is 363k on my system when built.
[package]
name = "ktab"
version = "0.1.0"
edition = "2021"
[dependencies]
[profile.release]
opt-level = 3
lto = "fat"