Skip to content

Instantly share code, notes, and snippets.

Avatar
💥

Federico Marzocchi marzocchi

💥
View GitHub Profile
View race-on-start.txt
==================
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 / Dockerfile
Last active Jul 31, 2020
Connect to a gRPC server with TLS (without a certificate, key pair)
View Dockerfile
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 / config.nix
Last active Dec 14, 2020
.config/nixpkgs/config.nix
View config.nix
# - save this to ~/.config/nixpkgs/config.nix
#
# - find the package you want to install by regexp, then add the name to the list
# nix-env -qaP ".*package.*"
#
# - install packages in this file, or update packages after channel update:
# nix-env -iA nixpkgs.myPackages
#
# - channel update (update list of installable package)
# nix-channel --update
View keybase.md

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:

View zshrc
# vim: se filetype=zsh
autoload -U add-zsh-hook
TZ="Europe/Rome"
HISTFILE=$HOME/.zhistory
HISTSIZE=3000
SAVEHIST=3000
View 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
View dogefy-iterm.sh
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 / recover-double-encrypted.sh
Created Oct 24, 2019
Recover files that ended up being double-encrypted while using git-crypt
View recover-double-encrypted.sh
#!/bin/sh
set -e
hash() {
if [[ $# != 1 ]]; then
echo "usage: hash FILE" >&2
return 1
fi
shasum "$1" | cut -f1 -d' '
@marzocchi
marzocchi / main.go
Last active Sep 13, 2018
bin/parse-url
View main.go
package main
import (
"bufio"
"fmt"
"gopkg.in/yaml.v2"
"net/url"
"os"
)
@marzocchi
marzocchi / config.ini
Created Aug 14, 2018
Git difftool configuration for comparing MySQL schemas
View config.ini
[diff]
tool = diff-for-schema
[difftool]
prompt = false
[difftool "diff-for-schema"]
cmd = diff --show-function-line='^CREATE TABLE' -U1 -- "$LOCAL" "$REMOTE"