Skip to content

Instantly share code, notes, and snippets.

# vim:ft=zsh ts=2 sw=2 sts=2
# Aldur's zsh-theme
# Begin a segment
# Takes two arguments, foreground (a colour) and bold (bold or not bold).
prompt_segment() {
[[ $1 != "none " ]] && echo -n "%F{$1}"
[[ $2 == "bold" ]] && echo -n "%B"
aldur /
Last active August 29, 2015 14:09
Wireless Lab - Sliding window tracing parsing
import numpy
import os
import pickle
from itertools import islice
aldur /
Last active August 29, 2015 14:23
Q-Learner Agent - Maja Machine Learning Framework

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 /
Created July 2, 2015 08:20
Convert Flac to MP3 while keeping metadata
for f in *.flac; do ffmpeg -i "$f" -ab 320k -map_metadata 0 -id3v2_version 3 "${f%flac}mp3"; done
aldur /
Last active November 14, 2017 21:19
Transmission Daemon script: push to Pushbullet
# Set your pushbullet access token here:
# -- END of user configurable variables. --
curl --header "Authorization: Bearer $PUSHBULLET_ACCESS_TOKEN" \
-o /dev/null \
aldur /
Created December 19, 2016 14:21
Emoji to JSON

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.


Store the page:

aldur /
Last active April 21, 2020 03:26
Archive a GitHub repository to a MD file.
#! /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 /
Created April 5, 2018 09:10
Python Logging Boilerplate
#!/usr/bin/env python3
# encoding: utf-8
"""TODO: Package description."""
import datetime
import logging
import os
# Configure logging.
aldur /
Last active December 3, 2023 10:08
Mount an NFS share on Android
# 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:
# Remember: if you have problems of system space, simply delete some of the default stuff.
aldur /
Created November 14, 2017 19:44

Root OnePlus5 without unlocking the bootloader

Gain adb root.

$ adb shell am start -n --es "code" "angela"

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