Skip to content

Instantly share code, notes, and snippets.

@Blurazzle
Blurazzle / openbsd-hotplug-cannon-scanner.txt
Last active August 17, 2026 17:34
Canon LiDE 110 openbsd
Solves isues where Scanner only works foor root on OpenBSD
1. Install simple-scan (doas pkg_add simple-scan)
2. Enable hotplugd in OpenBSD (https://man.openbsd.org/hotplugd)
3. Create file /etc/hotplug/attach with content as shown below.
4. Replace id for Canon lIDE 110 (04a9:1909) with your device id.
5. chmod 700 /etc/hotplug/attach
======= attach script =======
#!/bin/sh
@Blurazzle
Blurazzle / openbsd-vmm-networking.txt
Last active August 17, 2026 17:27
OpenBSD VMM Networking
sysctl net.inet.ip.forwarding=1
echo 'net.inet.ip.forwarding=1' | doas tee -a /etc/sysctl.conf
# Toevoegen aan /etc/pf.conf
# NAT
match out on egress from 100.64.0.0/10 to any nat-to (egress)
# DNS
pass in proto { udp tcp } from 100.64.0.0/10 to any port domain rdr-to 8.8.8.8 port domain
pfctl -f /etc/pf.conf
@Blurazzle
Blurazzle / uBlock reddit rules.txt
Last active August 12, 2026 11:05
uBlock reddit rules
! Reddit login/signup modal
www.reddit.com##div#desktop-dynamic-upsell-dialog
www.reddit.com##[id="desktop-dynamic-upsell-dialog"]
! Restore scrolling after hiding Reddit login modal
www.reddit.com##html:style(overflow: auto !important;)
www.reddit.com##body:style(overflow: auto !important;)
www.reddit.com###left-sidebar-container
@Blurazzle
Blurazzle / user.js
Last active August 10, 2026 13:54
FireFox user.js
/*
*wget https://gist.githubusercontent.com/Blurazzle/8003a46dffb44cf20871ae771266dcdb/raw/user.js
*/
/*
* MullVad DoH
*/
user_pref("network.trr.custom_uri", "https://all.dns.mullvad.net/dns-query");
user_pref("network.trr.mode", 2);
user_pref("network.trr.uri", "https://all.dns.mullvad.net/dns-query");
@Blurazzle
Blurazzle / debian.sh
Last active August 10, 2026 12:48
Debian GNOME Install
#!/bin/bash
###
# Update
###
sudo apt update && sudo apt upgrade
sudo apt install thunderbird
###
# GNOME Extensions
@Blurazzle
Blurazzle / LegacySupport.php
Created March 14, 2025 15:43
Polyfill for PHP's Deprecated utf8_encode() Function
<?php
namespace LegacySupport;
/**
* Polyfill for the deprecated utf8_encode() function in PHP.
*
* PHP's built-in utf8_encode() function was deprecated in PHP 8.2 and is scheduled for removal.
* This function is a direct reimplementation of the original algorithm in PHP,
@Blurazzle
Blurazzle / Pdo.php
Last active July 19, 2023 15:20
PDO_ODBC DB2 Adapter for Zend Framework 1 & zf1-future
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
@Blurazzle
Blurazzle / pdo_odbc_ibmi_db2.php
Last active August 10, 2026 12:50
PHP PDO ODBC for IBMi AS/400 DB2
<?php
$UID = '';
$PWD = '';
$dsn = "odbc:Driver={IBM i Access ODBC Driver 64-bit};SYSTEM={IP_ADDRESS};PORT=50000;UID=$UID;PWD=$PWD;";
$pdo = new \PDO($dsn);
$sql = 'SELECT * FROM XXXX LIMIT 10';
foreach ($pdo->query($sql) as $row) {
print_r($row);
@Blurazzle
Blurazzle / xml_toolkit_http.php
Last active August 10, 2026 12:49
IBMi XML Toolkit over HTTP
<?php
// $url = "http://common1.frankeni.com:58700/cgi-bin/xmlcgi.pgm";
$uid = '';
$pwd = '';
$url = 'http://10.230.18.10/cgi-bin/xmlcgi.pgm';
$ixml = "<?xml version='1.0' encoding='UTF-8' ?>\n";