Skip to content

Instantly share code, notes, and snippets.

@andre-st
andre-st / cryptopen.sh
Last active January 30, 2020 02:38
Manually open and mount crypted device
#!/usr/bin/env bash
# About: Manually open and mount crypted device
# Location: /usr/local/bin/
# Usage:
# $ cryptopen /home/dir
# gets dirs, device names etc automatically from
# /etc/fstab:
# /dev/mapper/cryptdir /home/dir ext3 noauto,defaults 0 0
# /etc/crypttab:
@andre-st
andre-st / pbkdf2.c
Created January 30, 2020 02:33
PBKDF2 HMAC-SHA1 Password Hashing
/*
* Requires OpenSSL >= 1.0.0
* $ gcc -o pbkdf2 -lcrypto pbkdf2.c
*
* License: GPL2
*/
#include <err.h>
#include <errno.h>
#include <stdlib.h>
@andre-st
andre-st / bookmarklet-uncss.js
Last active January 30, 2021 20:35
Browser bookmarklet "UnCSS" improves readability of long texts by replacing all original styles with better line-heights, font sizes, paragraph margins, few colors etc. Firefox provides this out of the box (Reader Mode). The Brave-browser, however, does not.
javascript: (function() {
const DARKMODE = true;
function every( sel, how, fil ) {
Array.from( document.getElementsByTagName( sel ))
.filter( e => fil ? fil( e ) : true )
.forEach( how );
}
@andre-st
andre-st / mkview.sh
Last active October 9, 2021 04:20
Organize access to media files via tags
#!/bin/bash
# Purpose: Creates sub-directories with symlinks to files that are scattered over
# different directories but share a commonality, e.g, being 'a favourite'
# Context: Media collections
# Analogy: Database views, locate-command result saved as filesystem objects
# Author : github.com/andre-st
# Version: 2021-01-28
#
# Usage:
@andre-st
andre-st / inject-amazon-wishlist-filters.js
Last active November 2, 2021 19:08
Adds price-filter UI controls to your own Amazon wishlist pages #injectjs
//////////////////////////////////////////////////////////////////////////////
//
// AMAZON.DE WISHLESS - WISHLIST PRICE FILTERING
//
// - adds UI elements to every Amazon wishlist control bar
// - optionally filter by price range
// - optionally filter by free shipping
// - keeps filter settings across wishlists
//
mixin( ["https://www.amazon.de/hz/wishlist/", "https://www.amazon.de/gp/registry/wishlist/"], () =>
@andre-st
andre-st / inject-amazon-goodreads-ratings.js
Last active October 20, 2021 11:42
Shows Goodreads.com ratings on Amazon.de product pages #injectjs
//////////////////////////////////////////////////////////////////////////////
//
// AMAZON.DE WITH GOODREADS.COM RATINGS
//
// Replaces Ruben Martinez's "Goodreads Ratings for Amazon" extension.
//
mixin( ["https://www.amazon.de/"], () =>
{
// There are often e-book editions on Goodreads when there are no paper editions.
// The e-book ASIN isn't similar to ISBN, as opposed to the paper book ASIN.
@andre-st
andre-st / inject-goodreads.js
Last active November 16, 2022 14:32
Force consistent Goodreads.com view settings, show link to user's comments-history, ... #injectjs
//////////////////////////////////////////////////////////////////////////////
//
// GOODREADS.COM
//
// Force shelf view settings:
//
redir( /(https:\/\/www\.goodreads\.com\/review\/list\/[^?]+)(?=(?:.*[?&](page=\d+))?)(?=(?:.*[?&](shelf=[^&]+))?)(.*)/,
'$1?per_page=100&sort=rating&order=d&view=covers&$2&$3' );
@andre-st
andre-st / inject-freieradios.js
Last active July 18, 2022 10:48
freie-radios.net: Adds download-buttons for the audio-files directly on the frontpage + removes no-audio articles from the frontpage + History of already downloaded audio + larger "next" link #injectjs
//////////////////////////////////////////////////////////////////////////////
//
// FREIE-RADIOS.NET
//
// 1. Adds download-buttons for the audio-files of each article directly on the frontpage
// 2. Removes 'internal' no-audio articles from the frontpage
// 3. History of already downloaded audio
//
mixin( ["https://www.freie-radios.net/"], () =>
@andre-st
andre-st / timeline-create-csv.sh
Last active October 31, 2021 17:40
Poor man's file system forensic analysis: Creating and viewing a timeline
#!/usr/bin/env bash
OUTFILE=timeline.csv
echo "date,path,user,size" > "${OUTFILE}"
find . -printf '%TY-%Tm-%Td,"%p","%u",%s\n' | sort >> "${OUTFILE}"
@andre-st
andre-st / swf2mp4.sh
Created November 11, 2021 11:05
Convert Flash SWF files to MP4 using Linux ffmpeg and GNU Gnash
#!/bin/bash
# Requires:
# - ffmpeg
# - GNU Gnash:
# $ git clone git://git.sv.gnu.org/gnash.git
# $ cd gnash
# $ ./autogen.sh
# $ ./configure --enable-renderer=agg --enable-gui=dump --disable-menus --enable-media=ffmpeg --disable-jemalloc
# $ make > /dev/null