Skip to content

Instantly share code, notes, and snippets.

@mohan3d
mohan3d / SshSensorOperaror.py
Created February 26, 2021 03:12 — forked from gmic/SshSensorOperaror.py
Airflow ssh sensor
class SshSensorOperator(SSHExecuteOperator, BaseSensorOperator):
"""
Wait for some ssh command to succeed.
"""
count = 0
def poke(self, context):
"""
Function that checks for ssh command.
"""
@mohan3d
mohan3d / nitroflare.py
Created February 24, 2019 01:57
nitroflare ftp client with no argparse.
import ftplib
class NitroFlareFTP:
def __init__(self, host):
self.ftp = ftplib.FTP(host)
def login(self, user, password):
self.ftp.login(user, password)
@mohan3d
mohan3d / nitroflare.py
Created February 23, 2019 13:25
nitroflare ftp client.
import ftplib
import sys
class NitroFlareFTP:
def __init__(self, host):
self.ftp = ftplib.FTP(host)
def login(self, user, password):
self.ftp.login(user, password)
@mohan3d
mohan3d / jindosh.py
Last active June 21, 2018 19:48
Dishonored 2 jindosh riddle solver
# http://orcz.com/Dishonored_2:_Jindosh_Riddle_Solution
# https://steamcommunity.com/sharedfiles/filedetails/?id=799586506
# https://www.gamecrate.com/dishonored-2-how-solve-jindosh-riddle-and-lock-and-skip-most-dust-district/14960
# https://kotaku.com/have-you-got-what-it-takes-to-solve-dishonored-2-s-wick-1790056270
import itertools
import operator
COUNT = 5
OPS = (EQUAL, NEXT, LEFT, RIGHT) = ('=', '<>', '<', '>')
@mohan3d
mohan3d / non-ascii-pyopenload.py
Last active February 24, 2018 14:42
create a subclass of OpenLoad to upload non-ascii named files.
import os
import re
import requests
from openload import OpenLoad
class MyOpenLoad(OpenLoad):
def upload_file(self, file_path, **kwargs):
upload_url_response_json = self.upload_link(**kwargs)
@mohan3d
mohan3d / openload.py
Created May 14, 2017 23:48
APILess client for openload.co
import re
import requests
OPENLOAD_URL = 'https://openload.co/'
OPENLOAD_LOGIN_URL = OPENLOAD_URL + 'login'
OPENLOAD_FILE_MANAGER = OPENLOAD_URL + 'account#fileman'
OPENLOAD_ACCOUNT = ''
OPENLOAD_PASSWORD = ''
REGEX = re.compile(r'<input type="hidden" name="_csrf" value="([^"]+)">')
@mohan3d
mohan3d / resize_all
Last active October 31, 2016 19:43
resize all images in a directory using imageMagick.
#!/bin/bash
if [[ $# -lt 2 ]]; then
echo "usage: $0 <directory_path> <args>"
echo "args:"
echo " 50%"
exit 0
fi
full_path=$1