Skip to content

Instantly share code, notes, and snippets.

View Magicking's full-sized avatar

Sylvain Laurent Magicking

View GitHub Profile
/*
def get_deposit_root() -> bytes32:
zero_bytes32: bytes32 = 0x0000000000000000000000000000000000000000000000000000000000000000
node: bytes32 = zero_bytes32
size: uint256 = self.deposit_count
for height in range(DEPOSIT_CONTRACT_TREE_DEPTH):
if bitwise_and(size, 1) == 1: # More gas efficient than `size % 2 == 1`
node = sha256(concat(self.branch[height], node))
else:
node = sha256(concat(node, self.zero_hashes[height]))
@Magicking
Magicking / 98-keepkey.rules
Last active January 2, 2020 14:53
Udev rules for KeepKey
# Udev rules for the KeepKey HSM
#
# This file must be placed at:
#
# /etc/udev/rules.d/98-keep-key.rules (preferred location)
#
# To install, type this command in a terminal:
# sudo cp 98-keep-key.rules /etc/udev/rules.d/98-keep-key.rules
#
# After this file is installed, physically unplug and reconnect the

Keybase proof

I hereby claim:

  • I am Magicking on github.
  • I am 6l20 (https://keybase.io/6l20) on keybase.
  • I have a public key whose fingerprint is D169 8C5A 3D68 5B20 A004 DEA9 20A8 1F25 ECAF A6AA

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am magicking on github.
  • I am 6l20 (https://keybase.io/6l20) on keybase.
  • I have a public key whose fingerprint is D169 8C5A 3D68 5B20 A004 DEA9 20A8 1F25 ECAF A6AA

To claim this, I am signing this object:

%> coredumpctl gdb sway
PID: 31585 (sway)
UID: 1000 (magicking)
GID: 1000 (magicking)
Signal: 7 (BUS)
Timestamp: Mon 2018-12-24 22:30:14 CET (52min ago)
Command Line: ./sway -d
Executable: /home/magicking/source/gocode/src/github.com/swaywm/sway/build/sway/sway
Control Group: /user.slice/user-1000.slice/session-4.scope
Unit: session-4.scope
2018-12-24 22:30:13 - [sway/server.c:34] Preparing Wayland server initialization
2018-12-24 22:30:13 - [backend/session/logind.c:542] Successfully loaded logind session
2018-12-24 22:30:13 - [backend/backend.c:142] Found 2 GPUs
2018-12-24 22:30:13 - [backend/drm/backend.c:151] Initializing DRM backend for /dev/dri/card0 (i915)
2018-12-24 22:30:13 - [backend/drm/drm.c:63] Using atomic DRM interface
2018-12-24 22:30:13 - [backend/drm/drm.c:156] Found 3 DRM CRTCs
2018-12-24 22:30:13 - [backend/drm/drm.c:87] Found 9 DRM planes
2018-12-24 22:30:13 - [backend/drm/drm.c:129] (3 overlay, 3 primary, 3 cursor)
2018-12-24 22:30:13 - [render/egl.c:149] Using EGL 1.4
2018-12-24 22:30:13 - [render/egl.c:150] Supported EGL extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_IMG_context_priority EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_syn
0x48d24715FE9F7daa90286141f9b17e184B5A148B
@Magicking
Magicking / legislatives-2017.py
Created June 12, 2017 11:59
Liste des candidats ayant eu 0 voix
Dep Alpes-Maritimes (006 - 3) - ASIN Didier
Dep Ardèche (007 - 2) - VALLON Jean-Paul Louis
Dep Aude (011 - 2) - DEBONO Aurore
Dep Bouches-du-Rhône (013 - 1) - RADY Souaad
Dep Bouches-du-Rhône (013 - 1) - ABDALLAH Fouad
Dep Bouches-du-Rhône (013 - 2) - PERETTI Sébastien
Dep Bouches-du-Rhône (013 - 3) - MASSE Christophe
Dep Bouches-du-Rhône (013 - 4) - BOUDOUAYA Selma
Dep Bouches-du-Rhône (013 - 5) - ZIEBA Pierre-Frédéric
Dep Bouches-du-Rhône (013 - 6) - LABIBES Abdel
@Magicking
Magicking / event_handler.go
Created April 11, 2017 13:53
Event Handler
package main
import (
"fmt"
"log"
"time"
"net/http"
)
var c chan string
@Magicking
Magicking / spend_cold_minting.py
Created March 7, 2016 21:24
Cold minting spending
#using the neucoin_wip branch https://github.com/NeuCoin/pycoin/tree/neucoin_wip
from pycoin.tx.pay_to import address_for_pay_to_script, build_hash160_lookup
from pycoin.tx.pay_to.ScriptColdminting import ScriptColdminting
from pycoin.tx.tx_utils import create_tx
from pycoin.tx import Spendable
from pycoin.key import Key
from pycoin.serialize import h2b, h2b_rev
from pycoin.encoding import wif_to_secret_exponent
from time import time