Skip to content

Instantly share code, notes, and snippets.

View AliMirlou's full-sized avatar
👨‍💻
Coding

Ali Mirlou AliMirlou

👨‍💻
Coding
View GitHub Profile
@AliMirlou
AliMirlou / torn-bootlegging-auto-collector.user.js
Last active February 7, 2024 09:22
Automatically copies and collects your online store sales in Torn's Bootlegging crime.
// ==UserScript==
// @name Torn Bootlegging Auto Collector
// @namespace https://github.com/AliMirlou
// @version 0.5
// @description Adds and copies DVDs and collects from Online Store.
// @author Piastasa & Xerac
// @match https://www.torn.com/loader.php?sid=crimes
// @icon https://www.google.com/s2/favicons?sz=64&domain=torn.com
// @downloadURL https://gist.github.com/AliMirlou/32a2972419e2f8b3bdba6384cbb8aaf9/raw/torn-bootlegging-auto-collector.user.js
// @updateURL https://gist.github.com/AliMirlou/32a2972419e2f8b3bdba6384cbb8aaf9/raw/torn-bootlegging-auto-collector.user.js
@AliMirlou
AliMirlou / remove-stale-containers.py
Last active March 25, 2021 08:07 — forked from caruccio/remove-stale-containers.py
Remove stale dockershim containers
#!/usr/bin/env python3
## If you see messages like this on your kubelet journal:
##
## Mar 25 22:36:44 ip-10-0-3-67.ec2.internal dockerd-current[28612]: time="2018-03-25T22:36:44.419126265Z" level=error msg="Handler for GET /v1.24/containers/60532fa8184bdf41e52788194faa1253f1168e3ad4f54f7c159192fe66c4bb1d/json returned error: No such container: 60532fa8184bdf41e52788194faa1253f1168e3ad4f54f7c159192fe66c4bb1d"
##
## use this script to remove dockershim container files from /var/lib/dockershim/sandbox
import os, glob, subprocess
@AliMirlou
AliMirlou / run-ipynb.py
Last active July 25, 2020 06:30 — forked from minrk/checkipnb.py
Run and validate an IPython Notebook non-interactively
#!/usr/bin/env python3
"""
Simple example script for running notebooks and reporting exceptions.
Usage: `run-ipynb.py foo.ipynb [bar.ipynb [...]]`
Each cell is submitted to the kernel, and checked for errors.
"""
import os
@AliMirlou
AliMirlou / ISBN-of-EPUB.py
Created January 14, 2019 19:33
A program to extract ISBN from an EPUB document
import argparse
import re
from zipfile import ZipFile
def get_id_by_tag(text: str):
i1 = text.find('unique-identifier="')
i2 = text.find('"', i1 + 19)
id_start = text.find(">", text.find(text[i1 + 19:i2], i2)) + 1
return text[id_start:text.find("<", id_start)]
@AliMirlou
AliMirlou / download.py
Last active October 7, 2020 11:26 — forked from idolpx/download.py
Python HTTP download with resume and optional MD5 hash checking
#!/usr/bin/env python
import logging
logger = logging.getLogger(__name__)
import argparse
import os.path
import requests
import shutil