Skip to content

Instantly share code, notes, and snippets.

View mmagnus's full-sized avatar

Marcin Magnus mmagnus

View GitHub Profile
@UnkindPartition
UnkindPartition / cleanup.sh
Created March 11, 2016 21:27
Clean up stale .sdr files from Kindle (paperwhite)
#!/bin/sh
# Call this from your 'documents' directory
set -eu
for d in *.sdr
do
if [ -d "$d" -a ! -n "$(find . -maxdepth 1 -type f -name "${d%.sdr}*" -print -quit)" ]
then
echo "$d"
@aleks-mariusz
aleks-mariusz / safari-open-pages.py
Created August 24, 2014 16:35
This script fetches the current open tabs in all Safari windows. Useful to run remotely on your mac when you are at work and want to read a page you have open (remotely) at home but don't remember the url but can log in to your home system on the command line
#!/usr/bin/python
#
# This script fetches the current open tabs in all Safari windows.
# Useful to run remotely on your mac when you are at work and want
# to read a page you have open (remotely) at home but don't remember
# the url but can log in to your home system on the cmmand line
#
import sys