Skip to content

Instantly share code, notes, and snippets.

View SnowyJaguar1034's full-sized avatar

SnowyJaguar1034 SnowyJaguar1034

View GitHub Profile
@greyblue9
greyblue9 / smtp_gmail.py
Created June 8, 2022 07:33
Send email with smtplib and gmail
# Script to send email with optional
# attachments using gmail
#
import re
import smtplib
from pathlib import Path
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.utils import COMMASPACE, formatdate
@candoom
candoom / promtail_on_proxmox.txt
Created November 21, 2021 18:32
Howto install Promtail on Proxmox
$ wget https://github.com/grafana/loki/releases/download/v2.4.1/promtail-linux-amd64.zip
$ unzip promtail-linux-amd64.zip
$ mv promtail-linux-amd64 /usr/local/bin/
$ ln -s /usr/local/bin/promtail-linux-amd64 /usr/local/bin/promtail
$ useradd --system promtail
$ gpasswd -a promtail adm
$ nano /etc/systemd/system/promtail.service
$ systemctl daemon-reload
$ systemctl start promtail.service
@0xdeepmehta
0xdeepmehta / ReminderBot.md
Created February 21, 2021 09:37
DiscordreminderBot
#!/usr/bin/env python
"""
Name: Notifier
Description: A discord bot to handle schedules.
"""
import os
import discord
import asyncio
import sys
import requests
@InterStella0
InterStella0 / HelpCommand_walkthrough_guide.md
Last active March 16, 2024 09:29
Walkthrough guide on subclassing HelpCommand
@cjgunnar
cjgunnar / bot.py
Created July 14, 2019 04:29
Timecheck bot source code (token hidden)
'''
Timecheck Discord Bot
Reminds those in the list to get on at 2:35, then 2:40
Only works with Python 3.6 as of 4/2/2019
'''
# IMPORTS
import time, datetime, pytz, asyncio
asyncio
import discord
@z1nkum
z1nkum / graphite-grafana-statsd-inside-docker.md
Last active May 10, 2023 08:43
Run graphite-stack inside docker via docker-compose
# getenforce
Disabled

Also we need docker, docker-compose, certbot (if you need LetEncrypt)

mkdir -p /opt/graphite/conf /opt/graphite/data /opt/graphite/storage /opt/statsd /opt/grafana/log

/etc/docker/compose/graphite/docker-compose.yml

@matthewzring
matthewzring / markdown-text-101.md
Last active April 24, 2024 18:43
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@EvieePy
EvieePy / error_handler.py
Last active January 16, 2024 15:12
Simple Error Handling for ext.commands - discord.py
"""
If you are not using this inside a cog, add the event decorator e.g:
@bot.event
async def on_command_error(ctx, error)
For examples of cogs see:
https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be
For a list of exceptions:
https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#exceptions
@jagrosh
jagrosh / Growing A Discord Server.md
Last active February 17, 2024 04:29
Tips for creating and growing a new Discord server

This guide is kept up-to-date as Discord and available resources change!
A basic server template is available here

Creating and Growing a Discord Server

logo

Introduction

Hello! I'm jagrosh#4824! I'm writing this guide to try to help new server owners set up and grow their servers, which is a commonly-requested topic. It's very easy to go about this the wrong way, so it's best to be prepared and make smart decisions so that your community can flourish!

Background

@JaniAnttonen
JaniAnttonen / mongoDump.md
Last active March 18, 2024 09:58
Export Docker MongoDB collection as a JSON file

First, find the container that runs your MongoDB and ssh into it.

Then, find the collection you want to export:

mongo
show dbs
use <database>
show collections
exit