Skip to content

Instantly share code, notes, and snippets.

View piavgh's full-sized avatar
🤖

Hoang Trinh piavgh

🤖
View GitHub Profile
@piavgh
piavgh / add-docker-user.sh
Created August 17, 2020 14:43
Add a Docker user with the name from command line
#!/usr/bin/env bash
help() {
cat <<EOF
Arguments:
+\$1 given username
Usage example:
$ ./add-docker-user.sh jenkins
EOF
}
@piavgh
piavgh / docker-clear-log.sh
Created February 1, 2021 07:35
Clear Docker logs
#!/bin/bash -e
if [[ -z $1 ]]; then
echo "No container specified"
exit 1
fi
if [[ "$(docker ps -aq -f name=^/${1}$ 2> /dev/null)" == "" ]]; then
echo "Container \"$1\" does not exist, exiting."
exit 1
@piavgh
piavgh / checkport
Created February 1, 2021 08:01
Check port
alias checkport="sudo lsof -i -P -n | grep LISTEN"
  • Panoramix is probably the most well-known one thanks to etherscan.io integrating it. It'll return "python-like" code that is actually quite nice to read. Unfortunately it often ends up having "timeouts" causing the decompiled code to just abruptly stop.
  • Dedaub's Decompiler is my personal favorite. When it produces something, it does produce "solidity-like" code that is well readable. But sometimes it just fails to yield anything at all. And even when it does work it struggles whenever memory handling gets involved, requiring some educated guessing.
  • ethervm.io's Decompiler is another online service which similar to Panoramix always delivers a result, but it also has the tendency to skip big parts of the code due to "could not resolve jump destination" errors and the like.
  • Heimdall does not have an online s
@piavgh
piavgh / 1-setup.md
Created March 5, 2024 14:37 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS

Methods of Signing with a GPG Key on MacOS

Last updated September 21, 2022

This Gist explains how to do this 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.

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

There has been a number of comments on this gist regarding some issues around the pinentry-program and M1 Macs. I've finally gotten a chance to try things out on an M1 and I've updated the documentation in 2-using-gpg.md to reflect my findings.