Skip to content

Instantly share code, notes, and snippets.

<?php
include 'vendor/autoload.php';
$config = new \Zoddo\irc\Config('irc.ekinetirc.fr.nf', 'TestPhpIrc');
//$config->setPort(6697)
// ->setSsl();
$connection = new \Zoddo\irc\IrcConnection($config);
$connection->getEvent()->addListener('ping', array(new \Zoddo\irc\EventListener\PingResponder(), 'onPing'));
@Zoddo
Zoddo / os_raw.cpp
Last active January 3, 2016 14:18
/os raw command for Anope 2.0 - DANGEROUS COMMAND!
#include "module.h"
class CommandOsRaw : public Command
{
public:
CommandOsRaw(Module *creator, const Anope::string &sname = "operserv/raw") : Command(creator, sname, 0, 0)
{
this->SetDesc(_("Send a raw command to the uplink server - \037DANGEROUS!\037"));
this->SetSyntax("\037<pseudoclient>\037 \037<command>\037");
this->SetSyntax(":\037<command>\037");
@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': {
@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 / 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";

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 / 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_
@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 / 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"
<?php
$config = [
'dbhost' => 'localhost',
'dbuser' => 'xxxxxxxxx',
'dbpass' => 'xxxxxxxxx',
'dbname' => 'xxxxxxxxx',
];