Skip to content

Instantly share code, notes, and snippets.

View spookyahell's full-sized avatar
🌐
Browsing the WWW (and helping others and myself get through life)

spookyahell

🌐
Browsing the WWW (and helping others and myself get through life)
View GitHub Profile
@spookyahell
spookyahell / cityweatherdata.json
Created July 16, 2019 00:01
Weather data from https://hooge104.shinyapps.io/future_cities_app/ but in a format that suits JSON more
{
"Ljubljana": {
"listno": 1,
"future_climate_city": "Virginia Beach",
"increase_annual": 3.5,
"increase_warmest_month": 8,
"increase_coldest_month": 5.7
},
"Belgrade": {
"listno": 2,
@spookyahell
spookyahell / bottools.py
Created June 2, 2019 11:20
python telegram Bot tools - import some more advanced features easily into any bot
from telegram.ext import CommandHandler
import speedtest
import time
def ping_pong(dispatcher):
def ping_pong_func(bot, update):
if update.message.text.startswith('/ping'):
update.message.reply_text('Pong!')
else:
update.message.reply_text('Ping!')
@spookyahell
spookyahell / HackerOne and Secuirty - don't think so.md
Last active July 16, 2019 00:09
IMO: Not everywhere security is really taken seriously enough... | Quora Security Alert

HackerOne and Security? - Highly doubt it! | Quora Security Alert

Hard to believe but the moderators of HackerOne didn't think the impact is high enough. I am now sharing the details with ANYONE as this IS a threat...

Would you always think a digest email contains a login link? I don't! And I don't think anyone else should...

Screenshot HackerOne

@spookyahell
spookyahell / internetCheck.py
Last active February 4, 2019 22:05
Check the internet connection reliably... firefox is faster due to transferring less data and as we know is also more safe... Google is maybe even more reliable (never seen detectportal down though either)
import requests
def CheckNet(source = 'F'):
sources = {'G':'https://www.google.com','F':'http://detectportal.firefox.com/success.txt'}
find_in_text = {'G':'maxlength="2048" name="q"','F':'success'}
if source in sources:
src = sources[source]
else:
raise NotImplementedError('Source unavailable')
try:
@spookyahell
spookyahell / convert.py
Last active February 1, 2019 12:57
Convert a filename with spaces
import re
from copy import copy
def convertToDotted(stri):
output = ''
previous_char = None
for char in stri:
x = re.fullmatch(r'\w', char)
@spookyahell
spookyahell / ttml2srt3.py
Last active February 4, 2019 22:06
!!!Only for timcodes with frame expressions!!!
'''The simplest of all TTML to SRT subtitle converters, might not work in every case but it works for me'''
from xmltodict import parse
import json
def zfillseconds(input):
secondsP1, secondsP2 = input.split(',')
secondsP1 = secondsP1.zfill(2)
while len(secondsP2) != 3:
secondsP2 += '0'
@spookyahell
spookyahell / transfershTelegramBot.py
Last active January 7, 2019 22:56
Telegram bot for interacting with transfer.sh
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove
from telegram.ext import CommandHandler, Updater, CallbackQueryHandler, Filters, MessageHandler
import os
import json
import logging
import requests
import re
from urllib.parse import unquote
'''Transfer.shBot operating on Telegram: @transfersh2bot
@spookyahell
spookyahell / peinfo.py
Last active January 2, 2019 15:33
tracking exe version online (with ETag)
import pefile
import pprint
def get_version_info(file):
pe = pefile.PE(file)
string_version_info = {}
for fileinfo in pe.FileInfo[0]:
if fileinfo.Key.decode() == 'StringFileInfo':
@spookyahell
spookyahell / pythonBackup.py
Created January 1, 2019 16:01
What better way to backup Python files (and related docs) then by a simple python script?
from os import listdir, sep
from os.path import isfile, isdir, join
import zipfile
import time
from sys import stdout
zip_filename = time.strftime('pythonBackup-%Y%m%d-%H%M%S.zip')
zf = zipfile.ZipFile(zip_filename,'w')
archive_these = {r'C:\Users\XYZ\Desktop\Python':'PythonFilesOnDesktop'}
@spookyahell
spookyahell / exe2version_info.py
Last active November 6, 2023 09:14
Using the python pefile lib to extract version information from an exe file
'''Licensed under the MIT License :)'''
import pefile
import pprint
pe = pefile.PE('example.exe')
string_version_info = {}
for fileinfo in pe.FileInfo[0]: