Skip to content

Instantly share code, notes, and snippets.

View hskang9's full-sized avatar
🏠
Working from home

Hyungsuk Kang hskang9

🏠
Working from home
View GitHub Profile
import 'package:flutter/material.dart';
import 'package:tonedetector/Screens/Login/login_screen.dart';
import 'package:tonedetector/Screens/Welcome/welcome_screen.dart';
import 'package:tonedetector/constants.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@hskang9
hskang9 / setup_ext_bob.sh
Last active March 10, 2021 19:01
Set up external bob for the testnet
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
curl https://getsubstrate.io -sSf | bash -s -- --fast
# Update Rust
rustup update nightly
rustup update stable
# Add Wasm target
rustup target add wasm32-unknown-unknown --toolchain nightly
@hskang9
hskang9 / setup_validator.sh
Last active March 10, 2021 19:02
set substrate node chainspec.json
# Install from git
git clone https://github.com/hskang9/did-project.git # or your substrate git repository
cd did-project
cargo build --release
cd ~/
# Kill all storage
rm -rf /tmp/validator
rm -rf nohup.validator.out
/root/did-project/target/release/node-template build-spec --chain=local > customSpec.json
/root/did-project/target/release/node-template build-spec --chain customSpec.json --raw > customSpecRaw.json
@hskang9
hskang9 / nginx.conf
Last active January 11, 2020 08:08
nginx for substrate
user www-data;
worker_processes 4;
events {
worker_connections 768;
# multi_accept on;
}
http {
@hskang9
hskang9 / thundertoken-failsafe.service
Last active July 7, 2019 14:55
Thundertoken failsafe service
# How to setup
# 1. Prepare thunder.json with allocated coinbase address generated from /home/ubuntu/thundercore-localchain/build/bin/puppeth
#
# 2. Initialize thunder token with init command
#
# 3. Specify etherbase (thundertoken address as an ethereum address) and add it as option --etherbase on ExecStart command.
#
# 3. sudo vi /lib/systemd/system/{service name}.service and copy/paste this code as a starter
#
# 4. Configure log folders and user to execute the command and give access with following commands
@hskang9
hskang9 / prometheus.service
Created June 8, 2019 16:25
Prometheus node exporter
useradd -m -s /bin/bash prometheus
# (or adduser --disabled-password --gecos "" prometheus)
# Download node_exporter release from original repo
curl -L -O https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
tar -xzvf node_exporter-0.17.0.linux-amd64.tar.gz
mv node_exporter-0.17.0.linux-amd64 /home/prometheus/node_exporter
rm node_exporter-0.17.0.linux-amd64.tar.gz
chown -R prometheus:prometheus /home/prometheus/node_exporter
@hskang9
hskang9 / failsafe.service
Last active July 7, 2019 08:41
failsafe script daemon for systemctl
# How to setup
# 1. sudo vi /lib/systemd/system/{service name}.service and copy/paste this code as a starter
#
# 2. Configure log folders and user to execute the command and give access with following commands
# sudo chmod 755 /lib/systemd/system/{service name}.service
#
# 3. Configure systemctl to register the service in the system as start script with `enable`
# sudo systemctl enable {service name}.service
#
# 4. `start` service to test registered service scripts
@hskang9
hskang9 / hover.style.tsx
Created April 29, 2019 09:39
Hover Componenet Style
const HoverContainer = styled.div`
background: url(${props => props.image});
background-size: cover;
background-position: center;
height: 100%;
color: white;
padding: 20px;
font-size: 18px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
font-weight: bold;
@hskang9
hskang9 / hover.component.tsx
Created April 29, 2019 09:37
Hover component
export class Hover extends React.Component<Props> {
// Set default properties
static defaultProps = {
text: "Hello World!",
color: "black",
}
// Items shown in property panel
static propertyControls: PropertyControls = {
@hskang9
hskang9 / hover.props.tsx
Created April 29, 2019 09:34
Properties for Hover Component
// Define type of property
interface Props {
text: string;
color: string;
}