Skip to content

Instantly share code, notes, and snippets.

View ImanMousavi's full-sized avatar

Iman ImanMousavi

View GitHub Profile
@ImanMousavi
ImanMousavi / index.html
Last active December 27, 2022 12:25
CryptoCurrency Live Ticker with Vue
<div id="app" v-cloak>
<header class="header-wrap">
<div class="header-row flex-row flex-middle flex-space">
<div class="if-small">
<div class="form-input dark">
<div class="push-right">🔎</div>
<input type="text" v-model="search" placeholder="Search token..." />
</div>
</div>

Creating an SSTP server on GCP


Local command line

  1. ssh-keygen -t rsa -b 4096 -C "YOUR EMAIL ADDRESS"
  2. write ssh key to ~/.ssh/gcp-sstp-box
  3. also save the key to an encrypted location, e.g. Lastpass
  4. gcloud config set project YOURGCPPROJECTNAME
  5. gcloud config compute/region set europe-west1 (or wherever you wish to host it)
  6. gcloud config compute/zone set europe-west1-b (or wherever)
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;
pragma experimental ABIEncoderV2;
contract Wallet {
address[] public approvers;
uint8 public quorum;
struct Transfer {
@ImanMousavi
ImanMousavi / Token-BulkSender.sol
Last active January 9, 2023 07:06
This DAPP was used to send token or ETH to many addresses in one transaction, and that can help user to save tx fee
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract BulkSender is Ownable {
ARG version=1.14.4
ARG file=dogecoin-${version}-x86_64-linux-gnu.tar.gz
ARG folder=dogecoin-${version}
FROM debian:stable as stage1
ARG version
ARG file
ARG folder
WORKDIR /the/workdir
RUN apt update
@ImanMousavi
ImanMousavi / docker-build.sh
Created June 10, 2022 11:43 — forked from jawi/docker-build.sh
Shell script to build, tag and push docker images to a (local) docker registry
#!/bin/bash
#
# Usage: ./docker-build.sh </dir/to/dockerfile> <remote-registry-prefix>
#
# Example: ./docker-build.sh node-agent-service 10.0.1.16:5000/inaetics
#
# needs docker command (v1.3 or later) in order to work.
#
# (C) 2015 - jawi - licensed under Apache Public License v2.
@ImanMousavi
ImanMousavi / docker-compose.yml
Created May 21, 2022 10:57 — forked from jorijn/docker-compose.yml
Docker Compose file to be used in combination with https://gist.github.com/Jorijn/141f49dd0c69901f28215893d5900bca. Place this in the cloned root of the blockbook project and run `docker-compose up -d`. Configuration sample: https://gist.github.com/Jorijn/c0f5d3daf6ab6d35ac25b47c2a5be331
version: "3"
services:
blockbook:
container_name: blockbook
restart: always
build: .
entrypoint:
- /go/src/blockbook/blockbook
- -sync
- -blockchaincfg=/home/blockbook/cfg/cfg.json
# coding=utf-8
import random
import sys
import math
import hashlib
import hmac
import requests
import time
//solidity 6.12
pragma solidity >=0.6.0 <0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
@ImanMousavi
ImanMousavi / tron_estimate_energy
Created November 9, 2021 17:20
TRON estimate energy
#!/bin/env python3
import collections
import statistics
import sys
import requests
import base58