Skip to content

Instantly share code, notes, and snippets.

View trite2k3's full-sized avatar

trite2k3

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 May 3, 2024 23:46
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

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.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@flozz
flozz / arctis7.py
Last active August 3, 2023 13:40
Displays the battery level of a SteelSeries Acrtis 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 April 22, 2024 13:03
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..."