Skip to content

Instantly share code, notes, and snippets.

@lhess
lhess / printer.cfg
Last active February 24, 2024 12:26
klipper SKR PRO v1.2 config, i3 cartesian, dual Z, BLTouch, tmc2209
# Specs:
# - SKR 1.2 Pro
# - TMC2209
# - 1.8 stepper on XYZ
# - Dual Z
# - BLTouch
# - Sensorless homing on X
# - Physical endstops on Y
# - BMG extruder with 1.8 stepper
# - e3d Volcano with 12V 40 watts heater
@ggajoch
ggajoch / klipper.cfg
Last active February 21, 2021 08:31
typical config
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v1.2. To use this config, the firmware should be compiled for the
# STM32F103 with a "28KiB bootloader". Also, select "Enable extra
# low-level configuration options" and configure "GPIO pins to set at
# micro-controller startup" to "!PC13".
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
@gmolveau
gmolveau / argparse_global.py
Created February 8, 2019 15:43
Python argparse example of a global variable usage
import argparse
CONSOLE_ARGUMENTS = None
def test():
print(CONSOLE_ARGUMENTS.color_enabled)
def main():
parser = argparse.ArgumentParser(description='test script with global argparse')
@lichti
lichti / letsencrypt-proxmox.md
Last active September 12, 2022 20:14
Proxmox with letsencrypt ssl
git clone https://github.com/certbot/certbot /opt/letsencrypt
ln -s /opt/letsencrypt/certbot-auto /usr/bin/certbot
certbot certonly --expand --agree-tos --text --non-interactive \
 --standalone \
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@cgmartin
cgmartin / check-certs.sh
Created January 17, 2016 18:00
Bash SSL Certificate Expiration Check
#!/bin/bash
TARGET="mysite.example.net";
RECIPIENT="hostmaster@mysite.example.net";
DAYS=7;
echo "checking if $TARGET expires in less than $DAYS days";
expirationdate=$(date -d "$(: | openssl s_client -connect $TARGET:443 -servername $TARGET 2>/dev/null \
| openssl x509 -text \
| grep 'Not After' \
|awk '{print $4,$5,$7}')" '+%s');
in7days=$(($(date +%s) + (86400*$DAYS)));
@jillesme
jillesme / .tmux.conf
Created October 16, 2015 09:50
Jilles' tmux configuration
# allow pbcopy | pbpase on OSX
set-option -g default-command "reattach-to-user-namespace -l zsh"
# set colours
set -g default-terminal "screen-256color"
# use ctrl+a rather than ctrl+b (capslock == ctrl)
unbind C-b
set-option -g prefix C-a
bind C-a send-prefix
@kamermans
kamermans / fail2ban-allstatus.sh
Created July 11, 2011 17:06
Show status of all fail2ban jails at once
#!/bin/bash
JAILS=`fail2ban-client status | grep "Jail list" | sed -E 's/^[^:]+:[ \t]+//' | sed 's/,//g'`
for JAIL in $JAILS
do
fail2ban-client status $JAIL
done