Skip to content

Instantly share code, notes, and snippets.

💭
🐶

Dan Ξ AndreiD

💭
🐶
Block or report user

Report or block AndreiD

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AndreiD
AndreiD / vault-cheatsheet.md
Created Nov 21, 2019
hashicorp_vault_cheatsheet
View vault-cheatsheet.md

Databases

vault secrets enable database

vault write database/config/my-mysql-database
plugin_name=mysql-database-plugin
connection_url="{{username}}:{{password}}@tcp(127.0.0.1:3306)/"
allowed_roles="my-role"
username="root"
password="root-password-here"

@AndreiD
AndreiD / sendRawTransaction.js
Last active Dec 5, 2019
Sends a raw transaction with web3 1.2.2, ethereumjs-tx, and Infura
View sendRawTransaction.js
# FOR ETHER ->
web3.eth.getTransactionCount(this.address).then(txCount => {
const txData = {
nonce: web3.utils.toHex(txCount),
gasLimit: web3.utils.toHex(100000),
gasPrice: web3.utils.toHex( YOUR_GAS_PRICE), // 10-15 gwei should be ok
to: this.toAddress,
from: this.address,
View keybase.md

Keybase proof

I hereby claim:

  • I am AndreiD on github.
  • I am andyx (https://keybase.io/andyx) on keybase.
  • I have a public key whose fingerprint is BC8A 622D 8389 31E2 8783 FCDE 3FA1 A644 AA75 5128

To claim this, I am signing this object:

@AndreiD
AndreiD / go_upload_to_cloud.go
Last active Aug 21, 2019
upload /download to firebase google and to AWS S3 golang
View go_upload_to_cloud.go
//---------- Firestore -------------
// ********* UPLOAD *******
configStorage := &firebase.Config{
StorageBucket: "xxxxxxxxxxxxxxxxx.appspot.com",
}
opt := option.WithCredentialsFile("./config/serviceAccountKey.json")
app, err := firebase.NewApp(context.Background(), configStorage, opt)
if err != nil {
log.Error(err)
@AndreiD
AndreiD / easy_crypto_html_form.html
Created Jul 29, 2019
easycrypto_html_form.html
View easy_crypto_html_form.html
<form action="https://api.easycrypto.in/charge_form" method="POST">
<input type="hidden" name="title" value="Nice Watch #1" />
<input type="hidden" name="description" value="a nice looking watch..." />
<input type="hidden" name="metadata" value="optional metadata here" />
<input type="hidden" name="local_price" value="245" />
<input type="hidden" name="local_currency" value="USD" />
<input type="hidden" name="merchant_id" value="YOUR_MERCHANT_ID" />
<input type="hidden" name="redirect_url" value="https://www.your_website.com/sucess_url" />
<input type="submit" name="submit" value="PAY WITH CRYPTO" class="buttonSubmit" />
</form>
@AndreiD
AndreiD / ubuntu desktop setup helper
Last active Nov 20, 2019
ubuntu_desktop_bootstrap
View ubuntu desktop setup helper
# ATTENTION! Note for myself: do by hand, and update the script if necessary
# let'em have colors
end="\033[0m"
red="\033[0;31m"
green="\033[0;32m"
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt install -y build-essential software-properties-common autoconf dos2unix git htop glances less tree net-tools apt-transport-https ca-certificates
View stablecoin.sol
/**
* Source Code first verified at https://etherscan.io on Tuesday, November 28, 2017
(UTC) */
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
@AndreiD
AndreiD / erc20_one_file
Created Mar 11, 2019
ERC20 Token One File
View erc20_one_file
pragma solidity ^0.5.5;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
@AndreiD
AndreiD / fedora_setup.md
Last active Dec 27, 2018
fedora desktop setup
View fedora_setup.md

First we setup the repositories so we can install lots of stuff

sudo dnf install fedora-workstation-repositories -y

Install Rpmfusion repo

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y
@AndreiD
AndreiD / poascount_ubuntu.sh
Last active Nov 27, 2018
poascount blockchain explorer setup ubuntu 16
View poascount_ubuntu.sh
#!/bin/bash
set -e
# let'em have colors
end="\033[0m"
red="\033[0;31m"
green="\033[0;32m"
echo -e "${green}......................................${end}"
echo -e "${green}........ Script Version 1.0a .........${end}"
You can’t perform that action at this time.