Skip to content

Instantly share code, notes, and snippets.

View marzocchi's full-sized avatar

Federico Marzocchi marzocchi

View GitHub Profile
@marzocchi
marzocchi / main.go
Last active September 13, 2018 15:19
bin/parse-url
package main
import (
"bufio"
"fmt"
"gopkg.in/yaml.v2"
"net/url"
"os"
)
@marzocchi
marzocchi / recover-double-encrypted.sh
Created October 24, 2019 13:11
Recover files that ended up being double-encrypted while using git-crypt
#!/bin/sh
set -e
hash() {
if [[ $# != 1 ]]; then
echo "usage: hash FILE" >&2
return 1
fi
shasum "$1" | cut -f1 -d' '
iterm-notify config-set failure-icon "https://media3.giphy.com/media/10ECejNtM1GyRy/200_s.gif"
iterm-notify config-set failure-title "wow such #fail"
iterm-notify config-set success-icon "https://s-media-cache-ak0.pinimg.com/564x/b5/5a/18/b55a1805f5650495a74202279036ecd2.jpg"
iterm-notify config-set success-title "very #success. wow"
@marzocchi
marzocchi / config.fish
Last active November 26, 2019 22:47
config.fish
if status is-interactive > /dev/null
function fish_vi_cursor; end
fish_vi_key_bindings
function fish_greeting
end
function first_prompt_line --on-event fish_prompt
set_color red
@marzocchi
marzocchi / zshrc
Last active November 27, 2022 17:32
zshrc
# vim: se filetype=zsh
# zmodload zsh/zprof
autoload -U add-zsh-hook
export LANG=en_US.UTF-8
TZ="Europe/Berlin"
HISTFILE=$HOME/.zhistory
HISTSIZE=3000
SAVEHIST=3000

Keybase proof

I hereby claim:

  • I am marzocchi on github.
  • I am fmarzocchi (https://keybase.io/fmarzocchi) on keybase.
  • I have a public key whose fingerprint is B9CE 00EE E0CB 4929 F75B 2DFE 3DD2 6755 9C50 26A6

To claim this, I am signing this object:

@marzocchi
marzocchi / config.nix
Last active June 23, 2021 21:44
.config/nixpkgs/config.nix
# - list packages
# nix-env -qaP
#
# - install packages in this file, or update packages after channel update:
# nix-env -iA nixpkgs.myPackages
#
# - update package list
# nix-channel --update
{
allowUnfree = true;
@marzocchi
marzocchi / Dockerfile
Last active October 11, 2023 11:12
Connect to a gRPC server with TLS (without a certificate, key pair)
FROM golang:alpine AS builder
RUN apk --no-cache add build-base git mercurial gcc
ADD . /go/src/grpc-client-test
RUN cd /go/src/grpc-client-test && go build -o grpc-client-test main.go
FROM alpine
COPY --from=builder /go/src/grpc-client-test /grpc-client-test
ENV GRPC_GO_LOG_SEVERITY_LEVEL=info
ENV GRPC_GO_LOG_VERBOSITY_LEVEL=6
@marzocchi
marzocchi / race-on-start.txt
Last active March 28, 2021 22:01
data races @ hc
==================
WARNING: DATA RACE
Write at 0x00c00062e050 by goroutine 32:
github.com/brutella/hc/hap.(*session).SetCryptographer()
/Users/marzocchi/projects/hc/hap/session.go:100 +0x3e
github.com/brutella/hc/hap/endpoint.(*PairVerify).ServeHTTP()
/Users/marzocchi/projects/hc/hap/endpoint/pair-verify.go:71 +0x7d6
net/http.(*ServeMux).ServeHTTP()
/nix/store/1kxvwk77952rppirjn258z7s3i3680zx-go-1.16/share/go/src/net/http/server.go:2448 +0xaf
net/http.serverHandler.ServeHTTP()
@marzocchi
marzocchi / vault-list-recursive.sh
Last active July 7, 2023 14:19
List Vault Secrets Recursively with vault CLI
#!/usr/bin/env bash
#
# Usage:
#
# vault-list-recurive.sh START_PATH
set -euo pipefail
to_lines() {
sed "s/{}//g" \