Skip to content

Instantly share code, notes, and snippets.

@No767
No767 / 01-free-hosting-bad.md
Last active April 5, 2024 12:03
Explanation of why free hosts for Discord bots are bad

Why Free Hosting is Bad

Contact Noelle for any concerns or questions with this gist

When looking for hosting your bot, free services and/or providers that claim to support hosting Discord Bots. Do not use them. Why? Let me explain.

The Drawbacks

Free hosts are providers who specialize in offering an free platform to host projects.

@709924470
709924470 / create_hardlink_drag_here.bat
Last active February 11, 2024 16:40
Windows quick hardlink
@mttaggart
mttaggart / electron-versions.csv
Last active November 18, 2023 03:15
CVE-2023-4863 Electron App Tracker | THIS LIST IS NOW DEPRECATED. PLEASE VISIT https://github.com/mttaggart/electron-app-tracker FOR THE LATEST DATA
app_name repo electron_version vulnerable
1Clipboard https://github.com/wiziple/1clipboard
1Password None 25.8.1 FALSE
3CX Desktop App 19.0.8 TRUE
5EClient None
Abstract None
Account Surfer None
Advanced REST Client https://github.com/advanced-rest-client/arc-electron ^17.0.0 TRUE
Aedron Shrine None
Aeon https://github.com/leinelissen/aeon 23.2.0 TRUE
@Rapptz
Rapptz / keepass.md
Last active July 19, 2024 13:54
Setting up KeePass

Setting Up KeePass

I frequently see discussions around which password manager to use. I personally use [KeePass][main]. This is an open source program that allows you to have control in your data. The database format is encrypted so as long as you keep your master password secure, the chance of someone getting access to your passwords is practically zero.

This document is just meant as a signpost to steer you in the right direction of how to set up KeePass across multiple operating systems and have your file synced in the cloud all while paying $0 and not having to set up a single server to do so.

Why KeePass?

You can skip this if you don't care

@The-Running-Dev
The-Running-Dev / Create Kavita Directory Structure
Last active February 10, 2024 14:32
Scans a directory of eBooks and creates a direcory and sub directories, with hard links to the actual eBooks.
<#
Save to: Create-Kavita-Structure.ps1
and run it with: .\Create-Kavita-Structure.ps1 -sourceDir 'DriveLetter:\PathToBooks' -kavitaDir 'DriveLetter:\PathToKavitaWatchedDir"
If sourceDir is not specified, assumes current directory (.)
If kavitaDir is not specified, assumes @Kavita under the current directory (.\@Kavita)
To test this without making any changes: Create-Kavita-Structure.ps1 -whatIf
#>
[CmdletBinding(SupportsShouldProcess = $true)]
Param(
@DieselTech
DieselTech / kavita_create_libraries_from_folders.py
Created April 26, 2023 22:34
Scans the top level directory of folders and submits them to kavita's API as their own library path.
import os
import requests
path = "M:\comics" # Replace with the path to your comics || This is for if your running the script on a different machine than your kavita host.
exclude_list = ["Marvel", "DC Comics", "Image"] # Replace with your publisher names to exclude. Thsese are generally the biggest folders in the library and will take a long time to scan.
url = "http://192.168.0.100:3995/api/Library/create" # Change with your own instances URL
jwt_token = "YOUR_JWT_TOKEN"
# Get your own JWT token by going to dev tools in your web browser, opening up the 'Storage' tab and then go to local storage. The token can be tricky to copy and paste since it's crazy long.
"""
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
Copyright (C) 2020 Michael Hall <https://github.com/mikeshardmind>
"""
# Reupload of older stuff in a no longer functional discord bot isolated to single functions
# Summary of edits since isolation from old bot code:
@pinheaded
pinheaded / cog_ext.py
Last active July 22, 2024 15:32
a basic cog + extension example for discord.py v2
from discord import app_commands
from discord.ext import commands
# all cogs inherit from this base class
class ExampleCog(commands.Cog):
def __init__(self, bot):
self.bot = bot # adding a bot attribute for easier access
# adding a command to the cog
@commands.command(name="ping")
@sgtlaggy
sgtlaggy / 1_shared_cursor.py
Last active July 6, 2024 23:40
The perils of shared database connections and cursors
import asyncio
import asqlite
async def shared_cursor():
"""
Expected result:
Each `fetchone` should return a row with a `user_id` matching the passed value.
# Copyright 2020-present Michael Hall
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,