Skip to content

Instantly share code, notes, and snippets.

View mrhalix's full-sized avatar
💭
Call me on telegram

SM. Amin Aleahmad mrhalix

💭
Call me on telegram
View GitHub Profile
@mrhalix
mrhalix / README.md
Last active January 14, 2023 13:46
manifests and kubeconfig template to read-only access to pods on kubernetes

Steps to Generate kubeconfig file

  1. apply manifests
  2. run kubeconfiggen.sh
  3. use registry-cleaner.kubeconfig: KUBECONFIG=/root/registry-cleaner.kubeconfig kubectl get pods -A
@mrhalix
mrhalix / gitlabIssueConverter.py
Last active August 1, 2023 12:58
Replace newlines in gitlab issue exported file's description, mostly needed by UTF-8 people
import re
file = open("issues.csv", "r")
text = file.read()
for i in re.findall(r'\".*?\"', text, flags=re.DOTALL):
text = text.replace(i, i.replace("\n", "'----'")) # replace \n with '----' in issue title and description
newf = open('issues-fixed.csv', 'w')
newf.write(text)
newf.close()
@mrhalix
mrhalix / RIPE ASN Parser.py
Last active November 27, 2022 08:58
Parse txt file from https://ftp.ripe.net/ripe/stats/membership/alloclist.txt , and optionally export it as csv
import requests
import re
alloclist = requests.get("https://ftp.ripe.net/ripe/stats/membership/alloclist.txt")
def splitter(text):
splitted = {}
current_company = []
for i in text.split("\n"):
if i == '': continue
if re.match("([A-z][A-z])\.(.*)", i): # means processing a new block
current_company = splitted[i] = []
@mrhalix
mrhalix / nassaabfreer.py
Created October 31, 2021 20:56
one-click Download and Sideload any app no matter if you purchased it from nassaab.com !! :)
"""
Steps to use this script:
1. Jailbreak your iOS device
2. Install a proper terminal on your device
3. Install Python3 on your device
4. Change email addresses in this code to the email that has the app purchased. for example admin's email of the whole system :))
5. Run the code
6. Fill the information you're asked for
7. Click on install button
8. Wait for Installation process to finish
@mrhalix
mrhalix / functions.py
Created October 31, 2021 20:49
Raspberry Pi, Python 2 Music player from RadioJavan, Controlled by a Flask Webserver
import requests, json, os, subprocess, vlc, sys
from os.path import basename
def mp3fromURL(url):
"""
Catch MP3 file from spotify share url.
"""
try:
print "Downloading MP3 File ..."
response = requests.get("http://receiverdl.com/api/extract/action.php?link=" + url + "&isNoFilter=1")
#response = """{"status":"ok","message":"it's ok","groups":[{"title":"Musics","items":[{"title":"Imagine Dragons - Believer.mp3","link":"http:\/\/receiverdl.com\/api\/extract\/music\/Imagine%20Dragons%20-%20Believer.mp3"}]}]}"""
@mrhalix
mrhalix / outline_manager.py
Created October 31, 2021 20:42
Outline VPN Manager for Python as a Telegram Bot!
#!/usr/bin/python
"""
Outline VPN Manager for Python as a Telegram Bot!
Simply change API_TOKEN, SERVER_MANAGEMENT_BASE_URL and YOUR_ID to your own options.
"""
import telebot
import requests
import json
from telebot import types
API_TOKEN = 'YOURTOKEN'
@mrhalix
mrhalix / carpino_cli.py
Created October 31, 2021 18:57
# Iranian Map And Taxi Services APIs
import requests, json
class Carpino:
def __init__(self):
pass
def price(self, org_lat, org_lng, dest_lat, dest_lng):
cookies = {}
headers = {
'Authorization': 'Bearer eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiZGlyIn0..C8VYlbDlko521a7a.vaxGIHrj9BoiZynCZ4YuBjqrs3ecCmvSD2WNYTZHbuwNFPJ-HKhDO05qUKxu_QMjBXKyHvlc568vTO20Dor0FaUPwSB_dTlMKmpZfmNegm-x0C2eQotbloMf_KSLCoYXjVwBcON-BqjEIn_ggsaHOfoYbSAsiDNStUNoQuhNgwZRoMgSNNHgduA1-hKFgdTJsu1bNSbZG8O8XNjHYnOqo0f__jonmEErf0YdAqwU5p3GOjjtwxda4S88Q-sGSr6jEvxa4_iTD3ZiaR4XcdGUfB8O6WMQ0mWgZM02wzt1JdYs66con0ud2sfyjFELqqrb4VkMoip5diEZmx1qlHQF1Y7eZ4Q43WRZyPKhntX7q5L4TIL_AM7JiZUGFUal7vzPuM4lg7beh8luOryI3yrIo6k3Jlfpf7cZ9e5vYZeIGy3Xc9_zstcBIqml1KkjoMY6Riah3ALxf4kq-rnjxQtIPzhwvTgzG7rE-wO_ZsWh4hHTb-IKGcLuaAW6Nn-AH1ZNXxeRc7QzV0cZdmF8wdoNMu7mqVbR2BzqLbGH2A1tKH2kA3CgCdApARxlItM5KIJbillR95xE_BdgjsANhG5s.SeBwY6OaOC3oSd4rCOqmqQ',
'Accept-Language': 'fa',
'Connection': 'Keep-Alive',
@mrhalix
mrhalix / template.txt
Created May 28, 2019 11:08
Telegram instantview template used for https://aminaleahmad.ir, adding some changes might get it to work for you too!
# Use Instant View version 2.0
~version: "2.0"
@datetime(-2): /html/head/meta[11]
published_date: $@
# Get article text in <article>
body: //article
import telebot
# Replace API_TOKEN with your token, which can be gotten through @botfather .
API_TOKEN = 'XXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
bot = telebot.TeleBot(API_TOKEN)
@bot.message_handler(commands=['help', 'start'])
def send_welcome(message):
bot.reply_to(message, "Hi there, I am EchoBot.")
@mrhalix
mrhalix / rjcli.py
Last active September 25, 2019 16:44
RadioJavan basic command line client
import requests, json
query = input("Enter song name: ")
print("[*]Searching for " + query + "...")
# make a request to rj API to search the query
jssearch = requests.get("https://app1.rjapp.cc/api2/search?query=" + query)
jdatsearch = json.loads(jssearch.text)
# add song IDs to a list(songsIDs) and print the results