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 / 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 / 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 / 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
@d-Rickyy-b
d-Rickyy-b / pingTest.go
Created June 6, 2021 22:29
Minimal working example for debugging an issue with go-ping/ping
package main
import (
"github.com/go-ping/ping"
"log"
"time"
)
func execPing(ipAddress string) (bool, error) {
pinger, err := ping.NewPinger(ipAddress)
@d-Rickyy-b
d-Rickyy-b / pageant_instructions.md
Created April 12, 2020 19:43
How to make pageant load your ssh keys and start putty afterwards

How to make pageant load your ssh keys and start putty afterwards

For me it used to be very annoying to always manually start pageant, load my key(s) one by one, enter their passwords and then manually start putty. So I thought of an easy way to automate that process. And luckily we don't even need any kind of script for that. Just a single link, that will open pageant with our specified key(s) and afterwards will run putty. Here you can see how that works!

Instructions

  1. Create a new link to your pageant.exe
  2. Open the link's properties
  3. Go to the tab "Link properties" and enter "C:\path\to\pageant.exe" "C:\path\to\key.ppk" -c "C:\path\to\putty.exe"
  4. Take the path of the pageant's directory and enter it in "Start in" field.
@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.