Skip to content

Instantly share code, notes, and snippets.

View BedrosovaYulia's full-sized avatar

Yuliya Bedrosova BedrosovaYulia

View GitHub Profile
// 1. Import everything
import { Wallet, BigNumber, ethers, providers } from 'ethers'
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle')
/*
Mainnet
const provider = new providers.JsonRpcProvider('https://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh')
const wsProvider = new providers.WebSocketProvider('wss://eth-mainnet.g.alchemy.com/v2/cmHEQqWnoliAP0lgTieeUtwHi0KxEOlh')
*/
// This is a basic uniswap frontrunning MEV bot
// Made by Merunas follow me on youtube to see how to use it and edit it: https://www.youtube.com/channel/UCJInIwgW1duAEnMHHxDK7XQ
// 1. Setup ethers, required variables, contracts and start function
const { Wallet, ethers } = require('ethers')
const { FlashbotsBundleProvider, FlashbotsBundleResolution } = require('@flashbots/ethers-provider-bundle')
// 1.1 Setup ABIs and Bytecodes
const UniswapAbi = [{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"amountADesired","type":"uint256"},{"internalType":"uint256","name":"amountBDesire
@BedrosovaYulia
BedrosovaYulia / add_auto_increment_to_int_single_pk.sql
Last active January 6, 2022 19:46 — forked from carlosrobles/add_auto_increment_to_int_single_pk.sql
Add auto_increment to all the single PRIMARY KEY of type int of a database
DROP TABLE if exists temp;
CREATE TABLE temp (
`table` varchar(250) DEFAULT NULL,
`colum` varchar(250) DEFAULT NULL,
`type` varchar(250) DEFAULT NULL,
`number_of_PK` tinyint(2) DEFAULT NULL,
`alter` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@BedrosovaYulia
BedrosovaYulia / find_iam_users_and_groups.py
Created August 9, 2021 19:40 — forked from pandeybk/find_iam_users_and_groups.py
Find all IAM Users and assigned groups boto3
import boto3
iam = boto3.client('iam')
def find_user_and_groups():
for userlist in iam.list_users()['Users']:
userGroups = iam.list_groups_for_user(UserName=userlist['UserName'])
print("Username: " + userlist['UserName'])
print("Assigned groups: ")
for groupName in userGroups['Groups']:
import boto3
from itertools import chain
import csv
'''
Goal)
Create a matrix (csv) that consists of (and is used in an excel file capacity):
*** List out each policy (Managed and Inline) that are attached to a user.