Skip to content

Instantly share code, notes, and snippets.

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

Ezeokafor GoodnessEzeokafor

🏠
Working from home
View GitHub Profile
const BCShopCourier = artifacts.require('./BCShopCourier.sol')
require('chai')
.use(require('chai-as-promised'))
.should()
contract('BCShopCourier', ([deployer,account1,account2,account3]) => {
let contract
before(async ()=>{
contract = await BCShopCourier.deployed()
// pragma solidity ^0.5.16;
pragma solidity >=0.4.22 <0.9.0;
/**
NOTE VERSION SPECIFIED SHOULD BE THE SAME SPECIFIED IN truffle-config.js
*/
interface CourierInterface{
function startItemTranpost(string calldata _sku) external;
function getItemStatus(uint256 itemD) external view returns(string memory status);
function getItemLocation(uint256 itemID) external view returns(string memory location);
}

SSH SETUP

  • copy and paste ssh-keygen on your local machine

initial server setup/user setup

  • ssh root@your_server_ip
  • adduser sammy
  • usermod -aG sudo sammy - setup root privileges for the user
  • ufw app list - setup a basic filewall
  • ufw allow OpenSSH - setup a basic filewall
  • ufw enable - setup a basic filewall

SSH SETUP

  • copy and paste ssh-keygen on your local machine

initial server setup/user setup

  • ssh root@your_server_ip
  • adduser sammy
  • usermod -aG sudo sammy - setup root privileges for the user
  • ufw app list - setup a basic filewall
  • ufw allow OpenSSH - setup a basic filewall
  • ufw enable - setup a basic filewall
@GoodnessEzeokafor
GoodnessEzeokafor / ec2.md
Last active January 11, 2021 14:24
setting up an ec2 instance and deploying a fullstack react project
  • launch an ec2 instance
  • visit security
  • click on launch wizard 1
  • edit security group and add an inbound rule
  • select type http with port 80 and select source as anywhere (0.0.0.0/0)

CONNECT TO INSTANCE

  • open your computer's terminal
  • locate your instance private key
  • connect using this command sudo ssh -i "privateKey.pem" instance.compute-1.amazonaws.com
@GoodnessEzeokafor
GoodnessEzeokafor / fix.md
Created July 2, 2020 21:17
Fix Green Screen

sudo apt remove gstreamer1.0-vaapi

  • Create a droplet
  • create a ssh key
  • copy the .pub and paste it
  • ssh into the project with the ip server address provided (ssh root@ip_serve)
  • after logging in create a user with root priveleges
    • adduser username

    • usermod -aG sudo username
  • sudo apt update
  • sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl
  • log into postgresql
@GoodnessEzeokafor
GoodnessEzeokafor / GETH.md
Last active February 14, 2020 07:20
Starting GETH LIGHT MODE
  • geth --syncmode "light"
  • cd ~/.ethereum
  • geth attach

AWS CREDENTIAL

  • AWS_ACCESS_KEY_ID = ''
  • AWS_SECRET_ACCESS_KEY = ''
  • AWS_STORAGE_BUCKET_NAME = ''
  • AWS_S3_CUSTOM_DOMAIN = '%s.s3.amazonaws.com' % AWS_STORAGE_BUCKET_NAME
  • AWS_S3_OBJECT_PARAMETERS = { 'CacheControl': 'max-age=86400', }
  • AWS_LOCATION = 'static'
@GoodnessEzeokafor
GoodnessEzeokafor / permission.md
Last active October 12, 2020 10:29
Adding Permission to a folder in python
  • $ sudo groupadd varwwwusers
  • $ sudo adduser www-data varwwwusers
  • $ sudo chgrp -R varwwwusers /var/www/media/
  • $ sudo chmod -R 770 /var/www/media/