Skip to content

Instantly share code, notes, and snippets.

@ishmaelen
ishmaelen / 00-getcert.md
Created January 29, 2024 09:12 — forked from AfroThundr3007730/00-getcert.md
Renews my LetsEncrypt certificates if they expire in less than 3 days.

This gist includes a certificate renewal script, which I use to renew both of my LetsEncrypt certificates, as well as the systemd unit files necessary to automate it. It's currently set to run every 12 hours, and renews the certificates if they expire in less than 3 days. The certbot tool is required in order to use this script. Note that I generated my keys and CSR manually because I needed to add specific extensions to my certificates. That process is not covered here.

Filename Description
01-getcert.sh The certificate renewal script.
02-cli.ini Example Certbot configuration.
03-getcert.timer The systemd timer unit file.
04-getcert.service The systemd service unit file.
05-openssl.conf Example openssl.conf for the CSR
06-getcert-ddns.sh DDNS version of the renewal script.
@ishmaelen
ishmaelen / check_user_lastseen
Created January 19, 2023 10:40 — forked from rawiriblundell/check_user_lastseen
checkmk local check for local account auditing
#!/bin/bash
# check_user_lastseen - report on users who have not logged in for a while
# Purpose:
# This script tries to find idle accounts and any orphaned homedirs
# Currently is Linux biased but capacity for portability is there
# Author: Rawiri Blundell
# Copyright: See provided LICENCE file
###############################################################################
# Source the config mapping library
# Provides variables "${thisHost}", "${thisJob}" and
@ishmaelen
ishmaelen / iptables-cheatsheet.md
Created July 12, 2021 08:09 — forked from egernst/iptables-cheatsheet.md
iptables-cheatsheet

The netfilter hooks in the kernel and where they hook in the packet flow

The figure below calls out

  • The netfilter hooks
  • The order of table traversal
@ishmaelen
ishmaelen / PVE-HP-ssacli-smart-storage-admin.md
Created December 10, 2020 08:25 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@ishmaelen
ishmaelen / Adding tmux
Created December 8, 2020 08:59 — forked from sshadmand/Adding tmux
The best and greatest tmux.conf ever
Create a tmux conf file
#> touch ~/.tmux.conf
Install TMP
#> git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
[Copy and paste tmux.conf below into local file.]
Load tmux configurations
#> tmux source-file ~/.tmux.conf
@ishmaelen
ishmaelen / Public_Recursive_Name_Servers.md
Created December 8, 2020 08:57 — forked from mutin-sa/Top_Public_Recursive_Name_Servers.md
List of Top Public Recursive Name Servers
IPv4 Addr IPv6 Addr ASn Loc Svc Org
8.8.8.8 2001:4860:4860::8888 AS15169 Worldwide (Anycast) Google Public DNS Google
8.8.4.4 2001:4860:4860::8844 AS15169 Worldwide (Anycast) Google Public DNS Google
77.88.8.8 2a02:6b8::feed:0ff AS13238 Worldwide (Anycast) Yandex.DNS Yandex
77.88.8.1 2a02:6b8:0:1::feed:0ff AS13238 Worldwide (Anycast) Yandex.DNS Yandex
1.1.1.1 2606:4700:4700::1111 AS13335 Worldwide (Anycast) Cloudflare-DNS Cloudflare/APNIC
1.0.0.1 2606:4700:4700::1001 AS13335 Worldwide (Anycast) Cloudflare-DNS Clou
@ishmaelen
ishmaelen / Public_Time_Servers.md
Created December 8, 2020 08:57 — forked from mutin-sa/Top_Public_Time_Servers.md
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@ishmaelen
ishmaelen / ntp.conf
Created March 30, 2020 08:16 — forked from sneak/ntp.conf
ntpd stratum 1 timeserver config
driftfile /var/lib/ntp/ntp.drift
leapfile /usr/share/zoneinfo/leap-seconds.list
# Enable this if you want statistics to be logged.
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
@ishmaelen
ishmaelen / local.cf
Created March 30, 2020 08:15 — forked from sneak/local.cf
spamassassin config
# datavibe.net spamassassin local config as of 2015-07-17
# Add *****SPAM***** to the Subject header of spam e-mails
rewrite_header Subject *****SPAM*****
# Save spam messages as a message/rfc822 MIME attachment instead of
# modifying the original message (0: off, 2: use text/plain instead)
report_safe 1
add_header all RelaysUntrusted _RELAYSUNTRUSTED_
@ishmaelen
ishmaelen / shakespeare-ngrams-cli-ack.md
Created June 13, 2018 06:08 — forked from dannguyen/shakespeare-ngrams-cli-ack.md
How to tokenize and create n-grams in Shakespeare from the command-line

Creating Shakespearean n-grams with just the command-line and regexes

This is a quick example showing how to use regexes to find tri-grams in Shakespeare...well, 570,872 of them, anyway, if we do some basic filtering of non-dialogue.

Though tokenization and n-grams should typically be done using a proper natural language processing framework, it's possible to do in a jiffy from the command-line, using standard Unix tools and ack, the better-than-grep utility.

What are n-grams?