Skip to content

Instantly share code, notes, and snippets.

View liushooter's full-sized avatar

Shooter liushooter

View GitHub Profile
@liushooter
liushooter / checkdiskspaceall.yml
Created May 24, 2021 09:37 — forked from goodc0re/checkdiskspaceall.yml
Ansible playbook that checks if there is less than 95% free disk space
# checkdiskspaceall.yml
---
- hosts: zcoin_masternodes
vars_files: vault.yml
become: yes
become_method: sudo
gather_facts: yes
tasks:
- name: Collect only facts about hardware
setup:
@liushooter
liushooter / automator_new_file.scpt
Created May 11, 2021 15:01 — forked from rarylson/automator_new_file.scpt
AppleScript to create a new file in Finder (to be used in Automator)
-- AppleScript to create a new file in Finder
--
-- Use it in Automator, with the following configuration:
-- - Service receives: no input
-- - In: Finder.app
--
-- References:
-- - http://apple.stackexchange.com/a/129702
-- - http://stackoverflow.com/a/6125252/2530295
-- - http://www.russellbeattie.com/blog/fun-with-the-os-x-finder-and-applescript
# Requires Python 2.x, flask and pywin32
from flask import Flask
import flask
import win32com.client
import pythoncom
import os, os.path, sys, time
# Flask (Web Server)
ws = Flask(__name__)

Falsehoods that Ethereum programmers believe

I recently stumbled upon Falsehoods programmers believe about time zones, which got a good laugh out of me. It reminded me of other great lists of falsehoods, such as about names or time, and made me look for an equivalent for Ethereum. Having found none, here is my humble contribution to this set.

About Gas

Calling estimateGas will return the gas required by my transaction

Calling estimateGas will return the gas that your transaction would require if it were mined now. The current state of the chain may be very different to the state in which your tx will get mined. So when your tx i

@liushooter
liushooter / git-tag-delete-local-and-remote.sh
Created September 28, 2020 06:43 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@liushooter
liushooter / Google protobuf installation on Mac
Created September 27, 2020 05:33 — forked from rajkrrsingh/Google protobuf installation on Mac
Steps to Install google protobuf on Mac
$wget https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2
$tar xvf protobuf-2.5.0.tar.bz2
$cd protobuf-2.5.0
$./configure CC=clang CXX=clang++ CXXFLAGS='-std=c++11 -stdlib=libc++ -O3 -g' LDFLAGS='-stdlib=libc++' LIBS="-lc++ -lc++abi"
$make -j 4
$sudo make install
$protoc --version
@liushooter
liushooter / multiple-repository-and-identities-git-configuration.md
Last active September 14, 2020 04:04 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@liushooter
liushooter / bitcoin_debugging.md
Created August 24, 2020 02:49 — forked from fjahr/bitcoin_debugging.md
Debugging Bitcoin Core

Moved to https://github.com/fjahr/debugging_bitcoin to allow for better collaboration.

This document is currently optimized for MacOS. If you would like to help me add Linux equivalent commands, please let me know.

Debugging Bitcoin Core

This guide is designed to give beginners of C++ development and/or people new to the bitcoin core code base an overview of the tools available for debugging issues as well as giving hints where issues may trip you up.

@liushooter
liushooter / json.lua
Created August 12, 2020 04:54 — forked from tylerneylon/json.lua
Pure Lua json library.
--[[ json.lua
A compact pure-Lua JSON library.
The main functions are: json.stringify, json.parse.
## json.stringify:
This expects the following to be true of any tables being encoded:
* They only have string or number keys. Number keys must be represented as
strings in json; this is part of the json spec.
@liushooter
liushooter / git_batch_resolver.py
Created August 10, 2020 06:05 — forked from bitmingw/git_batch_resolver.py
Batch script to resolve large git conflicts.
#!/usr/bin/env python3
"""
Author: Ming Wen (bitmingw@gmail.com)
When resolving conflicts on a merge or rebase, this script
automates `git add/rm` and `git checkout` with --ours or --theirs
for a large batch of changes.
Usage: `./git_batch_resolver.py` in your git repository.