Skip to content

Instantly share code, notes, and snippets.

@nikola43
nikola43 / Load balancer VPS
Last active April 26, 2025 13:23
Subgraph load balancer nginx
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 10s;
# Manual random load balance
map $request_id $backend_host {
default DOMAIN_1;
~*[13579a-f]$ DOMAIN_2; # if last char odd → subgraph2
}
server {
@nikola43
nikola43 / Config graph-node server.txt
Last active February 4, 2025 18:21
Deploying subgraph on Ubuntu 24.04
1 - Update and patch the system:
sudo apt update && apt upgrade -y
2 - Create a non-root user with sudo privileges:
adduser newusername
usermod -aG sudo newusername
3 - Configure SSH security:
# Edit /etc/ssh/sshd_config:
Port 2222 # Change default port
@nikola43
nikola43 / contracts...BulkTransfer.sol
Created November 6, 2024 13:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
@nikola43
nikola43 / script.bash
Created March 18, 2024 14:46 — forked from MicahZoltu/script.bash
Generate Ethereum Mnemonic & Address
mkdir temp
cd temp
cat >index.mjs <<'EOF'
import { ethereum, mnemonic, secp256k1, hdWallet } from '@zoltu/ethereum-crypto'
// necessary so @peculiar/webcrypto looks like browser WebCrypto, which @zoltu/ethereum-crypto needs
import webcrypto from '@peculiar/webcrypto'
globalThis.crypto = new webcrypto.Crypto()
export async function generateAccount() {
@nikola43
nikola43 / keybase.md
Last active September 12, 2019 09:09

Keybase proof

I hereby claim:

  • I am nikola43 on github.
  • I am nikola43 (https://keybase.io/nikola43) on keybase.
  • I have a public key ASCjO3IZuwTNQcKszhofGDZldBp8mmme0txIOEk8LKPw3Ao

To claim this, I am signing this object: