Skip to content

Instantly share code, notes, and snippets.

View 0x123451's full-sized avatar

0x123451

  • /dev/tty
View GitHub Profile
@0x123451
0x123451 / ansible_local_playbooks.md
Created June 13, 2024 02:02 — forked from alces/ansible_local_playbooks.md
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
// 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
@0x123451
0x123451 / osxvpnrouting.markdown
Created February 29, 2024 18:01 — forked from taldanzig/osxvpnrouting.markdown
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

@0x123451
0x123451 / tmux-cheatsheet.markdown
Created February 27, 2024 03:49 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@0x123451
0x123451 / .block
Created December 17, 2023 21:17 — forked from mbostock/.block
Save SVG as PNG
license: gpl-3.0
@0x123451
0x123451 / sampler_full.py
Created June 15, 2023 20:50 — forked from behreajj/sampler_full.py
Sampler Full
import bpy
from math import cos, sin, fmod
from random import TWOPI
def append_group_inst(nodes, group_name, data=bpy.data, group_creation_func=None, use_fake_user=False, parent=None, custom_color=None):
group = None
try:
group = data.node_groups[group_name]
except IndexError:
@0x123451
0x123451 / perlin.py
Created October 27, 2022 15:54 — forked from eevee/perlin.py
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@0x123451
0x123451 / loop_files_folders_recursively.go
Created September 22, 2022 23:18 — forked from fubarhouse/loop_files_folders_recursively.go
Loop through files and folders recursively in golang
package main
import (
"fmt"
"os"
"path/filepath"
)
func run() ([]string, error) {
searchDir := "c:/path/to/dir"
@0x123451
0x123451 / .bash_profile
Created September 13, 2022 21:25 — forked from josephspurrier/.bash_profile
macOS Bash Profile
#################################################################################
#
# Bash Configurations and Aliases for OS X
#
# Latest: https://gist.github.com/josephspurrier/acf7327726df6587a56ff2c2062314fa
# This was modified so it can be included in your ~/.zshrc file with the command:
# source ~/.bash_profile
#
# It's recommended to use oh-my-zsh:
# sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
package main
import (
"fmt"
"os"
"time"
"github.com/joho/godotenv"
"github.com/slack-go/slack"
)