Skip to content

Instantly share code, notes, and snippets.

View Matoran's full-sized avatar

Marco Lopes Matoran

  • Geneva
View GitHub Profile
#!/usr/bin/env python
# Linux usage: ./extract_tampermonkey_script.py "/home/<USER>/.config/<BROWSER>/Default/Local Extension Settings/<EXTENSION_ID>"
# i.e.: ./extract_tampermonkey_script.py "/home/foo/.config/google-chrome-beta/Default/Local Extension Settings/gcalenpjmijncebpfijmoaglllgpjagf"
# Mac usage: ./extract_tampermonkey_script.py "/Users/<USER>/Library/Application Support/Google/Chrome/Default/Local Extension Settings/<EXTENSION_ID>/"
# i.e.: ./extract_tampermonkey_script.py "/Users/foo/Library/Application Support/Google/Chrome/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/"
import leveldb
import sys
import re
@Links2004
Links2004 / auto_rotate.sh
Created February 5, 2017 10:37
Linux auto rotate screen and adjust touch matrix based on accelerometer data
#!/bin/bash
# Auto rotate screen based on device orientation
# based on https://linuxappfinder.com/blog/auto_screen_rotation_in_ubuntu
# install
# 1. apt-get install iio-sensor-proxy inotify-tools
# 2. add script to autostart
# Receives input from monitor-sensor (part of iio-sensor-proxy package)
# Screen orientation and launcher location is set based upon accelerometer position
@mperlet
mperlet / change_none_unique_minidlna_title.sh
Created August 18, 2015 13:38
Problem: minidlna use the title from the metadata, sometimes its better when the title = the filename. This script change the title from "'HERE THE NONE UNIQUE TITLE'" to the filename.
for line in $(sqlite3 /root/minidlna/files.db "SELECT ID,PATH FROM DETAILS WHERE TITLE='HERE THE NONE UNIQUE TITLE';");
do
id=$(echo $line | cut -d"|" -f1);
path=$(echo $line | cut -d"|" -f2);
echo $id;
echo $path;
sqlite3 /root/minidlna/files.db "UPDATE DETAILS SET TITLE='$(basename $path)' WHERE ID=$id;";
done;