Skip to content

Instantly share code, notes, and snippets.

@eplord
eplord / README.md
Created December 21, 2022 13:28 — forked from typebrook/README.md
A bash script for gist management #bash #gist
@eplord
eplord / create-ssh.sh
Last active September 28, 2024 02:07
generate ssh bash script
#!/bin/sh
# https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
# download this script an make it executable with `chmod +x create_ssh
if [ -n "$1" ]; then
COMMENT=$1
else
COMMENT=$USER
fi
@eplord
eplord / 1_docs.flatpak-tips
Last active January 21, 2023 04:22
Tips and Tricks — Flatpak documentation
# docs.flatpak.org
# https://docs.flatpak.org/en/latest/tips-and-tricks.html#testing-an-app-with-a-different-runtime
#
# Tips and Tricks — Flatpak documentation
#
# This page explains a few useful features of the Flatpak CLI.
# Testing an app with a different runtime¶
#
# You can (for testing) run an application with a different runtime than it typically uses. For instance, to run stable gedit with the latest unstable gnome runtime you can do:
@eplord
eplord / get_nordvpn_linux.sh
Created February 23, 2023 09:40
Nordvpn script for linux
#!/bin/sh
# check for root access
SUDO=
if [ "$(id -u)" -ne 0 ]; then
SUDO=$(command -v sudo 2> /dev/null)
if [ ! -x "$SUDO" ]; then
echo "Error: Run this script as root"
exit 1
@eplord
eplord / adduser-auto.sh
Last active March 19, 2023 01:01
add a list of users (or just one user)
#!/bin/bash
# Checks if you have the right privileges
if [ "$USER" = "root" ]
then
# CHANGE THIS PARAMETERS FOR A PARTICULAR USE
PERS_HOME="/home/"
PERS_SH="/bin/bash"
@eplord
eplord / gpg-ssh-setup.md
Created March 25, 2023 22:21 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@eplord
eplord / docker.sh
Last active March 26, 2023 02:22
quick server setup ubuntu2004
#!/bin/bash
set -euo pipefail
DOCKER_VERSION=
OS_ARCH="$(dpkg --print-architecture)" #amd64
OS_TYPE="$(uname -s | tr '[:upper:]' '[:lower:]')" #linux
@eplord
eplord / _utils
Created April 18, 2023 23:46
basic bash script helpers
#!/bin/bash
set -e
success() {
printf "\\033[32m ✔ \\033[0m\\n"
}
fail() {
printf "\\n\\033[31m ✖ \\033[0m $1\\n"
@eplord
eplord / go
Last active April 19, 2023 01:48
Install latest version of golang
#!/bin/bash
# Install latest version of golang
#
# https://gist.github.com/eplord/7b1d2da1fbc7eb5e748a5e2f15723085/raw/go
# Usage : curl -fsSL https://tinyurl.com/yc46thx4 | bash
# https://gist.github.com/eplord/c39ebb75fd8c318e207f7ece60d3cddb/raw/_utils
source /dev/stdin <<<"$(curl -fsSL https://tinyurl.com/yck6pv5e)"
# [[ -z "${GOROOT}" ]] && export GOROOT="/usr/lib/go"
@eplord
eplord / ubuntudocker.sh
Created April 19, 2023 18:06 — forked from fredhsu/ubuntudocker.sh
Shell script to install Docker CE on ubuntu and post-install user configuration
#!/bin/bash
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \