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);
@abeluck
abeluck / gpg-offline-master.md
Last active October 22, 2023 02:59 — forked from KenMacD/cmd.md
GPG Offline Master Key w/ smartcard
@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

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 / concat-mp4-annexb.md
Created September 20, 2012 17:50
Concat MP4 files using AnnexB bitstream format

Concat MP4 files without transcoding to mpeg

  1. Use the h264_mp4toannexb bitstream filter to convert the mp4s (video steam only) into the AnnexB bitstream format

    ffmpeg -i input1.mp4 -vcodec copy -vbsf h264_mp4toannexb -acodec copy part1.ts
    # repeat for up to inputN
    
  2. Concat the files using cat

@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 / 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
@abeluck
abeluck / gist:6243306
Last active April 14, 2020 04:43
Local HTTP server to stream an InputStream to MediaPlayer on Android
/**
* This is simple HTTP local server for streaming InputStream to apps which are capable to read data from url.
* Random access input stream is optionally supported, depending if file can be opened in this mode.
*
* from: http://stackoverflow.com/a/9096241
*/
public class StreamOverHttp{
private static final boolean debug = false;
private final Browser.FileEntry file;
@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