Skip to content

Instantly share code, notes, and snippets.

View trite2k3's full-sized avatar

trite2k3

  • Sweden
View GitHub Profile
@fazlearefin
fazlearefin / gist:b8060b333cce9df3f2074434d3308857
Created September 22, 2021 16:34
Bash | Sleep random seconds
#!/bin/bash
# 1-10 second random sleep/pause in the script
sleep $[ ( $RANDOM % 10 ) + 1 ]s
# even shorter sleep
sleep .$[ ( $RANDOM % 10 ) + 1 ]s
sleep .0$[ ( $RANDOM % 10 ) + 1 ]s
@probonopd
probonopd / Wayland.md
Last active July 12, 2025 01:27
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

image

Source: https://x.com/LundukeJournal/status/1940441670098809093

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

@flozz
flozz / arctis7.py
Last active December 10, 2024 04:04
Displays the battery level of a SteelSeries Arctis 7 headset.
#!/usr/bin/env python3
"""
This script displays the battery level of a SteelSeries Acrtis 7 headset.
USING
-----
To use this script you must install hidapi (https://github.com/trezor/cython-hidapi):
@PhilipSchmid
PhilipSchmid / bash-template.sh
Last active May 12, 2025 15:10
Bash script template (incl. logging functions)
#!/bin/bash
#################################
# Constants / global variables
#################################
LOGFILE='example.log'
LOGLEVEL='INFO'
#################################
# Functions
@johnvey
johnvey / gist:3442925
Created August 23, 2012 22:44
This is bash script that ensures that ssh-agent is always loaded when you log in. It will reuse any existing agents in your session, thus avoiding spawning one on every terminal session.
# Place this in your .bash_profile for interactive-only support,
# or in .bashrc for interactive and non-interactive support.
#
# See: https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git#SetupSSHforGit-installpublickey
SSH_ENV="$HOME/.ssh/environment"
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."