Skip to content

Instantly share code, notes, and snippets.

View 0xqd's full-sized avatar
🚀
Buidl web3

jn 0xqd

🚀
Buidl web3
View GitHub Profile
  • 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
@0xqd
0xqd / HallOfBlame.md
Created July 3, 2023 17:12 — forked from yorickdowne/HallOfBlame.md
Great and less great SSDs for Ethereum nodes

Overview

Syncing an Ethereum node is largely reliant on IOPS, I/O Per Second. Budget SSDs will struggle to an extent, and some won't be able to sync at all.

This document aims to snapshot some known good and known bad models.

For size, 2TB come recommended as of mid-2022. 1TB can work for now but is getting tight.

High-level, QLC and DRAMless are far slower than "mainstream" SSDs.

@0xqd
0xqd / how-to-set-up-stress-free-ssl-on-os-x.md
Created October 26, 2018 10:33 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@0xqd
0xqd / run_shell_cmd.py
Created May 22, 2018 07:28 — forked from doublenns/run_shell_cmd.py
Quick, dirty function to call shell commands from Python
#!/usr/bin/env python3
import subprocess
def run_shell_cmd(cmd, *shell):
# Might want to use a "try" or call.check in case Command fails
if "shell" in shell.lower():
process = subprocess.Popen(cmd,
stdout=subprocess.PIPE, shell=True)
curl -XDELETE "http://localhost:9200/geo_polygon"
curl -XPOST "http://localhost:9200/geo_polygon"
# We index points with geo_point and geo_shape types for testing purpose
curl -XPOST "http://localhost:9200/geo_polygon/loc/_mapping" -d'
{
"loc": {
"properties": {
@0xqd
0xqd / app.js
Created October 29, 2015 16:47 — forked from benlesh/app.js
Angular - Basics of Unit Testing a Controller
var app = angular.module('myApp', []);
/* Set up a simple controller with a few
* examples of common actions a controller function
* might set up on a $scope. */
app.controller('MainCtrl', function($scope, someService) {
//set some properties
$scope.foo = 'foo';
$scope.bar = 'bar';
@0xqd
0xqd / lftp.conf
Created February 26, 2014 05:02 — forked from fxthomas/lftp.conf
## some useful aliases
alias ls "ls -h"
alias dir ls
alias less more
alias zless zmore
alias bzless bzmore
alias mirror "mirror -v"
alias sync "mirror -R -v -n"
alias reconnect "close; cache flush; cd ."
alias edit "eval -f \"get $0 -o ~/.lftp/edit.tmp.$$ && shell \\\"cp -p ~/.lftp/edit.tmp.$$ ~/.lftp/edit.tmp.$$.orig && $EDITOR ~/.lftp/edit.tmp.$$ && test ~/.lftp/edit.tmp.$$ -nt ~/.lftp/edit.tmp.$$.orig\\\" && put ~/.lftp/edit.tmp.$$ -o $0; shell rm -f ~/.lftp/edit.tmp.$$*\""
@0xqd
0xqd / jsdoc.vim
Created December 3, 2013 05:05 — forked from sunvisor/jsdoc.vim
" JSDoc形式のコメントを追加(functionの行で実行する)
" hogeFunc: function() の形式と function hogeFunc() に対応
" 関数定義でない場合は、コメントだけ出力する
function! AddJSDoc()
let l:jsDocregex = '\s*\([a-zA-Z]*\)\s*[:=]\s*function\s*(\s*\(.*\)\s*).*'
let l:jsDocregex2 = '\s*function \([a-zA-Z]*\)\s*(\s*\(.*\)\s*).*'
let l:line = getline('.')
let l:indent = indent('.')
let l:space = repeat(" ", l:indent)
apt-get install libsqlite3-dev
#!/bin/bash
# Ubuntu provides go through the `golang` package, but it is slow to update.
#
# Using gvm, we can install an up to date version of go on a user by user basis.
# Install gvm deps
sudo apt-get install mercurial bison
# Install and activate gvm