Skip to content

Instantly share code, notes, and snippets.

View notcod's full-sized avatar
💭
I may be slow to respond.

notcod

💭
I may be slow to respond.
View GitHub Profile
<?php
// Get array of all source files
$files = scandir("source");
// Identify directories
$source = "source/";
$destination = "destination/";
// Cycle through all source files
foreach ($files as $file) {
if (in_array($file, array(".",".."))) continue;
@notcod
notcod / node_nginx_ssl.md
Created February 28, 2021 04:25 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@notcod
notcod / getPubKey.py
Created July 21, 2021 02:15 — forked from CrackerHax/getPubKey.py
Python script for getting ethereum public key from transaction id
import web3
w3 = web3.Web3(web3.HTTPProvider('https://geth.golem.network:55555'))
tx = w3.eth.getTransaction('0x00ee93fd1e6fdbdf841b4458a078210449dce89525502c965fd3534ba397e2e3')
tx.hash
from eth_account._utils.signing import extract_chain_id, to_standard_v
s = w3.eth.account._keys.Signature(vrs=(
to_standard_v(extract_chain_id(tx.v)[1]),
w3.toInt(tx.r),
@notcod
notcod / MINIMUM ETHEREUM WALLET GENERATOR PYTHON 3
Created July 31, 2021 09:20
MINIMUM ETHEREUM WALLET GENERATOR PYTHON 3
from operator import xor
from functools import reduce
from random import randrange
from web3.auto.infura import w3
from time import time
RoundConstants = [
0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000,
0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009,
@notcod
notcod / Python3 create random ethereum addresses
Created August 1, 2021 00:13
Python3 create random ethereum addresses
from operator import xor
from functools import reduce
from random import randrange
from web3.auto.infura import w3
Rc = [
0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000,
0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009,
0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A,
0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003,
@notcod
notcod / Simple ETH gen Python
Created August 1, 2021 00:22
Simple ETH gen Python
from operator import xor
from functools import reduce
from random import randrange
Rc = [
0x0000000000000001, 0x0000000000008082, 0x800000000000808A, 0x8000000080008000,
0x000000000000808B, 0x0000000080000001, 0x8000000080008081, 0x8000000000008009,
0x000000000000008A, 0x0000000000000088, 0x0000000080008009, 0x000000008000000A,
0x000000008000808B, 0x800000000000008B, 0x8000000000008089, 0x8000000000008003,
0x8000000000008002, 0x8000000000000080, 0x000000000000800A, 0x800000008000000A,
@notcod
notcod / s
Created August 1, 2021 09:54
def func():
z = "01010011100101"
l = len(z)
p = 115792089237316195423570985008687907853269984665640564039457584007908834671663
x = Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240
y = Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424
for i in range(1, l):
lm, hm = 1, 0
lw, hg = 2*y % p, p
while lw > 1:
@notcod
notcod / ProofOfExistence.sol
Created September 17, 2021 21:36 — forked from ageyev/ProofOfExistence.sol
This smartcontract is used to store documents text on the Ethereum blockchain and to get the document by document's hash (sha256).
/*
This smartcontract is used to store documents text on the Ethereum blockchain
and to get the document by document's hash (sha256).
*/
contract ProofOfExistence{
/* ---- Public variables: */
string public created;
def secp256k1(z):
z = str(bin(z))[2:]
l = len(z)
p = 115792089237316195423570985008687907853269984665640564039457584007908834671663
x = Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240
y = Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424
for i in range(1, l):
lm, hm = 1, 0
lw, hi = 2*y % p, p
while lw > 1:
from hashlib import sha256
def litEndian(hexa):
return int.from_bytes(bytearray.fromhex(hexa.replace('0x', '')), byteorder='little')
def Format_8(m):
return str('{0:08x}'.format(litEndian('{0:08x}'.format(m))))
def Format_64(m):
return str('{0:064x}'.format(litEndian('{0:064x}'.format(m))))