Skip to content

Instantly share code, notes, and snippets.

@x011
x011 / mirrorace.org_upload.py
Last active Mar 8, 2021
Upload files to mirrorace.org using python
View mirrorace.org_upload.py
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
Generate m3u playlists from folders
View m3u_from_dirs.py
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 Jan 12, 2021
Gmail Attachment Downloader 2020
View gmail_attachment_downloader.py
# 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"
View python_printer_gui.py
'''
Project: curinga
Time: 07/03/2020 01:37
'''
import win32api
import win32print
import traceback
from tkinter.filedialog import askopenfilename
from tkinter import *
View python_decode_encode_tkinter.py
"""
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
"""
View EncryptActivity.java
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;
View Encryption.java
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;
View android_decode_text.py
'''
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 Dec 3, 2019
Change Android Studio Package Name
View change_android_studio_pkg_name.py
"""
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
View aws_reko.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import base64
import datetime
import hashlib
import hmac
import simplejson as json
import requests