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
@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";
@devcutler
devcutler / README.md
Created December 17, 2022 15:46
My *arr stack with Jellyfin running on Docker.

docker-compose.yml configuration

  1. Mullvad needs a key and address space from one of the files you get from here. Input those into their respective fields in gluetun's environment variables. If you're not using Mullvad, follow any of the Provider guides on gluetun's wiki.
  2. Change any volume paths you want to be different. In the current setup the stack creates a directory per service for that service's configurations and then a single media directory for media storage.
  3. Set your PGID and PUID environment variables in any services that use them. This is used to ensure services can access the files they use.

Service configuration

Following respective services' setup guides will work for most cases, but these are some things to remember.

@fonic
fonic / scan-to-pdf.sh
Last active September 16, 2023 09:56
scan-to-pdf.sh - Scan documents directly to PDF file - Linux command line
Moved to https://github.com/fonic/scan2pdf
@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)){
@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/
@AtaxyaNetwork
AtaxyaNetwork / bgp-filter.txt
Last active October 18, 2023 19:45
BGP routing filter ROS7
Replace $PREFIX-v4 and $PREFIX-v6 with your prefixes (eg. 192.0.2.0/24)
Replace $LEIGHT with the length of your prefix (eg. 24)
chain=BGP-IN-v4 rule="if ( dst==$PREFIX-v4 ) { reject }"
chain=BGP-IN-v4 rule="if ( dst==192.168.0.0/16) { reject }"
chain=BGP-IN-v4 rule="if ( dst==127.0.0.0/8) { reject }"
chain=BGP-IN-v4 rule="if ( dst==10.0.0.0/8 ) { reject }"
chain=BGP-IN-v4 rule="if ( dst==169.254.0.0/16) { reject }"
chain=BGP-IN-v4 rule="if ( dst==172.16.0.0/12 ) { reject }"
@icedream
icedream / README.md
Last active March 29, 2024 20:57
Adjusting SELinux to change SSH port in Fedora CoreOS

See coreos/fedora-coreos-tracker#396 (comment) for a bit of explanation.

Warning: The script will trigger warning messages in the systemd journal log that look like this:

systemd[1]: sshd.service: Found left-over process 4270 (conmon) in control group while starting unit. Ignoring.
systemd[1]: This usually indicates unclean termination of a previous run, or service implementation deficiencies.

This is probably a side effect of the script booting up podman containers to run semanage - I don't know how to get rid of this properly if it's possible at all but I think this can be ignored for now.

SSH daemon can take quite a long while to start for the first time due to the one-time image build.

@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
@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
@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