Skip to content

Instantly share code, notes, and snippets.

@jgeboski
jgeboski / prometheus-address-collector.py
Created December 10, 2022 23:27
Collector for Prometheus for interface addresses with timing data. Useful with a Cron job in pfSense to export WAN addresses via the node exporter.
#!/usr/bin/env python3.8
import argparse
import logging
import os
import re
import subprocess
import time
from datetime import datetime
from ipaddress import ip_address, IPv4Address, IPv6Address
@jgeboski
jgeboski / xonmaps.py
Last active July 7, 2022 04:05
Gets the latest Xonotic map URLs
#!/usr/bin/env python3
import os
import sys
from glob import glob
from lxml import html
from typing import List, NamedTuple, Optional
from urllib.parse import urljoin
from urllib.request import urlopen
BASE_URL = "https://beta.xonotic.org/autobuild-bsp/"
@jgeboski
jgeboski / CWMP-INSTRUCTIONS
Created January 17, 2014 03:50
Instructions to disable the CWMP interface on OpenRG based routers
Verizon FiOS (and possibly other ISPs) deploy CPE routers based on
OpenRG which enable CWMP (port 4567) by default. The CWMP protocol
enables remote management of the CPE device, however, the protocol can
also enable a remote attacker to obtain unwarranted access. The simple
solution is to disable the CWMP protocol, which is done below. Please
note, this operation is likely unsupported by ISPs, so do the following
at your own risk.
Information on CWMP: http://en.wikipedia.org/wiki/TR-069
@jgeboski
jgeboski / no_images_init.php
Last active December 18, 2021 19:33
Tiny-Tiny-RSS plugin which removes images from the content of articles
<?php
/*
* Copyright 2014 James Geboski <jgeboski@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
@jgeboski
jgeboski / usb-suspend.sh
Last active May 9, 2018 03:54
Script to suspend all USB devices
#!/bin/sh
DEV_ROOT=/sys/bus/usb/devices
read_usb_sysfs() {
cat "$DEV_ROOT/$1/$2"
}
write_usb_sysfs() {
path="$DEV_ROOT/$1/$2"
@jgeboski
jgeboski / hexchat-2.10.2-extend-nick-colors.patch
Created January 27, 2016 01:05
Extend the color range of nicknames in HexChat
diff --git a/src/common/text.c b/src/common/text.c
index 73ea7f9..ece22e4 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -2080,8 +2080,6 @@ pevt_build_string (const char *input, char **output, int *max_arg)
/* also light/dark gray (14/15) */
/* 5,7,8 are all shades of yellow which happen to look damn near the same */
-static char rcolors[] = { 19, 20, 22, 24, 25, 26, 27, 28, 29 };
-

Keybase proof

I hereby claim:

  • I am jgeboski on github.
  • I am jgeboski (https://keybase.io/jgeboski) on keybase.
  • I have a public key whose fingerprint is F44A 4E79 D811 307C E140 5ECA 7A70 989E A209 D93F

To claim this, I am signing this object:

@jgeboski
jgeboski / pbcmd.cpp
Created August 24, 2011 23:09
ZNC module to playback buffers on command
/*
* Copyright (C) 2011-2014 James Geboski <jgeboski@gmail.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*/
#include <znc/Buffer.h>
#include <znc/Chan.h>
@jgeboski
jgeboski / 50-wnic-power
Created September 3, 2015 04:27
NetworkManager dispatcher for disabling WNIC power management
#!/bin/bash
INTERFACE="${1}"
ACTION="${2}"
if [[ "${INTERFACE}" =~ ^wl.+ ]]; then
case "${ACTION}" in
up) iw dev "${INTERFACE}" set power_save off ;;
down) iw dev "${INTERFACE}" set power_save on ;;
esac
diff --git a/steam/steam-api.c b/steam/steam-api.c
index a4ce110..2d42eaf 100644
--- a/steam/steam-api.c
+++ b/steam/steam-api.c
@@ -1336,12 +1336,11 @@ static void steam_api_cb_user_info(SteamApiReq *req, const json_value *json)
}
g_hash_table_destroy(ght);
- req = steam_api_req_fwd(req);