Skip to content

Instantly share code, notes, and snippets.

View ThorstenS-linux's full-sized avatar

Thorsten Strusch ThorstenS-linux

View GitHub Profile
@strfry
strfry / README.md
Last active April 10, 2024 13:21
Deploys FreeBSD on a Hetzner cloud server

Deploys FreeBSD on a Hetzner cloud server

Prerequisites:

  • A Hetzner Cloud API Token (Pass in via APIKEY)
  • jq
  • sshpass

Usage

Replace server_id variable with your hetzner server Id
@mikenye
mikenye / pfsense_telegraf.conf
Created November 9, 2018 02:57
Telegraf config to fetch data from pfSense
[[inputs.snmp]]
agents = [ "firewall.ip.address.here:161" ]
version = 1
community = "public"
interval = "10s"
timeout = "20s"
[[inputs.snmp.field]]
name = "host"
oid = ".1.3.6.1.2.1.1.5.0"
is_tag = true
@adlerweb
adlerweb / vz.md
Last active December 30, 2023 17:25
Grafana MySQL query to visualize Volkszähler-Data

Using Channel-IDs (that's not UUID)

SELECT
  timestamp/1000 as time_sec, 
  data.value as value, 
  properties.value as metric
FROM data
  LEFT JOIN properties ON (properties.entity_id = data.channel_id)
  LEFT JOIN entities ON (entities.id = data.channel_id)
@francoisromain
francoisromain / project-create.sh
Last active June 14, 2024 09:55
A bash script to create a Git post-receive hook to deploy after a Git push
#!/bin/bash
# source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3
# and another script to delete the directories created by this script
# project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb
# Call this file with `bash ./project-create.sh project-name`
# - project-name is mandatory
# This will creates 4 directories and a git `post-receive` hook.
@StefanHamminga
StefanHamminga / print-png-label-to-networked-brother-label-printer.sh
Created December 22, 2016 14:41
Bash function to print black and white PNG (and JPEG, GIF, BMP) files to a networked Brother label printer (such as the QL-720NW)
# Print a black and white PNG file on the first available Brother label printer
# Requires https://github.com/pklaus/brother_ql
# Source (.) this file to set bash completion and add the print function.
function print-png-label() {
if [ -f "$1" ]; then
# Change these to match your printer:
local LBLPMODEL="QL-720NW"
local LBLPSIZE="62"
@mattiaslundberg
mattiaslundberg / Ansible Let's Encrypt Nginx setup
Last active June 10, 2024 01:44
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@atlury
atlury / rPi3-ap-setup.sh
Created March 20, 2016 09:20 — forked from Lewiscowles1986/rPi3-ap-setup.sh
Raspberry Pi 3 access-point-setup
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
if [[ $# -ne 1 ]];
then echo "You need to pass a password!"
echo "Usage:"
@StefanHamminga
StefanHamminga / rsync-skip-compress
Last active September 8, 2023 05:17
List of compressed file formats for use with Rsync --skip-compress=$RSYNC_SKIP_COMPRESS
export RSYNC_SKIP_COMPRESS=3g2/3gp/3gpp/3mf/7z/aac/ace/amr/apk/appx/appxbundle/arc/arj/asf/avi/br/bz2/cab/crypt5/crypt7/crypt8/deb/dmg/drc/ear/gz/flac/flv/gpg/h264/h265/heif/iso/jar/jp2/jpg/jpeg/lz/lz4/lzma/lzo/m4a/m4p/m4v/mkv/msi/mov/mp3/mp4/mpeg/mpg/mpv/oga/ogg/ogv/opus/pack/png/qt/rar/rpm/rzip/s7z/sfx/svgz/tbz/tgz/tlz/txz/vob/webm/webp/wim/wma/wmv/xz/z/zip/zst
gst-launch-1.0 \
v4l2src device=/dev/video1 ! video/x-raw,width=864,height=480 ! videoconvert ! \
clockoverlay shaded-background=true time-format="%H:%M:%S" ! vp8enc ! tee name=videoTee \
pulsesrc ! vorbisenc ! tee name=audioTee \
webmmux name=streamMux ! shout2send ip=IP port=PORT password=PASSWORD mount=/tuna.webm \
webmmux name=fileMux ! filesink location=tuna.webm \
audioTee. ! queue ! streamMux.audio_0 \
videoTee. ! queue ! streamMux.video_0 \
audioTee. ! queue ! fileMux.audio_0 \
videoTee. ! queue ! fileMux.video_0
@MaxLaumeister
MaxLaumeister / Grub_Powerup.md
Last active June 7, 2024 15:58
Grub Init Tune: Mario Bros. Mushroom Powerup

Grub Init Tune - Mario Bros. Mushroom Powerup

This Grub Init Tune will make your computer sound like a Super Mushroom every time you turn it on! This only works for the Grub bootloader - this generally means you need to have Linux (or other Grub-based OS) installed.

Here's the code, which goes in your /etc/default/grub file:

GRUB_INIT_TUNE="1750 523 1 392 1 523 1 659 1 784 1 1047 1 784 1 415 1 523 1 622 1 831 1 622 1 831 1 1046 1 1244 1 1661 1 1244 1 466 1 587 1 698 1 932 1 1195 1 1397 1 1865 1 1397 1"

Installation Instructions