Skip to content

Instantly share code, notes, and snippets.

View thanhson1085's full-sized avatar

Nguyen Sy Thanh Son thanhson1085

  • Hanoi, Vietnam
View GitHub Profile
#!/bin/bash
cd /tmp && git clone https://github.com/tomochain/tomox-quickstart.git
cd tomox-quickstart && bash setup.sh
watch -n 3 "wc -l logfile"
wget https://dl.eff.org/certbot-auto
chmod +x certbot-auto
mv certbot-auto /usr/bin/certbot
certbot -d [domain]
crontab -e
0 5 * * 1 /usr/bin/certbot -q renew --post-hook "systemctl reload nginx"
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see https://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field separator to line break, so that we can iterate easily over the verify-pack output
ssh-agent bash -c 'ssh-add ./tmp_key; git push origin devnet -f'
#!/bin/bash
for i in {004..005}
do
A='{"type":"A","name":"'
B='","content":"xxxx","ttl":120,"priority":10,"proxied":true}'
DATA="${A}${i}${B}"
curl -X POST "https://api.cloudflare.com/client/v4/zones/xxx/dns_records" \
-H "X-Auth-Email: admin@tomochain.com" \
-H "X-Auth-Key: xxx" \
const web3Rpc = require('../models/web3rpc')
const config = require('config')
const logger = require('../helpers/logger')
const BigNumber = require('bignumber.js')
let sleep = (time) => new Promise((resolve) => setTimeout(resolve, time))
var nonce = 0
async function run (pkey, to) {
const account = web3Rpc.eth.accounts.privateKeyToAccount('0x' + pkey)
#!/bin/bash
touch .pwd
export $(cat .env | xargs)
WORK_DIR=$PWD
WS_SECRET="${WS_SECRET:-bgfmsp2r7TgIYA2HW48SkBQE6L4CUc}"
TOMOCHAIN_DIR="${TOMOCHAIN_DIR:-${HOME}/go/src/github.com/tomochain/tomochain}"
TOMOXSDK_DIR="${TOMOXSDK_DIR:-${HOME}/go/src/github.com/tomochain/tomox-sdk}"
BOT_DIR="${BOT_DIR:-${HOME}/tomox-market-maker}"
TOMORELAYER_DIR="${TOMORELAYER_DIR:-${HOME}/tomorelayer}"
// Use ethers JS libray
// Required ERC20 Abi
// Required Uniswap/Pancakeswap Router Abi
// Required Provider wallet (who provide the liquidity)
// Required Buyer wallet (who want to buy TEST token)
// Read docs https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#addliquidityeth
// Read docs https://docs.uniswap.org/protocol/V2/reference/smart-contracts/router-02#swapexacttokensfortokens
console.log('addLiquidity TEST BUSD ...')
let amm = new ethers.Contract(config.get('AMMRouterAddress'), ammRouterAbi, provider)