Skip to content

Instantly share code, notes, and snippets.

@qdequele
qdequele / gpg_resign.sh
Created February 24, 2018 10:33
Resign all my old commits with GPG key
#!/bin/sh
cd $1
git filter-branch --commit-filter '
if [ "$GIT_COMMITTER_EMAIL" = "your@email.com" ]
then
git commit-tree -S "$@";
fi
@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active March 16, 2024 13:18
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

@troyfontaine
troyfontaine / 1-setup.md
Last active April 24, 2024 14:19
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

// Copyright 2016 Google Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// Command caption reads an audio file and outputs the transcript for it.
package main
import (
"fmt"
"io"
@LetItRock
LetItRock / RecyclerView.OnScrollListener.java
Last active June 9, 2022 03:42
Android RecyclerView detecting end of list
private boolean loading = true;
int pastVisiblesItems, visibleItemCount, totalItemCount;
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener()
{
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy)
{
if(dy > 0) //check for scroll down
{
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active March 4, 2024 11:27
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@denji
denji / golang-tls.md
Last active March 29, 2024 03:03 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@lexruee
lexruee / bluetooth raspberry-pi
Created January 22, 2015 05:12
install bluetooth and pybluez
sudo apt-get update
sudo apt-get install python-pip python-dev ipython
sudo apt-get install bluetooth libbluetooth-dev
sudo pip install pybluez
@congjf
congjf / .Title
Last active April 2, 2023 00:57 — forked from border/mgoExample.go
Using MongoDB in golang with mgo
Using MongoDB in golang with mgo
@bartoszmajsak
bartoszmajsak / prepare-commit-msg.sh
Last active March 20, 2024 08:12
How to automatically prepend git commit with a branch name
#!/bin/bash
# This way you can customize which branches should be skipped when
# prepending commit message.
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master develop test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"