Skip to content

Instantly share code, notes, and snippets.

@sanzoghenzo
sanzoghenzo / do2gj.py
Created September 25, 2019 21:51
Day One Classic to GitJournal
"""
Convert Day One Classic/Narrate journal entries to GitJournal entries.
Parse the plist XML files to extract useful metadata to be added as yaml headers for the markdown file.
Handle sifttter-redux XML indentation problems by removing leading whitespaces.
"""
import glob
import io
import os
import plistlib
@kamermans
kamermans / fix_quotes.sh
Last active April 16, 2024 00:23
Replace fancy-quotes / curly-quotes / smart-quotes with standard ASCII single- and double-quotes in bash
#!/bin/bash
# Replaces annoying "fancy" quotes created by programs like Microsoft Word and everything in MacOS
# with normal ASCII single-quotes (') or double-quotes (")
# This script does NOT replace the GRAVE ACCENT (`) since it is commonly used in Markdown and as a bash command
# See: https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
SINGLE=$(echo -ne '\u00B4\u2018\u2019')
DOUBLE=$(echo -ne '\u201C\u201D')
sed -i "s/[$SINGLE]/'/g; s/[$DOUBLE]/\"/g" $1
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active July 3, 2025 21:22 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export your tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@churro-s
churro-s / LetsEncrypt_HTTPS_plex.MD
Last active May 31, 2025 21:49
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@Hellowlol
Hellowlol / restart_plex.bat
Last active February 21, 2020 01:53
Restart plex plexpyscript
REM Add this script to Plex down and/or Plex remote down to restart plex if
REM server is unreachable.
TASKKILL /f /im "Plex Media Server.exe"
TASKKILL /f /im "PlexScriptHost.exe"
"C:\Program Files (x86)\Plex\Plex Media Server\Plex Media Server.exe"
@slowkow
slowkow / ssh-tutorial.md
Last active February 22, 2025 11:28
ssh to a server without typing your password

How to ssh to a remote server without typing your password

Save yourself a few keystrokes. Follow the steps below:

  1. Run this Bash script on your laptop:

    #!/usr/bin/env bash
    

The hostname of your remote server.

@ssmereka
ssmereka / plexDatabaseBackupScript.sh
Last active March 21, 2025 16:18
Plex Media Server database backup script.
#!/bin/bash
# Backup a Plex database.
# Author Scott Smereka
# Version 1.0
# Script Tested on:
# Ubuntu 12.04 on 2/2/2014 [ OK ]
# Plex Database Location. The trailing slash is
@consti
consti / hosts
Last active May 14, 2025 15:51
/etc/hosts to block shock sites etc.
# This hosts file is brought to you by Dan Pollock and can be found at
# http://someonewhocares.org/hosts/
# You are free to copy and distribute this file for non-commercial uses,
# as long the original URL and attribution is included.
#<localhost>
127.0.0.1 localhost
127.0.0.1 localhost.localdomain
255.255.255.255 broadcasthost
::1 localhost
@fwenzel
fwenzel / plex_restart.sh
Created April 26, 2012 03:17
Simple watchdog script to restart plex media server if it becomes unresponsive.
#!/bin/bash
# If plex is not running, don't do anything.
plex_running=`ps ax | grep "\./Plex Media Server" | awk '{ print $1 }' | wc -l`
if [ "$plex_running" -eq 1 ]; then
exit 0
fi
# Test Plex web interface. If it's dead, this'll time out in a few seconds.
curl -I -m 8 "http://localhost:32400/library/sections" > /dev/null 2>&1
@numist
numist / irsz.js
Created January 29, 2012 06:58
dynamically resize images to fit viewport (intelligently!)
/*
* Copyright © 2012 by Scott Perry
* Released under the MIT License; its terms are at the end of this file.
*
* This file depends on:
*  jQuery (tested against 1.7.1)
* http://jquery.com/
*
* Basic logic of this file:
* + if irsz_auto is true