Skip to content

Instantly share code, notes, and snippets.

View wyrmiyu's full-sized avatar

Sandi Wallendahl wyrmiyu

  • Red Hat
  • Finland
View GitHub Profile
@wyrmiyu
wyrmiyu / regular-expressions.info-night-eye-dark-mode-with-custom-code.css
Created February 14, 2023 15:48
regular-expressions.info dark mode with Night Eye and custom CSS
span[class=regexnest1] {
color: rgb(237, 177, 208);
}
span[class=regexnest2] {
color: rgb(233, 229, 162);
}
span[class=regexplain] {
color: rgb(221, 211, 215);
# Filename: check_ssh_agent.sh
#
# Description: Check if ssh-agent environment exists for the session and
# create it if it does not.
#
# NOTE:
# Do not run this command directly, but import it in your .bashrc file with:
#
# source /path/to/check_ssh_agent.sh
#
@wyrmiyu
wyrmiyu / i3-config
Last active November 2, 2021 13:16
My ~/.config/i3/config
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
set $mod Mod4
# Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below.
font pango:monospace 10
SSH_AGENT_PID=999999999999999
if [ -r ~/.ssh/agent ]; then
source ~/.ssh/agent >/dev/null
fi
if [ -r "/proc/$SSH_AGENT_PID/exename" ]; then
if [[ $(basename $(cat /proc/$SSH_AGENT_PID/exename)) != ssh-agent ]]; then
rm -f ~/.ssh/agent $SSH_AUTH_SOCK
unset $SSH_AGENT_PID
fi
@wyrmiyu
wyrmiyu / satellite6-post-install-finish.sh
Last active April 21, 2017 12:45
Post-install script that can be run during first-boot of a virtual server. Assumes network configuration is in place and working. Goes through all its mac addresses and tries to use them to retrieve its hostname from Satellite. Once done, the hostname is used to retrieve a tailored post-install script from Satellite.
#!/bin/bash
if [[ -e /.configure_satellite_client && $EUID = 0 ]]; then
SATELLITE_USERNAME=exampleuser
SATELLITE_PASSWORD=examplepass123
SATELLITE_SERVER=satellite.example.com
FINISH_SCRIPT=/root/post_install_finish_script.sh
LOG_FILE=/root/post_install_finish_script.log
satellite_api=https://${SATELLITE_SERVER}/api/v2
hostname=
@wyrmiyu
wyrmiyu / HOWTO screen+irssi at boot time.txt
Last active September 3, 2020 13:09
How to setup screen+irssi start at boot time
[user@ircshell ~]$ mkdir -p ~/bin
[user@ircshell ~]$ cat > ~/bin/start_irssi.sh <<-'EOF'
#!/bin/bash
# Set timezone
export TZ='EET'
#
# Start a new screen with unicode support (-U), named as 'irc' (-S),
# in detached mode (-m -d) and run irssi in it.
/usr/bin/screen -U -S irc -m -d /usr/bin/irssi
@wyrmiyu
wyrmiyu / HOWTO-Tappio-Wine.txt
Last active March 5, 2016 23:17
HOW-TO for installation of Tappio free accounting software to run with Wine
To install Tappio to *NIX-like system that runs Wine:
1) create a directory for Tappio, for example under your home directory:
$ mkdir $HOME/tappio && cd $HOME/tappio
2) download tappio-setup.exe:
$ wget http://www.lahdenniemi.fi/jussi/tappio/tappio-setup.exe
3) set local wine-environment for tappio:
$ export WINEPREFIX=$(pwd)/wine
4) run the installer:
$ wine tappio-setup.exe
@wyrmiyu
wyrmiyu / example.sh
Last active August 29, 2015 13:56
Example bash script with option parsing, error handling, usage and cleanups
#!/bin/bash
# Define your global variables
#
# Add names of all global variables to GLOBALS
GLOBALS=" GLOBALS \
PATH \
SCRIPT_NAME \
ARG \
OPTION \