Skip to content

Instantly share code, notes, and snippets.

@xbb
xbb / opnsense-filterlog.grok
Last active April 22, 2024 12:06
OPNsense filterlog GROK patterns
#
# OPNsense filterlog GROK patterns
# Based on: https://github.com/opnsense/ports/blob/b221352/opnsense/filterlog/files/description.txt
#
# Entrypoint: %{OPNSENSE_FILTERLOG}
#
# TODO: OPNSENSE_CARP
#
OPNSENSE_DIRECTION \bin(?:/out)?|out\b
OPNSENSE_WORD \b[\w-]+\b
@xbb
xbb / README
Last active April 17, 2024 20:21
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@xbb
xbb / op-tsh-login
Created December 5, 2023 12:37
Login to Teleport with 1Password CLI
#!/usr/bin/env bash
set -e
main() {
case $1 in
help) show_help ;;
*) load_profile "$1" ;;
esac
@xbb
xbb / windows-firewall-cleanup.ps1
Last active January 31, 2023 16:10
Removes Windows Firewall program rules pointing to non-existing paths
# Usage: windows-firewall-cleanup.ps1 [-y]
# use -y parameter to actually remove the rules
param(
[switch]$y = $false
)
Get-NetFirewallApplicationFilter | ForEach-Object {
$program = $_.Program
if ([System.IO.Path]::IsPathRooted($program)) {
if (!(Test-Path -Path "$program" -PathType Leaf)) {
@xbb
xbb / README.md
Created November 19, 2022 01:57
Amazon save for later cleaner: removes all the saved for later items from your cart page, read usage below

Amazon save for later cleaner

The scripts deletes one item at a time, waiting for its node removal and 1 second.

It will wait for new items to load in the page, so there is no need to preload the whole list.

Actually, if you preload the whole list before, it will make things slower and worse because every delete request contains all your displayed item list…

Usage:

@xbb
xbb / itch-claim-all.js
Last active July 31, 2022 21:19
itch.io claim all button
// ==UserScript==
// @name itch.io claim all button
// @version 0.2
// @description claims all the items automatically in the download bundle pages, make sure to start from page 1
// @author xbb
// @match https://itch.io/bundle/download/*
// @grant none
// ==/UserScript==
(() => {
const findBackward = (node, callback) => {
@xbb
xbb / tf-guitar-wisdom-speed-control-userscript.js
Last active February 20, 2022 22:23
Video speed control userscript
// ==UserScript==
// @name TF Guitar Wisdom video speed control
// @description Injects a video speed controller in the embedded video frames at TF Guitar Wisdom, visible on mouse over, easily adaptable for other sites
// @version 1.1.0
// @author xbb
// @match https://embed.vhx.tv/*
// @allFrames true
// ==/UserScript==
(() => {
@xbb
xbb / update-terminfo.sh
Last active May 28, 2021 20:29
terminfo termcap update linux freebsd
#!/usr/bin/env sh
set -e
NAMES=xterm,xterm-256color,screen,screen-256color,tmux,tmux-256color
if [ "$(uname -s)" = "FreeBSD" ]; then
curl -o /tmp/termcap.src https://raw.githubusercontent.com/freebsd/freebsd-src/main/share/termcap/termcap
cap_mkdb -vf /usr/share/misc/termcap /tmp/termcap.src
rm /tmp/termcap.src
else
@xbb
xbb / keybase.md
Created September 10, 2019 12:26

Keybase proof

I hereby claim:

  • I am xbb on github.
  • I am xbb (https://keybase.io/xbb) on keybase.
  • I have a public key ASDQg47vqNFwNV0BOjy4d8CzYACqoAKRE99davVVEoD4dAo

To claim this, I am signing this object:

@xbb
xbb / prestashop-autocompletion.php
Created September 12, 2011 10:12
Prestashop autocompletion
<?php
class AbstractLogger extends AbstractLoggerCore {}
class Address extends AddressCore {}
class AddressFormat extends AddressFormatCore {}
class AdminTab extends AdminTabCore {}
class Alias extends AliasCore {}
class Attachment extends AttachmentCore {}
class Attribute extends AttributeCore {}
class AttributeGroup extends AttributeGroupCore {}