Skip to content

Instantly share code, notes, and snippets.

View Bitatlas's full-sized avatar
🤓
Nerdo

Henrique Centieiro Bitatlas

🤓
Nerdo
View GitHub Profile
test test 1
@Bitatlas
Bitatlas / gist:4a6fa3742713f50c07ed6aa6ae78bd94
Created February 3, 2021 23:10
Common divider and mod inverse
def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:
g, y, x = egcd(b % a, a)
return (g, x - (b // a) * y, y)
def modinv(a, m):
g, x, y = egcd(a, m)
@Bitatlas
Bitatlas / eth.find.eddr
Last active February 3, 2021 06:07
Python geth eth code to find address
def find(addr):
for i in range(999000, 1000000): #here we define a range of blocks to search
txLen = len(w3.eth.getBlock(i).transactions) #to get the transactions and lenght of the transactions
for j in range(txLen): #this loop will go through all the transactions to check the transactions in the blocks
print("Block: %d/%d --- Transaction: %d/%d" % (i, highestBlock, j, txLen)) #will print the transaction in the block
if addr == w3.eth.getBlock(i, True).transactions[j]["from"]: #if we get a transaction with the adress that we are looking for, it will print the transaction hash
print("FOUND BABIBlock: %d\nTX: %s" % (i, w3.eth.getBlock(i).transactions[j].hex()))
return
#!/bin/bash
echo ECS_CLUSTER=bitatlas >> /etc/ecs/ecs.config
@Bitatlas
Bitatlas / index.html
Created March 23, 2020 06:46
EC2 User Data with EC2 Availability Zone echo
#!/bin/bash
# Use this for your user data (script without newlines)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
EC2_AVAIL_ZONE=(curl -s http://169.254.169.254/latest/meta-data/placements/availability-zone)
echo "<h1> Hello World, this is Henrique Centieiro from $(hostname -f) in AZ SEC2_AVAIL_ZONE </h1> " > /var/www/html/index.html
@Bitatlas
Bitatlas / index.html
Last active March 22, 2020 03:55
EC2 Boostrap HTTP script with Apache and hostname -f
#!/bin/bash
# Use this for your user data (script without newlines)
# install httpd (Linux 2 version)
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "Hello World, this is Henrique Centieiro from $(hostname -f)" > /var/www/html/index.html
#!/bin/bash
yum update -y
yum install -y httpd
echo '<h1>Hello World</h1>' > /var/www/html/index.html
systemctl start httpd
systemctl enable httpd
0x7644665E83f6AB14ADE6abCDA169cA341F42e910