Skip to content

Instantly share code, notes, and snippets.

View Bambarello's full-sized avatar

Alex Bambarello

View GitHub Profile
@Bambarello
Bambarello / !Proxy setup
Last active February 22, 2024 21:00 — forked from AlekseiOvchinnikov13/!Proxy setup
Proxy setup
source https://habr.com/ru/articles/731608/
wget https://github.com/XTLS/Xray-core/releases/download/v1.8.6/Xray-linux-64.zip
mkdir /opt/xray
unzip ./Xray-linux-64.zip -d /opt/xray
chmod +x /opt/xray/xray
nano /usr/lib/systemd/system/xray.service
# (пример ниже)
@Bambarello
Bambarello / new-server.ini
Created November 24, 2023 20:16 — forked from Stakecraft/new-server.ini
run: ansible-playbook -i new-server.ini new-server-setup-ubuntu-22.yaml, node_exporter.service.j2 should be placed in templates directory
[servers]
YOUR-IP
[all:vars]
ansible_ssh_common_args='-o StrictHostKeyChecking=no'
ansible_python_interpreter='/usr/bin/python3'
prometheus_source_ip='PROMETHEUS-IP'
systemd_path='/etc/systemd/system'
default_ssh_user='ubuntu'
default_ssh_port='22'
#!/bin/sh
# Network data Script by Jonas Keidel 2012
LANG=C
echo "Network data:"
for i in $(ifconfig -a | egrep '^eth.+|^en.+|^eno.+' | cut -d ':' -f 1); do
# detect link
link=$(ethtool $i | grep "Link detected" | tr -s ' ' | cut -d: -f2)
# get mac address
@Bambarello
Bambarello / Oasis_state sync README.md
Last active November 26, 2021 17:58 — forked from valentinbud/README.md
oasis network state sync

The consensusrpc node

On localhost initiliaze the node with

ENTITY_DIR=/localhostdir/entity
ENTITY_ID=`cat $ENTITY_DIR/entity.json | jq -r .id`

mkdir -p /localhostdir/node-consensusrpc
cd /localhostdir/node-consensusrpc

oasis-node registry node init \
#!/bin/bash
set -e
export PATH="/root/.local/share/solana/install/active_release/bin:$PATH"
TEXTFILE_COLLECTOR_DIR=/var/lib/prometheus/node-exporter
FILENAME=solana_active_stake.prom
metrics_prefix=solana_monit_mainnet
ALL=$(timeout 45 solana validators --output json | jq -r '.currentValidators[] |[.identityPubkey, .activatedStake/1000000000] | @csv' )

Utils collection

Check next epoch stake

curl -sL https://gist.githubusercontent.com/AGx10k/e001f79e64a2440c406e9d0839ea0698/raw/sol_stake_next.sh | bash -s -- $(solana-keygen pubkey $HOME/solana/vote-account-keypair.json)

Check vote balance

solana balance $HOME/solana/vote-account-keypair.json

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
#!/bin/bash
GO_VERSION="1.15.2"
cd /tmp/ \
&& wget -q https://dl.google.com/go/go$GO_VERSION.linux-amd64.tar.gz \
&& rm -rf /usr/local/go && tar -C /usr/local -xzf go*.tar.gz \
&& rm go$GO_VERSION*.gz
echo "Creating default Go folders"
mkdir -p $HOME/go/bin
#!/bin/bash
remote_height=$(curl -s https://api.blockcypher.com/v1/eth/main | jq .height)
local_height=$(($(curl -sX POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://127.0.0.1:8545 | jq -r .result)))
re='^[0-9]+$'
if ! [[ $remote_height =~ $re ]] ; then
echo "error: remote_height is not a number" >&2; exit 1
fi
#####GRAPH-NODE######
#####NPM INSTALL#####
sudo apt update && \
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - && \
sudo apt -y install nodejs && \
sudo apt install -y libsecret-1-dev && \
nodejs -v && \
npm version
####DATABASE-SERVER##################