Skip to content

Instantly share code, notes, and snippets.

View bytespider's full-sized avatar

Rob Griffiths bytespider

View GitHub Profile
@bytespider
bytespider / block-operavpn-unifi.md
Last active June 6, 2026 15:21
Blocking OperaVPN (Opera Browser Built-in VPN) on UniFi Cloud Gateway Ultra

Blocking OperaVPN (Opera Browser Built-in VPN) on UniFi Cloud Gateway Ultra

Last tested: June 2026 | UniFi OS version: 10.4.57 | Works on: UCG-Ultra, UDM-Pro, UDM-SE (any UniFi gateway with Policy Engine)

The Problem

Opera's built-in VPN bypasses content filtering, parental controls, and DNS-level blocks on your UniFi gateway. Standard approaches fail:

What people try Why it fails
@bytespider
bytespider / gateway.ino
Created December 5, 2017 17:13
ESP NOW
/**
*
* Author: Andreas Spiess, 2017
* Author: Rob Griffiths
*
This sketch receives ESP-Now message and sends it as an MQTT messge
It is heavily based on of Anthony's gateway setch sketch
https://github.com/HarringayMakerSpace/ESP-Now
Anthony Elder
@bytespider
bytespider / imagick_transparency.php
Created November 8, 2016 10:40
Setting the background colour of a transparent PNG when converted to JPEG
<?php
$image = new Imagick('kiwi.png'); // https://s13.postimg.org/hakfstg1j/kiwi.png
$image->setImageBackgroundColor(new ImagickPixel('white')); // set the background color of the image
$image->setImageAlphaChannel(Imagick::ALPHACHANNEL_BACKGROUND); // ALPHACHANNEL_BACKGROUND is undocumented and has a value of 2
// save a JPEG
$image->setImageFormat('jpeg');
$image->setImageCompression(Imagick::COMPRESSION_JPEG);
#!/bin/bash
PORT=2222
if [ ${VAGPORT} ]; then
PORT=${VAGPORT}
fi
IFS=$'\n'
SSH_CONFIG=($(vagrant ssh-config $1 | sed -e 's/^ *//' -e 's/ *$//'))
#!/bin/bash
PORT=2222
if [ ${VAGPORT} ]; then
PORT=${VAGPORT}
fi
IFS=$'\n'
SSH_CONFIG=($(vagrant ssh-config $1 | sed -e 's/^ *//' -e 's/ *$//'))
public function autoLinkText($text)
{
// a more readably-formatted version of the pattern is on http://daringfireball.net/2010/07/improved_regex_for_matching_urls
$pattern = '/((https?):\/\/)?([\da-z\.-]+\.[a-z\.]+)([\/\w \.-]+)*\/?/i';
$callback = function($matches) {
$url = array_shift($matches);
if (is_null(parse_url($url, PHP_URL_SCHEME))) {
$url = 'http://' . $url;
package main
import (
"fmt"
"net/http"
"github.com/gorilla/mux"
)
func main() {
r := mux.NewRouter()

Keybase proof

I hereby claim:

  • I am bytespider on github.
  • I am bytespider (https://keybase.io/bytespider) on keybase.
  • I have a public key whose fingerprint is AB4E 0D5B C744 98E8 14EE E8D7 1642 B2DF 12CE 8036

To claim this, I am signing this object:

[
{
"keys": ["enter"],
"command": "run_macro_file",
"args": {
"file": "res://Packages/Default/Add Line in Braces.sublime-macro"
},
"context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
/Applications/VirtualBox.app/Contents/MacOS/VBoxManage showvminfo debian --machinereadable
name="debian"
groups="/"
ostype="Debian (64 bit)"
UUID="323105ea-d8f6-4898-ae9e-459b3d642b23"
CfgFile="/Users/rgrif/VirtualBox VMs/debian/debian.vbox"
SnapFldr="/Users/rgrif/VirtualBox VMs/debian/Snapshots"
LogFldr="/Users/rgrif/VirtualBox VMs/debian/Logs"
hardwareuuid="323105ea-d8f6-4898-ae9e-459b3d642b23"