Skip to content

Instantly share code, notes, and snippets.

@thedroidgeek
thedroidgeek / nokia-router-cfg-tool.py
Last active April 24, 2024 05:06
Nokia/Alcatel-Lucent router backup configuration tool
#!/usr/bin/env python3
#
# Nokia/Alcatel-Lucent router backup configuration tool
#
# Features:
# - Unpack/repack .cfg files generated from the backup and restore functionnality
# in order to modify the full router configuration
# - Decrypt/encrypt the passwords/secret values present in the configuration

How to setup a practically free CDN using Backblaze B2 and Cloudflare

⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,

@rcx
rcx / delete-all-messages.js
Last active November 9, 2023 19:12 — forked from niahoo/delete-all-messages.js
Delete all your messages in a Discord channel
/*
* Discord: Don't copy stuff into this box
* Me: dOn'T COpy sTuFf iNtO tHIs bOx
*/
clearMessages = function (guild_id, author_id, authToken, deleted = new Set()) {
if (guild_id[0] == "_" && guild_id[guild_id.length - 1] == "_") {
alert("Oops! You forgot to set the guild_id. Please fill it in.")
return;
}
if (author_id[0] == "_" && author_id[author_id.length - 1] == "_") {
@igv
igv / SSimDownscaler.glsl
Last active April 19, 2024 11:26
Tuned for linear-downscaling=no.
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
@kageru
kageru / README.md
Last active March 31, 2022 12:03
Standalone script using Vapoursynth to determine the original resolution of scaled images or videos.

This version is deprecated

I’ve stopped updating this a while ago because some people made a proper respository with a few necessary fixes and changes. Just get this version from now on: https://github.com/Infiziert90/getnative

"""
This project was moved to https://github.com/kageru/Irrational-Encoding-Wizardry.
Don't expect this gist to be updated regularly.
"""
import vapoursynth as vs
import mvsfunc as mvf
import fvsfunc as fvf
from functools import partial
@igv
igv / SSimSuperRes.glsl
Last active April 19, 2024 11:26
Basically it's an accurate sharpener + antiringing. Usage: glsl-shader="~~/SSimSuperRes.glsl"
// SSimSuperRes by Shiandow
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 3.0 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

ImageMagick and FFMPEG commands

Remember that the order of parameters/options is very important.

convert images and save to another dir
convert *.png -set filename:original %t 'export/%[filename:original].jpg'
resize, change dpi and quality