Skip to content

Instantly share code, notes, and snippets.

View shopglobal's full-sized avatar
💻
deploying Electronero 2.0

⛓️INTERCHAINED ⚡Electronero Network ʕ•̫͡•ʔ-̫͡-ʕ•͓͡•ʔ-̫͡-ʕ•̫͡•ʔ-̫͡-ʔ shopglobal

💻
deploying Electronero 2.0
View GitHub Profile
@shopglobal
shopglobal / 01_deployContracts.js
Created August 25, 2023 23:12 — forked from BlockmanCodes/01_deployContracts.js
Uniswap V3 Flashloans and Arbitrage
const { Contract, ContractFactory, utils, BigNumber } = require("ethers")
const WETH9 = require("../WETH9.json")
const artifacts = {
UniswapV3Factory: require("@uniswap/v3-core/artifacts/contracts/UniswapV3Factory.sol/UniswapV3Factory.json"),
SwapRouter: require("@uniswap/v3-periphery/artifacts/contracts/SwapRouter.sol/SwapRouter.json"),
NFTDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/libraries/NFTDescriptor.sol/NFTDescriptor.json"),
NonfungibleTokenPositionDescriptor: require("@uniswap/v3-periphery/artifacts/contracts/NonfungibleTokenPositionDescriptor.sol/NonfungibleTokenPositionDescriptor.json"),
NonfungiblePositionManager: require("@uniswap/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json"),
WETH9,
## on ubuntu >= 20 only needed :
apt install postgresql-12 postgresql-server-dev-12 automake libtool inotify-tools make g++ libgmp-dev cargo zip unzip git curl libncurses5-dev libssl-dev wget tar git apt-transport-https curl build-essential screen
mkdir caddy
cd caddy && wget https://github.com/caddyserver/caddy/releases/download/v2.5.2/caddy_2.5.2_linux_amd64.tar.gz
tar -xvf caddy_2.5.2_linux_amd64.tar.gz
echo 'caddy run --adapter "caddyfile" --config "CaddyFile"' > startCaddy.sh
mkdir /usr/local/caddy
mv ~/caddy/caddy /usr/local/bin/caddy
@shopglobal
shopglobal / README.md
Last active June 20, 2022 09:26 — forked from mzabriskie/README.md
Check git status of multiple repos

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.

@shopglobal
shopglobal / GethBEHAVE.md
Created February 18, 2022 22:40 — forked from yorickdowne/GethBEHAVE.md
Pruning Geth 1.10.x

Overview

Geth (Go-Ethereum) as of January 2022 takes about 500 GiB of space on a fast/snap sync, and then grows by ~ 10 GiB/week. This will fill a 1TB SSD in ~6 months, to the point where space usage should be brought down again with an offline prune.

Happily, Geth 1.10.x introduces "snapshot offline prune", which brings it back down to about its original size. It takes roughly 4 hours to prune the Geth database, and this has to be done while Geth is not running.

Caveat that while several folx have used offline pruning successfully, there is risk associated with it. The two failure modes we have seen already are:

  • There is 25 GiB or less of free disk space
@shopglobal
shopglobal / geth-posh-build.ps1
Created February 5, 2022 20:21 — forked from tgerring/geth-posh-build.ps1
Geth build script for Windows Powershell
<#
.SYNOPSIS
Geth build script for Windows
.DESCRIPTION
A Powershell script to install dependencies for Windows and build go-ethereum binaries.
Make sure to run `Set-ExecutionPolicy RemoteSigned` in an Adminisrative Powershell window first
if you intend to run this as a script instead of in a console
.NOTES
File Name : geth-posh-install.ps1
Author : Taylor Gerring (taylor.gerring@gmail.com)
@shopglobal
shopglobal / stuns
Created December 21, 2021 11:54 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@shopglobal
shopglobal / update_git_repos.sh
Created August 21, 2021 00:55 — forked from douglas/update_git_repos.sh
Update all git repositories under a base directory
#!/bin/bash
# store the current dir
CUR_DIR=$(pwd)
# Let the person running the script know what's going on.
echo "\n\033[1mPulling in latest changes for all repositories...\033[0m\n"
# Find all git repositories and update it to the master latest revision
for i in $(find . -name ".git" | cut -c 3-); do
@shopglobal
shopglobal / spotify.js
Created October 2, 2017 07:23 — forked from daniel-j/spotify.js
A simple node.js program to listen to Spotify tracks, albums and playlists
#!/usr/bin/env node
'use strict';
/*
This is a simple Spotify cli-based client with optional Icecast2/shout support!
It should work for non-premium users, but you must connect your Spotify account to Facebook.
Usage:
$ node spotify <spotify uris> <playlist uri> <album uri> <track uri> <etc...>
@shopglobal
shopglobal / Copile C# Linux
Created August 26, 2018 01:22 — forked from saturnphp/Copile C# Linux
How to compile c# on ubuntu
==
Visual Studio
http://stackoverflow.com/questions/8264323/how-to-compile-a-visual-studio-c-sharp-project-with-mono
apt-get install mono-complete
and run from the command line :
xbuild mysolution.sln
xbuild myproject.csproj
@shopglobal
shopglobal / SHA_256_hak.cpp
Created June 27, 2018 02:49 — forked from hak8or/SHA_256_hak.cpp
SHA-256 basic implementation in C++ with a test.
#include <iostream>
#include <sstream>
#include <bitset>
#include <vector>
#include <iomanip>
#include <cstring>
// By: hak8or
// To compile: g++ -std=c++0x SHA_256_hak.cpp -o SHA_256_hak
// To run self test just run the following: SHA_256_hak