Skip to content

Instantly share code, notes, and snippets.

--- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2020-06-30 13:36:05.000000000 +0200
+++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js-new 2020-07-12 12:43:34.704855306 +0200
@@ -450,6 +450,9 @@
},
checked_command: function(orig_cmd) {
+ orig_cmd();
+ return; // Neutralize the API request
+
Proxmox.Utils.API2Request(
@Zoddo
Zoddo / simplehttp.service
Last active June 27, 2020 18:10 — forked from funzoneq/simplehttp.service
A systemd file for a python SimpleHTTPServer with some hardening
# Based of https://gist.github.com/funzoneq/737cd5316e525c388d51877fb7f542de
[Unit]
Description=Job that runs the python SimpleHTTPServer daemon
Documentation=man:SimpleHTTPServer(1)
After=network.target
[Service]
Type=simple
AmbientCapabilities=CAP_NET_BIND_SERVICE
<?php
$config = [
'dbhost' => 'localhost',
'dbuser' => 'xxxxxxxxx',
'dbpass' => 'xxxxxxxxx',
'dbname' => 'xxxxxxxxx',
];
@Zoddo
Zoddo / 10-local.rules
Created May 2, 2020 12:48
Gammu config
# /etc/udev/rules.d/10-local.rules
SUBSYSTEMS=="usb", ACTION=="add", ENV{.ifNumber}="%s{bInterfaceNumber}"
SUBSYSTEM=="tty", ACTION=="add", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1001", ENV{.ifNumber}=="00", SYMLINK+="phone"
@Zoddo
Zoddo / Lookup.js
Created August 21, 2018 13:13
Discord Bans Lookup class
"use strict";
const fetch = require('node-fetch');
const ENDPOINT = 'https://bans.discord.id/api/check.php';
const MAX_USERS = 99; // The API accepts up to 99 users per call
class Lookup {
constructor(token, {interval, cacheSize, cacheLife} = {}) {
Object.defineProperty(this, 'token', {value: token, enumerable: false, writable: true});
this.interval = interval || 1000; // 1 sec - The API is currently not rate-lmited, but, be safe, and don't make more than 60 requests per minute.
@Zoddo
Zoddo / authorized_keys
Last active August 8, 2022 22:29
A script to use as an authorized_keys forced command to allow only SCP within a defined directory
# VM Web
from="192.0.2.1,2001:db8::/32",command="~/force_scp.sh ~/backups/web/",restrict ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDINUz0eaXjFgBSwQpnx/T2DtwO+QRpFGJ5cMOUCtzOpHOcH0gfcFL9ESbXTovnTBGlfjTMy4QLy90uf9YJa2RQEusIiU4Ov7WOZKD2A1/MoYEJ+3kflve6+eh+r7X4yt5jUUWReNjX7a1tT3b99GzEc9WORVNmmFz3NtHPeGb6opodgrLbkaF+7HUJWrnc4xt3oI4qlENkQnJRHWe1IUzuOLpXpxnGvjyIyyZoj5iNRYHmCkiFqoKaxZ2HyKpMRF/dO3bNF3fCReaXZu0GalJvby45ka2cT6uGqm1iVUU1VqSnZU67ams2uK4FqQGj2dalId6ETAGaH8ZeZaMGuUYt root@web
# VM Web2
from="192.0.2.1,2001:db8::/32",command="~/force_scp.sh ~/backups/web2/",restrict ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKM/LkWlD49eXbsncwUjUuREkBCuhVhwCAJSHci4QIDZ+EU108W1Q0o83QTF5bB+oXrj8FbQ/ZqnLAxqP1qrrMD7Sz99ytY49M7Hxlj68JnsXZCvHO0ePWHYsWes5xNeMEmqd/K8vbNKRzG3XI+3px3px0PM3r8mjaHwF/6E+M64XH/GZ4kZVmk68d+Ohp6omlMABNYuu3eXBV2LyXt10lEA3slP2DAi6rUmek5lFxfWNx3nXrJgM0FmZrXqrwe3mHKvmryHmxzUAx7KQy7gTU0gzp0FEZfHve9vWQUsSudwCNpqbj15BkaoEAyuu8vcb/N3sBDxWwV/PVsXlrXbT5 root@web2
# VM syadmin
from="192.0.2.1,2001:db8::/32",command="~/force_

Keybase proof

I hereby claim:

  • I am zoddo on github.
  • I am zoddo (https://keybase.io/zoddo) on keybase.
  • I have a public key ASA5j1YNp9seAjmiDr1DfbTsbL1UIIc4E-Qb3gWk2hEkrwo

To claim this, I am signing this object:

@Zoddo
Zoddo / 1_pf_identd_proxy.php
Last active October 29, 2016 20:22
A script to proxy identd requests to hosts NAT'd with PF (Packet Filter) on FreeBSD (for pfSense for example)
<?php
const MAX_PORT = 65535;
const REGEX_V4 = '#^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(\d{1,5})$#';
const REGEX_V6 = '#^([0-9a-f:])\[(\d{1,5})\]$#';
// Listen TCP port 113
$srv = socket_create_listen(113);
if (!$srv) {
echo "Unable to bind the server on port 113: " . socket_strerror(socket_last_error()) . "\n";
@Zoddo
Zoddo / gist:6407aabed53f03ef3ecfa04bbbd062d8
Last active October 2, 2016 02:16
AntiNoisyBot commands
All commands must be sent in the control-channel, prefixed with "!" or in another channel, prefixed with "AntiNoisyBot: ".
ping [<string>]
Reply "pong <string>"
monitor #<channel> [report_only] Restrict to flag "a"
Adds the channel to the list of monitored channel. If report_only is used, the bot will only
report detections on the control-channel.
@Zoddo
Zoddo / codes.js
Created April 13, 2016 22:09
Modified node-irc
module.exports = {
'001': {
name: 'rpl_welcome',
type: 'reply'
},
'002': {
name: 'rpl_yourhost',
type: 'reply'
},
'003': {