Skip to content

Instantly share code, notes, and snippets.

sh4dowb /
Last active Aug 7, 2020
Netherlands IBAN account number checksum validator
# Netherlands account number algorithm uses this factor table:
# digit | factor
# 1st | 10
# 2nd | 9
# ...
# 10th | 1
# After multiplying digits according to the table, sum of these results must be divisible with 11
sh4dowb / untitled.php
Created Jun 29, 2020
deobfuscator for "<?php /* İoncube Copyright © */ "
View untitled.php
$file = 'file.php';
// this script deobfuscates php files that start like this:
// <?php /* İoncube Copyright © */ eval(base64_decode(...
// overrides "hash check" function before including the script, so we can modify the code
// then last "eval" is modified with another function with same length, "eeer", which writes the result to a file
// function name has to be same length because it parses the obfuscated code with substring
// to use, edit $file variable and run this script. it will output file.php.deobfuscated.php
sh4dowb /
Last active Jun 19, 2020
python3 gettext ascii codec can't decode - even after headers - pygettext and msgfmt

getting this error while using gettext on python?

Traceback (most recent call last):
  File "/usr/lib/python3.8/", line 613, in translation
    t = _translations.setdefault(key, class_(fp))
  File "/usr/lib/python3.8/", line 261, in __init__
sh4dowb / goupload
Created Jun 18, 2020 — forked from rewida17/goupload
Upload files to via api. Required curl and jq
View goupload
#Simple test/help
if [[ "$#" == '0' ]]
echo -e '\nPlease Select File\n'
#Great, file selected.. Lets upload that..
elif [[ "$#" == '1' ]]
sh4dowb /
Last active Jun 18, 2020
telethon capture multiple events - capture button and/or text event
def press_or_text(user_id):
return events.Raw(func=lambda e: (type(e) == UpdateNewMessage and e.message.from_id == user_id) or (type(e) == UpdateBotCallbackQuery and e.user_id == user_id and != b'cancel'))
whatever = await conv.wait_event(press_or_text(sender))
if type(whatever) == UpdateBotCallbackQuery and in [b'create', b'list']:
# button clicked
# not actual event like "CallbackQuery", you can't use .edit() etc. directly
# message sent
sh4dowb / gist:861934f2d0472400c6f9a764b4b7589d
Last active Jun 15, 2020
telethon get if participant is admin
View gist:861934f2d0472400c6f9a764b4b7589d
from import ChannelParticipantCreator, ChannelParticipantAdmin
from import GetParticipantRequest
async def handler(event):
participant = await client(GetParticipantRequest(channel=event.original_update.message.to_id.channel_id,user_id=event.original_update.message.from_id))
isadmin = (type(participant.participant) == ChannelParticipantAdmin)
iscreator = (type(participant.participant) == ChannelParticipantCreator)
sh4dowb / eba-canli-ders.js
Created Apr 13, 2020
EBA canlı ders için Linux ve Mac desteği (Zoom)
View eba-canli-ders.js
EBA canlı dersleri Zoom kullanıyor.
Bağlantı için kendi uygulamalarını kullanıyorlar, fakat Linux (ve muhtemelen Mac) için destekleri yok.
Çok basit bir şekilde Zoom uygulamasını başlatmak yerine kendi Zoom uygulamalarına yönlendirip,
ordan Zoom'u başlatıyorlar. Bunun yerine id ve token'i alıp direk Zoom'u başlatan bir script yazdım
ki Linux ve Mac kullanıcıları da bundan yararlanabilsin.
1- Zoom uygulamasını cihazınıza kurun.
2- adresine gidin, gerekli girişleri yapın, Canlı Dersler sayfasına gelin
sh4dowb /
Created Apr 13, 2020
linux spotify media keys are sometimes not working after another media is played, and spotify is restarted. this command fixes it
dbus-monitor | grep --line-buffered interface=org.mpris.MediaPlayer2.Player | grep --line-buffered -v spotify | awk -W interactive -F'member=' '{print $2}' | xargs -L1 -I {} dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.{}
# when you play another media, and restart spotify, media keys get sent to another destination.
# in my case, it was VLC. output from dbus-monitor:
# method call time=1586780292.910122 sender=:1.58 -> destination=org.mpris.MediaPlayer2.vlc serial=1878 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=PlayPause
# so I piped together a few commands, which got the wrong dbus output, and forwarded it to spotify.
# run:
# bash &
sh4dowb /
Last active Apr 4, 2020
workaround for selenium to save the goddamn session / profile completely on firefox / geckodriver --- selenium firefox geckodriver persistent profile
# Selenium does not use the given profile, but copies it, and uses a temporary profile.
# As a result, new cookies and sessions etc. are not saved.
# To fix it, we get the actual profile firefox is using, kill firefox manually so geckodriver
# doesn't delete profile data. Copying the profile when it's being used is generally not a good idea.
# After killing firefox profile and databases are unlocked, we copy the "temporary" profile
# to our old profile.
# driver.profile doesn't provide the actual temporary profile, but another copy of it. And firefox
# does not use that one. that's why I got it from process list.
sh4dowb / phpkoru.deobfuscate.php
Created Mar 25, 2020 deobfuscator. Make sure to run it isolated, to prevent any attacks from eval'd code
View phpkoru.deobfuscate.php
$input = file_get_contents("untitled.php");
//edit this filename
$fge_ebg13 = "str_rot13";
$onfr64_qrpbqr = "base64_decode";
$eha_pbqr = "cnVuX2NvZGU=";
You can’t perform that action at this time.