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 November 18, 2024 10:04
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.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

@flozz
flozz / arctis7.py
Last active July 26, 2024 13:51
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 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..."