Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
now="$(date +'%d%m%Y')"
echo "Starting backup..."
#/snap/bin/gsutil cp -r gs://backup-newlikewallet/"$now" ./backup
DATE="$(date --date="-15 day" "+%s")"
echo $DATE
echo "successfully backup !"
list=`cd backup && ls`
@athlona64
athlona64 / gist:5f51084b14c76e99345a5e87c6728d5c
Last active May 26, 2020 08:40
autobackup&remove firestore
#!/bin/bash
now="$(date)"
printf "Current date and time %s\n" "$now"
now="$(date +'%d%m%Y')"
printf "Current date in dd/mm/yyyy format %s\n" "$now"
echo "Starting backup at $now, please wait..."
/snap/bin/gcloud beta firestore export gs://backup-bucket/"$now" --collection-ids={collection in firestore can commas for multiple collections}
#-15 day from today
DATE="$(date --date="-15 day" "+%s")"
@athlona64
athlona64 / gist:06aeac1b7f7f9e4061dd4d2336854e93
Created April 6, 2020 02:05
check active node with line notify
<?php
$content = file_get_contents("https://lokiblocks.com/service_nodes");
$data= explode('</a></td>', $content);
$a = 1;
$active = '';
$count = 0;
foreach($data as $value)
{
const wdio = require("webdriverio");
const opts = {
port: 4723,
capabilities: {
platformName: "Android",
platformVersion: "8",
deviceName: "Android",
// app: "/home/osboxes/client-appium/ApiDemos.apk",
@athlona64
athlona64 / ERC20Token.sol
Created March 5, 2020 03:23
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
//Your current Solidity version is//0.4.19+commit.c4cbbb05.Emscripten.clangpragma solidity ^0.4.4;contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success) {} /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfe
@athlona64
athlona64 / ERC20Token.sol
Created March 2, 2020 02:53
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
//Your current Solidity version is//0.4.19+commit.c4cbbb05.Emscripten.clangpragma solidity ^0.4.4;contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success) {} /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfe
@athlona64
athlona64 / abi polkadot
Last active February 13, 2020 02:28
abi polkadot claim
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_allocations","type":"address"},{"internalType":"uint256","name":"_setUpDelay","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"original","type":"address"},{"indexed":true,"internalType":"address","name":"amendedTo","type":"address"}],"name":"Amended","type":"event","signature":"0x385f6a4b73038a5f14e3482732f99dde086b6fd0930af57604250b72726f4392"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"eth","type":"address"},{"indexed":true,"internalType":"bytes32","name":"dot","type":"bytes32"},{"indexed":true,"internalType":"uint256","name":"idx","type":"uint256"}],"name":"Claimed","type":"event","signature":"0x9b01158d4bc10c112ba32b5240cda97e49e2eb86021f03f6a0f460342ac4dfda"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"eth","type":"a
@athlona64
athlona64 / jenkins
Last active January 31, 2020 04:44
//index.js
//importing node framework
var express = require(‘express’);
var app = express();
//Respond with "hello world" for requests that hit our root "/"
app.get(‘/’, function (req, res) {
res.send(‘hello world’);
});
//listen to port 3000 by default
@athlona64
athlona64 / OKAddress.dart
Created December 15, 2019 05:28
Flutter + Ethereum BIP39, BIP32
import 'package:bip39/bip39.dart' as bip39;
import "package:hex/hex.dart";
import 'package:web3dart/credentials.dart';
import 'package:bip32/bip32.dart' as bip32;
abstract class OKAddressETH {
String generateMnemonic();
String getPrivateKey(String mnemonic);
Future<EthereumAddress> getPublicAddress(String privateKey);
}
@athlona64
athlona64 / IERC20contract.sol
Created October 28, 2019 09:11
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.19+commit.c4cbbb05.js&optimize=false&gist=
pragma solidity ^0.4.21;
/**
* @title IERC20Token - ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract IERC20Token {
string public name;
string public symbol;