Skip to content

Instantly share code, notes, and snippets.

View tegila's full-sized avatar

Edson Tégila tegila

View GitHub Profile
@tegila
tegila / wireguard.sh
Created March 8, 2022 23:13
wireguard bootstrap
#!/bin/bash
systemctl disable wg-quick@wg0
systemctl stop wg-quick@wg0
PRIVATEKEY=$(wg genkey)
CONFIGFILE="/etc/wireguard/wg0.conf"
echo "[Interface]" > $CONFIGFILE
echo "PrivateKey = ${PRIVATEKEY}" >> $CONFIGFILE
@tegila
tegila / LXD.md
Last active March 25, 2022 20:25
ssh x1

lxc profile device remove default root
lxc profile device remove default eth0
lxc storage delete local
lxc config unset core.https_address
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <json-c/json.h>
#include <wsclient/wsclient.h>
int onclose(wsclient *c) {
fprintf(stderr, "onclose called: %d\n", c->sockfd);
#!/bin/bash
mkdir -p /mnt/linux
mount /dev/local/linux /mnt/linux
mount /dev/sda1 /mnt/linux/boot
mount -t proc none /mnt/linux/proc
mount -o bind /dev /mnt/linux/dev
mount -o bind /sys /mnt/linux/sys
mount -t devpts devpts /mnt/linux/dev/pts
@tegila
tegila / pyfetch.binance.futures.py
Last active January 9, 2022 01:14
Python fetch orderbook script for binance futures
import requests
import json
# SDK: https://binance-docs.github.io/apidocs/futures/en/#sdk-and-code-demonstration
# The base endpoint is: https://fapi.binance.com
res = requests.get('https://fapi.binance.com/fapi/v1/exchangeInfo')
print(res)
response = json.loads(res.text)
print(response)
// contracts/Valoriza.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol";
contract Valoriza is ERC20, AccessControl {
using SafeMath for uint256;
@tegila
tegila / wireguard.md
Created October 7, 2021 20:53 — forked from dockerlead/Tutorial.md
Wireguard on CentOS 7/8

Set Up Your Own WireGuard VPN Server on CentOS

This tutorial is going to show you how to set up your own WireGuard VPN server on CentOS. WireGuard is made specifically for the Linux kernel. It runs inside the Linux kernel and allows you to create fast, modern, and secure VPN tunnel. TL;DR

Prerequisites

This tutorial assumes that the VPN server and VPN client are both running CentOS operating system.

Step 1: Install WireGuard on CentOS Server and Desktop

Log into your CentOS server, then run the following commands to install WireGuard.

# CentOS 8
@tegila
tegila / ea6900.md
Last active September 11, 2021 23:25
ea6900

Downgrade your router if > 1.1.43.182871 back to 1.1.42.161129

  1. Setup local network:

ifconfig eth0 192.168.1.2 netmask 255.255.255.0

  1. Ping your router forever

ping 192.168.1.1

Start ping your router and observe when the TTL change from 100 to 64.

const fetch = require("node-fetch"); // "Fetch" HTTP req library
const finex = require("./finex");
let params = {
sku: 'start',
symbol: "tBTCUSD",
type: "LIMIT",
// target: 25500,
limit: 100,
// amount: 0.002, //0.0052, //200

!w ==> wallets
!o ==> orders
!p ==> positions
!s ==> setPosition {AMOUNT}( NEGATIVE IF SELL ) {SYMBOL}
!h ==> help