Skip to content

Instantly share code, notes, and snippets.

View NewRedsquare's full-sized avatar
😴
Working from home

NewRedsquare

😴
Working from home
View GitHub Profile
@Greelan
Greelan / letsencrypt_notes.sh
Last active April 14, 2025 19:14 — forked from lachesis/letsencrypt_notes.sh
Set up Let’s Encrypt certificate using acme.sh as non-root user
# How to use acme.sh to set up Let's Encrypt, with the script being run
# mostly without root permissions
# See https://github.com/Neilpang/acme.sh for more
# These instructions use the domain "EXAMPLE.COM" as an example
# These instructions:
# - work on Ubuntu 18.04 and 20.04 with nginx
# - use CloudFlare DNS validation
@sdiama
sdiama / althosting.txt
Last active October 13, 2023 21:00
A curated list of cheap "alternatives" to AWS, GCP, Azure hosting solutions
S3 Alternatives
---------------
- https://wasabi.com
- https://www.exoscale.com
- https://www.vultr.com
- https://www.arubacloud.com/
- https://www.digitalocean.com
- https://min.io/
- http://leo-project.net/
- https://www.backblaze.com/
@davivcgarcia
davivcgarcia / update-golang.sh
Last active April 7, 2024 18:36
Script automatically update local Golang runtime
#! /bin/bash
# Stops at the first error
set -e
# Checks if is running as root, and sudo if not
[ `whoami` = root ] || { sudo "$0" "$@"; exit $?; }
# Determines current local version
if [[ -f /usr/local/go/bin/go ]]; then
@aasumitro
aasumitro / sms-minicom.txt
Last active November 9, 2024 19:09
send sms with minicom
Connect Sim800l v2 by rohs with minicom (raspberry pi 3 b+)
#1 download minicom package
apt install minicom
#2 activate hardware serial interface by opening the raspberry config
raspi-config
- interfacing options
@lizthegrey
lizthegrey / attributes.rb
Last active May 23, 2025 05:50
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@loa
loa / README.md
Last active June 1, 2025 08:16
Dual GPG Yubikey Setup

Dual GPG Yubikey Setup

If you follow this guide you will end up with an offline and online Yubikey. Use your online Yubikey for everyday life, signing/encryption etc. Offline key for signing keys for web-of-trust and replace lost online keys.

Awesome tools with PGP keys:

  • mozilla/sops dead-simple local encryption of sensitive files
  • popass.pw password manager for you and your team stored in git

Offline Yubikey

@jokey2k
jokey2k / sshfilter.sh
Last active April 22, 2024 14:18
Tuned version of sshfilter.sh to allow for ipv6 filtering
#!/bin/bash
# based on script from http://www.axllent.org/docs/view/ssh-geoip
# License: WTFPL
# UPPERCASE space-separated country codes to ACCEPT
ALLOW_COUNTRIES="DE EU GB"
LOGDENY_FACILITY="authpriv.notice"
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` <ip>" 1>&2
@patotoma
patotoma / ContactForm.md
Last active October 7, 2023 07:39
secure php contact form

Secured PHP Contact Form

<?php
  if(isset($_POST['submit'])){
    $name = htmlspecialchars(stripslashes(trim($_POST['name'])));
    $subject = htmlspecialchars(stripslashes(trim($_POST['subject'])));
    $email = htmlspecialchars(stripslashes(trim($_POST['email'])));
    $message = htmlspecialchars(stripslashes(trim($_POST['message'])));
    if(!preg_match("/^[A-Za-z .'-]+$/", $name)){
@reefab
reefab / gist:3811608
Created October 1, 2012 12:50
Utiliser pfsense avec SFR Fibre
$dhclientconf = "";
if ($wanif == "rl2") {
$dhclientconf .= <<<EOD
interface "{$wanif}" {
timeout 60;
retry 1;
select-timeout 0;
send dhcp-class-identifier "neufbox5_NB5-SER-r1_NB5-MAIN-R2.2.2";