Skip to content

Instantly share code, notes, and snippets.

View ewa's full-sized avatar

Eric Anderson ewa

View GitHub Profile
@ewa
ewa / delete_duplicate_bitwarden_items.py
Last active September 24, 2023 14:36 — forked from jwmcgettigan/bitwarden_duplicate_cleaner.py
Use the BitWarden command-line client to purge duplicate entries from your vault. NOTE: this is my one-time-use variant, and the original has been improved significantly since I forked it, so you should probably look there.
#!/usr/bin/env python3
# This script will pull all of your vault 'items' using the 'bw list items' command and then it will compare
# all properties that are not inherently unique from the returned JSON to determine if they are duplicates.
# Note: It removes older duplicates first - the newest copy of the 'item' will be the only one to remain.
# You can simply flip the '>' sign to '<' if you want to preserve the oldest 'item' instead.
#
# Setup Steps
# 1. You must install Bitwarden CLI first: https://bitwarden.com/help/cli/#download-and-install
# 2. Login to the CLI with the 'bw login' command. You need your session key setup before continuing: https://bitwarden.com/help/cli/#using-a-session-key
@ewa
ewa / pgp-merge-drv
Created April 24, 2012 15:10
Git merge driver to decrypt (and re-encrypt) files before merging.
#!/bin/bash
# WARNING: This creates and manipulates clear text copies of the
# encrypted files. It tries to clean up afterwards, but lots can go
# wrong. If you are seriously worried about the secrecy of the files,
# don't trust this!
ANCESTOR=$1
MINE=$2
OTHER=$3
@ewa
ewa / encrypted_protobuf.org
Created January 26, 2016 00:15
Cleanly handling encrypted data in protocol buffers or similar

Cleanly handling encrypted data in protocol buffers or similar

Posted on Stack Overflow here.

Is anyone aware of a library / wrapper for working with encrypted and/or signed data in protobufs (or other similar message description & serialization tools)?

I keep finding myself dealing with messages where all or part of the message is encrypted, like so:

@ewa
ewa / ath9k_5GHz.patch
Created April 19, 2012 15:29
More permissive regd settings for ath9k. Use with caution and know your local regulations!
diff --git a/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c b/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c
index 028310f..23fd937 100644
--- a/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c
+++ b/linux-lts-backport-oneiric-3.0.0/drivers/net/wireless/ath/regd.c
@@ -37,12 +37,9 @@
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_OFDM)
/* We allow IBSS on these on a case by case basis by regulatory domain */
-#define ATH9K_5GHZ_5150_5350 REG_RULE(5150-10, 5350+10, 40, 0, 30,\
- NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
public class LocationDef {
/** A "true" coordinate reference system for absolute positions on Earth.
*
* User-supplied relativeTo origin coordinates are converted into this
* system in the course of building a local coordinate system. It is not
* necessarily used again.
*/
protected static final GeographicCRS referenceAbsolute2D = DefaultGeographicCRS.WGS84;
protected static final GeographicCRS referenceAbsolute3D = DefaultGeographicCRS.WGS84_3D;