Skip to content

Instantly share code, notes, and snippets.

@x011
x011 / mirrorace.org_upload.py
Last active August 8, 2022 18:50
Upload files to mirrorace.org using python
from requests import Session
import mimetypes
from pathlib import Path
"""
Coded for https://stackoverflow.com/questions/66393210/how-can-i-send-api-request-through-python-for-mirrorace-org
"""
def get_mime(f):
@x011
x011 / m3u_from_dirs.py
Created May 16, 2020 22:27
Generate m3u playlists from folders
import glob
all_dirs = glob.glob("/path/to/dir/with/subfolders/*/") # path to dir containing subdirs with musics
for mdir in all_dirs:
dir_name = mdir.split("/")[-2]
playlist_path = f'{mdir}{dir_name}.m3u'
print(playlist_path)
#continue
@x011
x011 / gmail_attachment_downloader.py
Last active January 12, 2024 10:18
Gmail Attachment Downloader 2020
# Made for: https://stackoverflow.com/questions/61366836/download-attachment-from-mail-using-python/
import os
from imbox import Imbox # pip install imbox
import traceback
# enable less secure apps on your google account
# https://myaccount.google.com/lesssecureapps
host = "imap.gmail.com"
'''
Project: curinga
Time: 2020/03/07 01:37
'''
import win32api
import win32print
import traceback
from tkinter.filedialog import askopenfilename
from tkinter import *
"""
If you have problems importing PyQt5, just comment:
# from PyQt5.QtWidgets import QApplication
# all def center(): ...
# center(rootWin)
It just centers the window on screen
"""
package dk.meznik.jan.encrypttext;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
package dk.meznik.jan.encrypttext.util;
import android.util.Base64;
import java.io.UnsupportedEncodingException;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
'''
Project: curinga
Time: 27/02/2020 04:45
'''
import base64
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
@x011
x011 / change_android_studio_pkg_name.py
Last active December 3, 2019 12:56
Change Android Studio Package Name
"""
Notes:
1 - This script it for python3
2 - Create a backup first
3 - Place on the root folder of the android project you want to change
4 - run `python change_android_studio_pkg_name.py`
5 - Type the old package name
6 - Type the new package name
7 - Clean and Rebuild on Android Studio
8 - SRC folder names won't be changed but app will work
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import base64
import datetime
import hashlib
import hmac
import simplejson as json
import requests