Skip to content

Instantly share code, notes, and snippets.

View adrianchifor's full-sized avatar
🛠️
Keep building

Adrian Chifor adrianchifor

🛠️
Keep building
View GitHub Profile
@adrianchifor
adrianchifor / bsc_pswap.py
Last active September 15, 2021 23:13
PancakeSwap V2 usage with web3py
import time
import requests
from decimal import Decimal
from web3 import Web3
web3 = Web3(Web3.HTTPProvider("https://bsc-dataseed.binance.org/"))
input_address = "CONTRACT ADDRESS TO SELL"
output_address = "CONTRACT ADDRESS TO RECEIVE"
@adrianchifor
adrianchifor / backup.sh
Last active July 7, 2018 11:36
Mac encrypted backup
#!/bin/bash
if [ ! $(which 7za) ]; then echo "Install 7z: brew install p7zip"; return 1; fi
BACKUP_NAME="macbook-pro-home-backup.7z"
USER=$(whoami)
BACKUP_PATHS=(
"/Users/$USER/Google Drive/Backup/"
)
@adrianchifor
adrianchifor / kops.sh
Created May 29, 2017 20:39
kops setup example
kops create cluster \
--cloud=aws \
--admin-access=PRIVATE_VPN_CIDR \
--associate-public-ip=false \
--vpc=VPC_ID \
--network-cidr=VPC_CIDR \
--dns-zone=R53_HOSTED_ZONE_ID \
--master-zones=eu-west-1a,eu-west-1b,eu-west-1c \
--zones=eu-west-1a,eu-west-1b,eu-west-1c \
--node-count=3 \
@adrianchifor
adrianchifor / service.yml
Created May 29, 2017 17:33
k8s service example
apiVersion: v1
kind: Service
metadata:
name: example
namespace: development
spec:
type: NodePort
selector:
app: example
env: development
@adrianchifor
adrianchifor / example.yml
Created May 29, 2017 16:16
Example k8s secret
apiVersion: v1
kind: Secret
metadata:
name: example
namespace: development
data:
<key>: <base64 encoded value>
type: Opaque
@adrianchifor
adrianchifor / Jenkinsfile
Last active May 26, 2017 18:08
Jenkinsfile k8s
pipeline {
publish {
container('example')
}
kubernetes {
name('example')
secrets('example.yml')
environment {