Skip to content

Instantly share code, notes, and snippets.

View AnthonyLaw's full-sized avatar
🎯
Focusing

Anthony Law AnthonyLaw

🎯
Focusing
View GitHub Profile
@AnthonyLaw
AnthonyLaw / nem.js
Last active April 22, 2022 13:16
Sample Transaction for symbol-sdk v3
const { CryptoTypes } = require('symbol-sdk');
const { NemFacade } = require('symbol-sdk').facade;
// Signer Private Key
const privateKey = new CryptoTypes.PrivateKey("PRIVATE_KEY");
const keyPair = new NemFacade.KeyPair(privateKey);
// Create V1 transaction
const transferTransaction = facade.transactionFactory.create({
type: 'transfer_transaction_v1',
@AnthonyLaw
AnthonyLaw / nginx.md
Last active July 3, 2019 08:00
nginx-cheatsheet
@AnthonyLaw
AnthonyLaw / aws-instance-terraform.tf
Created June 1, 2019 15:44
aws-instance-terraform-example
provider "aws" {
region = "ap-southeast-1"
access_key = ""
secret_key = ""
resource "aws_instance" "ec2" { # I called name "ec2", you can change your own name
ami = "ami-0dad20bd1b9c8c004" # Image: Ubuntu Server 18.04 LTS (HVM), SSD Volume Type
instance_type = "t2.micro" # VM Spec
security_groups = ["${aws_security_group.allow_ssh.name}"]
key_name = "aws-anthony"
@AnthonyLaw
AnthonyLaw / docker_compose.sh
Created February 7, 2019 13:49
install Docker + Docker-compose
#!/bin/bash
# Install Docker + Docker-compose on Ubuntu 18.04
sudo true
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
@AnthonyLaw
AnthonyLaw / NIS1-Guide.md
Last active March 6, 2019 07:59
NIS Node setup for Local development

Node 4GB ram Spec

Nix.runNis.sh -> Linux

RunNis.bat -> Win

Please change the content inside (runNis)

java -Xms2800M -Xmx2800M -cp ".:./*:../libs/*" org.nem.deploy.CommonStarter

@AnthonyLaw
AnthonyLaw / catapult-api-list.md
Created June 27, 2018 03:16
Catapult api list
@AnthonyLaw
AnthonyLaw / nanowallet-wlt-process.js
Last active June 15, 2018 09:32
nanowallet .wlt Process
//create nem keypair. (get private key with public key)
// Encrypt private key using password
let encrypted = nem.crypto.helpers.encodePrivKey(privateKey, walletPassword);
/**
* Encode a private key using a password
*
* @param {string} privateKey - An hex private key
* @param {string} password - A password
@AnthonyLaw
AnthonyLaw / bip32.md
Last active May 25, 2018 04:33
NEM HD Wallet Process

addr:NCKLUXQDNR4O76YDIGAX4MAUHJ3RFZ7UWDAOZM3N

Step 1

Private: 4250371b25ef0450455aa45d6476202e3fbc4b5c3d596fdfd89b5fc2046bf793

Hash:122ccbf19fd00c86fbb6aab245e3a5371e01ac30ffc38452f8ae7fa8d2dec87615504b6a57685a0eeb329e7716fb4636c3738065c59f458164883c4d1b337b40

il: 18,44,203,241,159,208,12,134,251,182,170,178,69,227,165,55,30,1,172,48,255,195,132,82,248,174,127,168,210,222,200,118

@AnthonyLaw
AnthonyLaw / nem2-cli.md
Last active June 21, 2019 03:40
nem2-cli Short wiki

Profile

-p, --privatekey <privatekey> - Private key
-n, --network <network>       - Network Type: MAIN_NET, TEST_NET, MIJIN, MIJIN_TEST
-u, --url <url>               - NEM2 Node URL. Example: http://localhost:3000
--profile <profile>           - (Optional) profile name, if not private key will be stored as default

Create