Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nyuszika7h on github.
  • I am nyuszika7h (https://keybase.io/nyuszika7h) on keybase.
  • I have a public key whose fingerprint is 708C A9A5 38A5 1A4B CD30 B412 4844 8E83 ACB1 6B55

To claim this, I am signing this object:

#!/usr/bin/env python
# Quick and dirty IRC triviabot script
testing = False # test bot *offline* using stdin/stdout debug shell
lurkmode = False # "lurk" mode - ask questions infrequently
exec_shell = False
# - based somewhat on example code at http://www.osix.net/modules/article/?id=780
# - based on ircbot.ps by darkf
# - got some help from reading old stackoverflow pages:
@0xallie
0xallie / README.md
Last active August 29, 2015 14:22
Script to run supybot-botchk in crontab

Make sure to configure the pidfile in your bot before adding this script to crontab, or else it will spawn lots of copies!

config pidfile botname.pid
flush

Edit the script and fill in the bot's directory, pidfile and config file. Then put something like this in your crontab:

@0xallie
0xallie / autoghost.py
Last active August 29, 2015 14:25
WeeChat auto-ghost script
# Copyright 2015, nyuszika7h <nyuszika7h@openmailbox.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015, nyuszika7h <nyuszika7h@openmailbox.org>
# Copyright 2015, fwilson <fwilson@fwilson.me>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@0xallie
0xallie / musortv.sh
Last active September 1, 2018 21:25
#!/bin/bash
#
# Példa: ./musortv.sh cimek.txt CARTOON 2018 05 01 08 31
cimek=$(<"$1" tr '\n' '|' | sed -r 's/\|$//')
csat=$2
ev=$3
kho=$4
knap=$5
vho=$6
@0xallie
0xallie / sign_theplatform.py
Last active May 29, 2019 21:25
Sign theplatform.com URLs using the key and secret
#!/usr/bin/env python3
import hashlib
import hmac
import time
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
def build_qs(qs):
"""Build a query string from a dict"""
@0xallie
0xallie / vs_applyrange.py
Last active January 15, 2020 01:57
VapourSynth ApplyRange function
def ApplyRange(clip, start, end, filt):
last_frame = len(clip) - 1
if end <= 0:
end = last_frame + end
filtered = filt(clip.std.Trim(start, end))
if start > 0:
ret = clip.std.Trim(0, start - 1) + filtered
else:
@0xallie
0xallie / gencrossfade.sh
Last active February 28, 2020 06:36
Generate ffmpeg command to crossfade audio files
#!/usr/bin/env bash
duration=$1
shift
if ! [[ "$duration" =~ ^[0-9]+$ ]]; then
printf '%s: error: first argument must be an integer (crossfade duration in seconds)\n' "$0" >&2
exit 1
fi
#!/usr/bin/env python3
import argparse
import json
from datetime import datetime
import bs4
import pytz
import requests
import tzlocal