Skip to content

Instantly share code, notes, and snippets.

Adriano Di Luzio aldur

  • It
Block or report user

Report or block aldur

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aldur
aldur / __init__.py
Created Apr 5, 2018
Python Logging Boilerplate
View __init__.py
#!/usr/bin/env python3
# encoding: utf-8
"""TODO: Package description."""
import datetime
import logging
import os
# Configure logging.
View README.md

Root OnePlus5 without unlocking the bootloader

Gain adb root.

$ adb shell am start -n com.android.engineeringmode/.qualcomm.DiagEnabled --es "code" "angela"

Download Magisk-v14.0 and extract it somewhere. Download MagiskManager.

@aldur
aldur / README.md
Created Dec 19, 2016
Emoji to JSON
View README.md

Emoji to JSON

A simple Python script to extract unicode emojis from this page and store their details in a JSON file. Additionally, it also extract the emoji images as PNG files.

Usage

Store the page:

@aldur
aldur / FlacToMp3Tag.sh
Created Jul 2, 2015
Convert Flac to MP3 while keeping metadata
View FlacToMp3Tag.sh
for f in *.flac; do ffmpeg -i "$f" -ab 320k -map_metadata 0 -id3v2_version 3 "${f%flac}mp3"; done
@aldur
aldur / README.md
Last active Aug 29, 2015
Q-Learner Agent - Maja Machine Learning Framework
View README.md

Q-Learner Agent - MMLF

Place the agent in your mmlf/agents directory. Place the configuration file in ~/.mmlf/config.

Run with: ./run_mmlf --config world_simple_q.yaml.

@aldur
aldur / nfs_automount.sh
Last active Aug 23, 2019
Mount an NFS share on Android
View nfs_automount.sh
#!/bin/sh
# Mount an NFS share on Android
# Requirements:
# - Busybox
# - A kernel supporting nfs (either built-in or as a module)
# On my Nexus 7 2012 I use the following kernel:
# http://forum.xda-developers.com/showthread.php?t=2107224
# Remember: if you have problems of system space, simply delete some of the default stuff.
@aldur
aldur / PushTransmission.sh
Last active Nov 14, 2017
Transmission Daemon script: push to Pushbullet
View PushTransmission.sh
#!/bin/sh
# Set your pushbullet access token here:
PUSHBULLET_ACCESS_TOKEN=SPECIFY_ACCESS_TOKEN_HERE
# -- END of user configurable variables. --
PUSHBULLET_API_PUSH=https://api.pushbullet.com/v2/pushes
curl --header "Authorization: Bearer $PUSHBULLET_ACCESS_TOKEN" \
-o /dev/null \
@aldur
aldur / RepoArchiver.py
Last active Aug 29, 2015
Archive a GitHub repository to a MD file.
View RepoArchiver.py
#! /usr/bin/env python
# coding = utf-8
# author = Adriano Di Luzio - Unbit
"""
Given user and repository this script downloads and archives
(by using Markdown) the entire issues history of the repository.
It is designed to work with both python3 and python2.
It requires python-requests.
"""
@aldur
aldur / RedBlackBinaryCheck.py
Last active Aug 29, 2015
Check if a tree is a balanced red-black tree. O(n) complexity.
View RedBlackBinaryCheck.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Red-Black binary trees properties:
1. Every node is either red or black.
2. The root is black.
3. Every leaf (NIL) is black.
4. If a node is red, then both its children are black.
5. For each node, all simple paths from the node to descendant leaves contain the same number of black nodes.
@aldur
aldur / slidingWindow.py
Last active Aug 29, 2015
Wireless Lab - Sliding window tracing parsing
View slidingWindow.py
import numpy
import os
import pickle
from itertools import islice
TRACES_DIRECTORY = "traces"
OUTPUT_DIRECTORY = "output"
You can’t perform that action at this time.