Skip to content

Instantly share code, notes, and snippets.

@agail
agail / metric_cups_airprint.md
Created April 14, 2024 12:58
Metric paper size with AirPrint + Cups

- Why do I only get US Legal and US Letter when printing from iPhone?

-- Something has changed in Airprint or iOS and you need to manually set your preferred size in cupsd.conf
Add the following to the bottom of cupsd.conf
DefaultPaperSize A4
# DefaultLanguage <locale> (de,en,fr etc)
delete the contents of /var/cache/cups/* and restart cupsd-service or restart docker container
@agail
agail / alpine_duo_unix.md
Created March 17, 2022 23:36
Duo Unix 2FA on Alpine Linux install

DUO Unix on Alpine Linux compilation and installation guide

Alpine v3.15

apk add build-base linux-pam-dev openssl-dev
cd /tmp
curl -LO https://github.com/duosecurity/duo_unix/archive/refs/tags/duo_unix-1.12.0.tar.gz
tar xvfz duo_unix-1.12.0.tar.gz
cd duo_unix-1.12.0
./configure --with-pam --prefix=/usr
@agail
agail / tomato-emergency-telnet.sh
Created January 13, 2022 21:01
Activate telnet emergency port on Tomato based firmware
#!/bin/bash
#
# Simple script to trigger the activation of telnet emergency port on Tomato based firmware for SOHO routers
#
device_ip=$1 # Device ip
hold_time=25 # Recommended value 25, increase second by 1 if you have problem to activate the emergency port
max_tries=3 # Wait for device to spawn emergency port
if [ $# -lt 1 ]; then
@agail
agail / jq.md
Created December 13, 2021 15:56
jq version differences

Search if a key contains "myStr"

v1.4:

jq -r --arg str "myStr" '.objects[]|select(.name|contains($str))|"\(.name) \(.type)"'

v1.6:

jq -r --arg str "myStr" '.objects[]|select(.name|test($str))|"\(.name) \(.type)"'

@agail
agail / connectra_rulenums.html
Last active December 10, 2021 11:21
$FWDIR/log/connectra_rulenums.html - sk129292
<table border="1" width=600>
<tr>
<th BGCOLOR="#E6E9EF">Rule number in Tracker</th><th>Connectra Rule</th><th>Connectra Application</th>
</tr>
</table>
@agail
agail / dualethernet.cmd
Last active June 30, 2022 09:00
Dual interface connections - Windows 10
@echo off
::
:: Prohibit connection to non-domain networks when connected to domain-authenticated network
::
:: GPO Path: Computer Configuration/Administrative Templates/Network/Windows Connection Manager/
:: Reg Path: HKLM\Software\Policies\Microsoft\Windows\WcmSvc\GroupPolicy (0|1)
:: Value Name: fBlockNonDomain
:: Value Type: REG_DWORD
:: Values: 0 = Disabled
:: 1 = Enabled
@agail
agail / tls-verify.md
Created October 8, 2021 21:08
Verify SMTP TLS with openssl

Verify SMTP TLS

OpenSSL

openssl s_client -starttls smtp -connect smtp-server:port

If you get dh key too small* append --cipher 'DEFAULT:!DH'

Add -quiet to turn of verbose output