Skip to content

Instantly share code, notes, and snippets.

View abeluck's full-sized avatar

Abel Luck abeluck

View GitHub Profile
@abeluck
abeluck / JettyClient.java
Created March 7, 2024 10:08
How to modify Jetty Client Request after TLS handshake is complete?
// Jetty version: 12.0.6
public class JettyClient {
public static void main(String[] args) throws Exception {
SecurityProviders.init(); // initializes the Conscrypt and BouncyCastle security providers
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
// This disables SSL certificate validation
// handy for localhost testing, not so handy in production
sslContextFactory.setTrustAll(true);

Build Notes

@abeluck's build notes for ipfs-shipyard/gomobile-ipfs

Go setup

Install golang. I used 1.18 from the fedora repos.

Python setup

@abeluck
abeluck / forward-gpg-agent-to-gitpod.sh
Created April 11, 2022 09:09
A script for forwarding your gpg-agent to gitpod
#!/bin/bash
set -euo pipefail
opt=${1:-}
usage() {
echo "$0 - ssh into a remote gitpod with your gpg-agent forwarded"
echo
echo "usage: $0 [option]"
echo
@abeluck
abeluck / build-emacs.sh
Created July 9, 2019 07:38
Build emacs from source on Debian 9 (stretch)
#!/bin/bash
# Builds emacs from source
# Tested on Debian 9 (stretch)
set -e
emacs_src=$HOME/src/emacs
emacs_dest=$HOME/.local
emacs_tag=emacs-26.2
@abeluck
abeluck / playbook.yml
Last active September 21, 2023 13:11
Ansible tasks to create and delete alertmanager silences
# creates a silence in alertmanager that starts `now` and lasts for 10 minutes
- hosts: localhost
gather_facts: yes
tasks:
- set_fact:
start_datetime: "{{ ''| local_time_iso8601 }}"
future_datetime: "{{ ''|local_time_iso8601 | add_time_iso8601(minutes=10) }}"
- debug:
var: future_datetime
@abeluck
abeluck / generate-signing-key.py
Last active October 11, 2021 15:30
Generate a synapse signing key from the command line
# Generate a signing key for synapse from the command line
#
# Usage: python3 generate-signing-key.py
#
# You must have the signedjson package installed:
# apt install python3-signedjson
# pip3 install signedjson
#
# Author: Abel Luck <abel@guardianproject.info>
# Created: April 25 2019
@abeluck
abeluck / USAGE.md
Last active February 15, 2019 08:07
Ansible playbook for updating apt securely (CVE-2019-3462)

This only works on debian stretch (stable)

gpg --verify check-apt-update.sh.asc
ansible-playbook upgrade-apt.yml -i <YOURINV>

Thanks to @eighthave for original script.

Ref:

@abeluck
abeluck / verifying-debian-docker-images.md
Last active February 8, 2021 16:56
On the Subject of Verification of Provenance for Debian Docker Images

On the Subject of Verification of Provenance for Debian Docker Images

note: this was last tested in 2019. things have probably changed.

Prepare

git clone https://github.com/debuerreotype/debuerreotype
cd debuerreotype
sending 57f56c83-7b4d-4fb4-b631-3f85a1cc787b +55555555555 test
GET https://textsecure-service-staging.whispersystems.org/v2/keys/+55555555555/1
GET https://textsecure-service-staging.whispersystems.org/v2/keys/+55555555555/1 200 Success
Trying to get session for identifier: +55555555555.1
Saving new identity...
Trying to get session for identifier: +55555555555.1
PUT https://textsecure-service-staging.whispersystems.org/v1/messages/+55555555555
PUT https://textsecure-service-staging.whispersystems.org/v1/messages/+55555555555 409 Error
{ successfulNumbers: [],
errors:
@abeluck
abeluck / SignalProtocolStore.js
Created November 1, 2018 13:24
SignalProtocolStore interface
function SignalProtocolStore(path) {
}
SignalProtocolStore.prototype = {
Direction: {
SENDING: 1,
RECEIVING: 2,
},
// create a random group id that we haven't seen before.