Skip to content

Instantly share code, notes, and snippets.

@Raiu
Raiu / add_github_key.sh
Last active October 1, 2023 16:40
This script automatically adds SSH keys from a GitHub user to the authorized_keys file on a local machine while keeping all manually added keys.
#!/usr/bin/env sh
: '
This script helps you download your ssh keys from Github while keeping any existing keys.
Usage:
./add_github_keys.sh [OPTIONS] USERNAME
Without downloading:
curl -fsSL https://gist.githubusercontent.com/Raiu/23418eac4e78856167121b4f02c13db7/raw | sh -s -- USERNAME
@Raiu
Raiu / cleanname
Last active December 21, 2020 01:10
Bash script to sanitize file and dir names
#!/bin/bash
VERBOSE=false
NOACTION=false
while getopts :hvn opt; do
case $opt in
v)
VERBOSE=true
;;
@Raiu
Raiu / PoEAllFlask.ahk
Created April 2, 2020 10:11
Path of Exile | AutoHotKey script to use all flask at the same time
;Lines starting with a ; are comments and are not part of the actual script.
;If you want to deactivate a flask press(e.g. because it is your hp flask) simply add a ; to the start of the line
;this line makes the script only work when Path of Exile is the active window
#IfWinActive Path of Exile
#SingleInstance force
#NoEnv
#Warn
#Persistent
@Raiu
Raiu / locale
Created September 21, 2018 06:01
optimal locale for linux
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=sv_SE.utf8
LC_TIME=sv_SE.utf8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=sv_SE.utf8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=sv_SE.utf8
LC_NAME=sv_SE.UTF-8
@Raiu
Raiu / ngxsite
Created November 16, 2017 19:19
ngxsite | Script to enable and disable sites with nginx
#!/bin/bash
#
# Tested with Debian 9 Stretch
# Autocomplete script for zsh
##
# Default Settings
##
NGINX_CONF_FILE="$(awk -F= -v RS=' ' '/conf-path/ {print $2}' <<< $(nginx -V 2>&1))"