Skip to content

Instantly share code, notes, and snippets.

@lurebat
lurebat / README.md
Last active April 15, 2024 11:35
Jetmove - A script to enhance navigation and multiple carets in Jetbrains IDEs

What is this?

Jetmove is a script I wrote to myself for some navigation and multiple carets features I felt were missing in Jetbrains IDEs.

It uses the excellent Live Plugin to run the script in the IDE.

All features support multiple carets, and are designed to work with them.

Features

@jmiserez
jmiserez / gist:744116545d7f595923966f883c4f1b5d
Last active August 11, 2023 07:32
CyberChef: Parse Google Authenticator QR Code (single export) using protobuf schema and extract TOTP secret as Base32
1. Go to https://gchq.github.io/CyberChef/
2. Download CyberChef (top left), extract .zip and open .html file
3. Click "Load Recipe" in the top middle
4. Enter the following recipe:
Parse_QR_Code(false)
Regular_expression('User defined','otpauth-migration\\:\\/\\/offline\\?data\\=(.*)',true,false,true,false,false,false,'List capture groups')
URL_Decode()
From_Base64('A-Za-z0-9+/=',true)
Protobuf_Decode('syntax = "proto3";\n\noption java_package = "com.beemdevelopment.aegis";\noption java_outer_classname = "GoogleAuthProtos";\n\nmessage MigrationPayload {\n enum Algorithm {\n ALGORITHM_UNSPECIFIED = 0;\n ALGORITHM_SHA1 = 1;\n ALGORITHM_SHA256 = 2;\n ALGORITHM_SHA512 = 3;\n ALGORITHM_MD5 = 4;\n }\n\n enum DigitCount {\n DIGIT_COUNT_UNSPECIFIED = 0;\n DIGIT_COUNT_SIX = 1;\n DIGIT_COUNT_EIGHT = 2;\n }\n\n enum OtpType {\n OTP_TYPE_UNSPECIFIED = 0;\n OTP_TYPE_HOTP = 1;\n OTP_TYPE_TOTP = 2;\n }\n\n message OtpParameters {\n bytes secret = 1;\n string name = 2;\n str
@jmiserez
jmiserez / export_google_music.js
Last active December 20, 2023 01:45
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org>
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
@rmondello
rmondello / gist:b933231b1fcc83a7db0b
Last active April 5, 2024 07:10
Exporting (iCloud) Keychain and Safari credentials to a CSV file

Exporting (iCloud) Keychain and Safari credentials to a CSV file

Update (October 2021)

Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.

Original, Obsolete Content (2014)

After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.

@jmiserez
jmiserez / bingdesktop.sh
Last active January 19, 2022 13:21
Linux / WSL alternative client for Bing Wallpaper, with annotation using ImageMagick
#!/bin/bash
# exit on error
set -e
# Description:
# - Linux-compatible alternative to the official Bing Wallpaper client (https://www.microsoft.com/en-us/bing/bing-wallpaper).
# - Downloads the current Bing wallpaper of the day directly.
# - Fetches the matching image description / copyright information and overlays it onto the image using ImageMagick.
#
@jmiserez
jmiserez / update_annotations.sh
Created May 28, 2014 18:13
Annotate LectureNotes PDFs
#!/bin/bash
mkdir /tmp/magick_tmp
MAGICK_TMPDIR=/tmp/magick_tmp
export MAGICK_TMPDIR
LECTURENOTESDIR=/home/ec2-user/Dropbox/LectureNotes/
cd $LECTURENOTESDIR
process_directory() {
@PaulMaddox
PaulMaddox / noip
Created February 25, 2014 15:02
No IP using Amazon Route53
#!/bin/bash
# Requires cli53 to be installed
# https://github.com/barnybug/cli53
DNS_NAME="home";
DNS_ZONE="example.com";
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@simonmcc
simonmcc / route53DynDNS.bash
Created July 22, 2012 21:06
Amazon Route 53 Dynamic DNS Updater Script
#!/bin/bash
#
# This script requires xpath to parse part of the dnscurl.pl output
# on CentOS/RedHat/Amazon Linux:
#
# sudo yum install perl-XML-XPath
#
# also, dnscurl.pl (from http://aws.amazon.com/code/Amazon-Route-53/9706686376855511)
# expects your secrets to be in ~/.aws-secrets
# using a file format like this (from http://dmz.us/wp/wp-content/uploads/r53/aws-secrets.txt)

Silly things to do with shebang lines

The recent post on Hacker News about #! semantics surprised me. I had always assumed that a shebang line like

#! /usr/bin/prog -a -b

Would be equivalent to calling

$ /usr/bin/prog -a -b <file>