Skip to content

Instantly share code, notes, and snippets.

View GlitchedPolygons's full-sized avatar

Glitched Polygons GmbH GlitchedPolygons

View GitHub Profile
#!/bin/bash
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install -y git-lfs
git lfs install
@GlitchedPolygons
GlitchedPolygons / text-prompt.sh
Created July 28, 2019 12:48
Linux CLI shell script snippet for prompting the user for a text value that will be exported to a variable (with empty-check).
echo
read -p "Enter text value: " TEXT
if [ -z "$TEXT" ]; then
echo
echo "ERROR: Text value empty - Please provide a valid value!"
exit 1
fi
@GlitchedPolygons
GlitchedPolygons / password-prompt.sh
Last active May 7, 2021 08:20
Linux CLI shell script snippet for prompting the user for a password (with confirmation and empty-check).
while true; do
echo
read -s -p "Enter the desired password: " PASSWORD
echo
read -s -p "Confirm your password by re-entering it again: " PASSWORD_CONFIRMATION
echo
[ "$PASSWORD" = "$PASSWORD_CONFIRMATION" ] && break || echo " ----- The two entered passwords don't match; please try again! -----"
done
if [ -z "$PASSWORD" ]; then
@GlitchedPolygons
GlitchedPolygons / set-default-app-for-extensionless-files-on-windows.txt
Last active April 9, 2019 19:51
Set default app for extensionless files on Windows
cmd.exe
Run the following two commands to associate Sublime Text 3 with extensionless files on Windows:
assoc .="No Extension"
ftype "No Extension"="C:\Program Files\Sublime Text 3\sublime_text.exe" "%1"
@GlitchedPolygons
GlitchedPolygons / git-auto-sign-commits.sh
Last active April 2, 2019 22:37 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key:
gpg --full-generate-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# Check current keys:
gpg --list-secret-keys --keyid-format LONG
# Export public key in gpg:
gpg --armor --export ER34512P9
# Your key id is the HASH in front of `sec` in previous command - looks a bit like "ER34512P9" or something like that.
@GlitchedPolygons
GlitchedPolygons / RsaKeyConverter.cs
Last active August 15, 2019 08:03 — forked from misaxi/BytesExtensions.cs
Useful extension method class for converting RSA key strings back and forth from and to XML/PEM. Kudos to misaxi (https://github.com/misaxi), a huge thank you for the original gist!
using System;
using System.IO;
using System.Xml;
using System.Text;
using System.Security.Cryptography;
using Org.BouncyCastle.Pkcs;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.OpenSsl;