Skip to content

Instantly share code, notes, and snippets.

View d-Rickyy-b's full-sized avatar
💻
Hack the planet

Rico d-Rickyy-b

💻
Hack the planet
View GitHub Profile
@d-Rickyy-b
d-Rickyy-b / rgb_to_hsi.py
Created November 8, 2017 08:46
RGB to HSI
# Script to convert RGB to HSI
import math
def rgb_to_hsi(R, G, B):
def get_H():
if B < G:
return get_c()
else:
return 360 - get_c()
@d-Rickyy-b
d-Rickyy-b / DateSwitcher.ps1
Created November 13, 2017 15:40
A simple script for changing the creation date and the modify date of files of a folder
# This script switches the file "creation time" with the file "last modified" time
# Scripted by d_Rickyy_b on 11.09.2017
# Telegram: https://t.me/d_Rickyy_b
# Usage: scriptName.ps1 [-path] C:\path\to\folder [-filter] "*.txt"
# Both parameters are optional!
param (
[string]$path = $PSScriptRoot,
[string]$filter = "*"
)
@d-Rickyy-b
d-Rickyy-b / main.py
Last active May 27, 2022 11:05
Introduction to bot programming
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=W0613, C0116
# type: ignore[union-attr]
# This program is dedicated to the public domain under the CC0 license.
# Source: https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot.py
"""
Simple Bot to reply to Telegram messages.
@d-Rickyy-b
d-Rickyy-b / config.py
Created March 4, 2018 20:15
Sample configuration file for Python-GuardianBot
BOT_TOKEN = "1234567890:ABCDEFGHIJKLMNOPQRSTUVW123456"
admin_channel_id = -999999999999
admins = [987654321, 123456789]
chats = [-1111111111111]
# Allowed chats for AllowedChatsFilter
whitelisted_chats = [-999999999999, -888888888888]
# Allowed channels for ChannelForwardFilter
@d-Rickyy-b
d-Rickyy-b / test_timeout.py
Created March 15, 2018 17:36
Code for checking out the timeout of answerCallbackQuery of the Telegram bot API. After ~15 seconds you get the Telegram error QUERY_ID_INVALID
import logging
import time
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.error import BadRequest
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler
BOT_TOKEN = "<BOT_TOKEN>"
logger = logging.getLogger(__name__)
@d-Rickyy-b
d-Rickyy-b / install.sh
Last active December 24, 2022 21:58
Install script for grocy on a fresh debian installation
#!/bin/bash
cd /var/www/html
rm index.html
version="2.7.1"
wget -q "https://github.com/grocy/grocy/releases/download/v${version}/grocy_${version}.zip"
unzip "grocy_${version}.zip"
rm "grocy_${version}.zip"
chown www-data: /var/www/html -R
@d-Rickyy-b
d-Rickyy-b / geizhalsbot.service
Created November 24, 2018 21:36
Simple systemd service for the GeizhalsBot
[Unit]
Description=Python-GeizhalsBot
[Service]
Type=simple
ExecStart=/opt/bots/Python-GeizhalsBot/.venv/bin/python3 /opt/bots/Python-GeizhalsBot/main.py
WorkingDirectory=/opt/bots/Python-GeizhalsBot
User=botFather
[Install]
@d-Rickyy-b
d-Rickyy-b / asb_filterlist.txt
Created April 20, 2019 22:07 — forked from quantenProjects/asb_filterlist.txt
Axel Springer Blocker List for uBlock. Content from: https://goo.gl/D3u0Tz feel free to comment if changes are required. And for the people from Springer, this here is art or satrie or anything other inocent ;)
! content from https://goo.gl/D3u0Tz
axel-springer-akademie.de
ein-herz-fuer-kinder.de
ikiosk.de
bild.de
bz-berlin.de
welt.de
n24.de
autobild.de
sportbild.de
@d-Rickyy-b
d-Rickyy-b / csgo_parser.py
Last active February 3, 2024 18:53
Parses csgo files.
import time
from lark import Lark
from lark import Transformer
import json
# Data holder classes used for parsing
class Pair(object):
def __init__(self, name, value):
self.name = name
@d-Rickyy-b
d-Rickyy-b / main.py
Created February 28, 2020 00:35
Sample config for pastepwn
# -*- coding: utf-8 -*-
import logging.handlers
import os
from pastepwn import PastePwn
# Import new actions here - you need to import each action prior to using it
from pastepwn.actions import EmailAction, IrcAction
# Import new analyzers here - you need to import each analyzer prior to using it
from pastepwn.analyzers import MailAnalyzer, WordAnalyzer