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
@GoodnessEzeokafor
GoodnessEzeokafor / fix.md
Created July 2, 2020 21:17
Fix Green Screen

sudo apt remove gstreamer1.0-vaapi

@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

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
// 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);
}
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.4.22 <0.9.0;
import './BCShopCourier.sol';
interface SellerInterface{
function addSale(uint256 productID) external;
function buyerReceiveProduct(uint256 saleID)external;
function getProductPrice(uint256 productID) external view returns(uint256 price);
function getSaleStatus(uint256 saleID) external view returns(string memory status);
}
const BCShopCourier = artifacts.require("BCShopCourier");
const BCShopSeller = artifacts.require("BCShopSeller");
const BCShopBuyer = artifacts.require("BCShopSeller");
module.exports = async(deployer) => {
let deployBCShopCourier = await deployer.deploy(BCShopCourier)
.then(async(courier) => {
// console.log(data)
let deployBCShopSeller = await deployer.deploy(BCShopSeller, courier.address)
.then(async(seller) => {
pragma solidity >=0.4.22 <0.9.0;
import './BCShopSeller.sol';
import './BCShopCourier.sol';
contract BCShopBuyer {
address payable sellerAddress;
SellerInterface SellerContract;
CourierInterface CourierContract;
constructor(address payable _sellerAddress, address courierAddress) {
import math
from functools import reduce
class Calculator:
def __init__(self):
pass
def __str__(self):
return "Basic calculator"