def rclone(configUrl, configPath): HOME = '/content' os.makedirs(f'{HOME}/downloads', exist_ok=True) runSh("sudo apt install rclone") download_file(configUrl, configPath) Popen( f'rclone mount mmm: {HOME}/downloads --config {configPath} --buffer-size 256M --transfers 10 --allow-other'.split() )
def ff_loader(name): HOME = '/content' url = requests.get( "https://ffbinaries.com/api/v1/version/latest" ).json()['bin']['linux-64'][name] urlretrieve(url, f'{HOME}/tools/jellyfin/L{name}.zip') with zipfile.ZipFile(f'{HOME}/tools/jellyfin/L{name}.zip', 'r') as zip_ref: zip_ref.extractall(f'{HOME}/tools/jellyfin/') os.remove(f"{HOME}/tools/jellyfin/L{name}.zip") runSh(f"rm -rf {HOME}/tools/jellyfin/__MACOSX") os.replace(f"{HOME}/tools/jellyfin/{name}", f"/usr/bin/{name}") os.chmod(f"/usr/bin/{name}", 0o755)
def socialFish(USERNAME='******', PASSWORD='******'): USE_FREE_TOKEN = True # @param {type:"boolean"} TOKEN = "" # @param {type:"string"} REGION = "US" #@param ["US", "EU", "AP", "AU", "SA", "JP", "IN"] PORT_FORWARD = "argotunnel" #@param ["ngrok", "localhost", "argotunnel"] HOME = '/content' os.makedirs(f'{HOME}/tools/', exist_ok=True) # Downloading SocialFish if not os.path.exists(f"{HOME}/tools/SocialFish/SocialFish.py"): print("[Installing] Wait for almost 1 minutes...") # runSh('apt install -y texlive-latex-extra') runSh('git clone https://github.com/biplobsd/SocialFish.git', cd=f'{HOME}/tools/') runSh('pip3 install -r requirements.txt', cd=f'{HOME}/tools/SocialFish') os.chmod(f"{HOME}/tools/SocialFish/SocialFish.py", 0o755) if not findProcess("python3", "./SocialFish.py"): runCmd = "./SocialFish.py " \ f"{USERNAME} " \ f"{PASSWORD} &" runSh(runCmd, shell=True, cd=f'{HOME}/tools/SocialFish/') # START_SERVER # Ngrok region 'us','eu','ap','au','sa','jp','in' Server = PortForward_wrapper( PORT_FORWARD, TOKEN, USE_FREE_TOKEN, [['SocialFish', 5000, 'http']], REGION.lower(), [f"{HOME}/.ngrok2/SocialFish.yml", 4063] ) return tunnel(Server, 'SocialFish')
def ghfs(): USE_FREE_TOKEN = True # @param {type:"boolean"} TOKEN = "" # @param {type:"string"} REGION = "AP" #@param ["US", "EU", "AP", "AU", "SA", "JP", "IN"] OUTPUT_DIR = "/" # @param {type:"string"} PORT_FORWARD = "ngrok" #@param ["ngrok", "localhost", "argotunnel"] #HOME = f'{HOME}/content' toolLocation = f'{HOME}/tools/ghfs' binaryF = f"{toolLocation}/ghfs" os.makedirs(toolLocation, exist_ok=True) if not os.path.exists(binaryF): DZipBL = f"{toolLocation}/Zipghfs.zip" urlretrieve( findPackageR("mjpclab/go-http-file-server", "linux-amd64.zip"), DZipBL) with zipfile.ZipFile(DZipBL, 'r') as zip_ref: zip_ref.extractall(toolLocation) os.remove(DZipBL) os.chmod(binaryF, 0o777) if not findProcess("ghfs", "--listen-plain"): runSh(f'./ghfs --listen-plain 1717 -R \ -a ":/:{OUTPUT_DIR}" \ --global-upload \ --global-mkdir \ --global-delete \ --global-archive \ --global-archive \ &', shell=True, cd=f"{HOME}/tools/ghfs") # START_SERVER # Ngrok region 'us','eu','ap','au','sa','jp','in' server = PortForward_wrapper(PORT_FORWARD, TOKEN, USE_FREE_TOKEN, [['ghfs', 1717, 'http']], REGION.lower(), [f"{HOME}/.ngrok2/ghfs.yml", 4171]) return tunnel(server, 'ghfs')
def pyload(): HOME='/content' USE_FREE_TOKEN = True # @param {type:"boolean"} TOKEN = "" # @param {type:"string"} REGION = "SA" #@param ["US", "EU", "AP", "AU", "SA", "JP", "IN"] PORT_FORWARD = "argotunnel" #@param ["ngrok", "localhost", "argotunnel"] os.makedirs(f'{HOME}/downloads', exist_ok=True) os.makedirs(f'{HOME}/tools/pyload', exist_ok=True) urlF = 'https://github.com/pyload/pyload/archive/stable.zip' conf = 'https://raw.githubusercontent.com/biplobsd/' \ 'OneClickRun/master/res/appdata/pyload/pyload.conf' db = 'https://github.com/biplobsd/OneClickRun/raw/master/' \ 'res/appdata/pyload/files.db' urlretrieve(urlF, f'{HOME}/tools/pyload.zip') urlretrieve(conf, f'{HOME}/tools/pyload/pyload.conf') urlretrieve(db, f'{HOME}/tools/pyload/files.db') with zipfile.ZipFile(f'{HOME}/tools/pyload.zip', 'r') as zip_ref: zip_ref.extractall(f'{HOME}/tools/pyload') try: pathlib.Path(f'{HOME}/tools/pyload.zip').unlink() except FileNotFoundError: pass runSh("sudo apt install -y python-pycurl python-qt4 tesseract-ocr libtesseract-dev") runSh("pip2 install pycrypto pyOpenSSL Jinja2 tesseract tesseract-ocr") if not findProcess("python2.7", "pyLoadCore.py"): runCmd = "python2.7 /content/tools/pyload/pyload-stable/pyLoadCore.py" \ " --configdir=/content/tools/pyload" \ " --no-remote" \ " --daemon" runSh(runCmd, shell=True) # START_SERVER # Ngrok region 'us','eu','ap','au','sa','jp','in' Server = PortForward_wrapper( PORT_FORWARD, TOKEN, USE_FREE_TOKEN, [['rcloneConfig', 53682, 'http'], ['pyload', 8000, 'http']], REGION.lower(), [f"{HOME}/.ngrok2/rclonePyload.yml", 4074] ) return tunnel(Server, 'pyload')
loadingAn() # password ganarate try: print(f"Found old password! : {password}") except: password = ''.join( random.choice(string.ascii_letters + string.digits) for i in range(20)) if CREATE_SSH: USE_FREE_TOKEN = False #Set root password if CREATE_SSH and os.path.exists('/var/run/sshd') == False: #Setup sshd runSh('apt install -qq -o=Dpkg::Use-Pty=0 openssh-server pwgen') runW.system_raw("echo root:$password | chpasswd") os.makedirs("/var/run/sshd", exist_ok=True) runW.system_raw('echo "PermitRootLogin yes" >> /etc/ssh/sshd_config') runW.system_raw( 'echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config') runW.system_raw( 'echo "LD_LIBRARY_PATH=/usr/lib64-nvidia" >> /root/.bashrc') runW.system_raw('echo "export LD_LIBRARY_PATH" >> /root/.bashrc') #Run sshd if not findProcess("/usr/sbin/sshd", command="-D"): runSh('/usr/sbin/sshd -D &', shell=True) if CREATE_VNC: clear_output()