Prepare the data directory:
sudo mkdir -p -m 777 mongo/primary
sudo chown -R 1001 mongo
'use client'; | |
import WebSocket from 'ws'; | |
let region = 'us-east-1'; | |
let appsyncID = process.env.APPSYNC_ID; | |
let apiKey = process.env.APPSYNC_API_KEY | |
let url = `wss://${appsyncID}.appsync-realtime-api.${region}.amazonaws.com/graphql` | |
const api_header = { |
pm list packages -f |
#!/bin/bash | |
echo "Usage: adb-logger <device ip:port> <file path with name>" | |
echo "Example: ./adb-logger 192.168.0.237:5555 ./device-logs/192.168.0.237" | |
waittime=60 | |
device=$1 | |
while : | |
do |
services: | |
# first, we define the three mongo servers that will act as replicas | |
# here, we steup the hostname ports, and startup command | |
# which is the same as discussed in the previous section | |
mongo1: | |
hostname: mongo1 | |
image: mongo | |
expose: | |
- 27017 | |
ports: |
custom: | |
splitStacks: | |
nestedStackCount: 50 | |
perFunction: false | |
perType: false | |
perGroupFunction: false |
curl -k -X POST "https://<URL>/<index>/_delete_by_query?pretty" -H 'Content-Type: application/json' -d' | |
{ | |
"query": { | |
"bool": { | |
"filter": [ | |
{ | |
"range": { | |
"@timestamp": { | |
"lt": "now-180d" | |
} |
const doSomething = () => { | |
console.log('Do Something Executed'); | |
} | |
// no callback invoked | |
module.exports.handler = function () { | |
// Lambda finishes AFTER `doSomething()` is invoked | |
setTimeout(() => doSomething(), 1000); | |
}; |
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3(); | |
let totalObjects = 0; | |
let dataMap = {}; | |
const formatBytes = (bytes) => { | |
const marker = 1024; | |
const gigaBytes = marker * marker * marker; | |
const decimal = 2; |
const ethers = require('ethers'); | |
const ECO = require('../contracts/ECOContract.json'); | |
const { CONTRACT_ADDRESS, DEPLOYER_KEY, NETWORK_URL } = process.env; | |
const provider = new ethers.providers.JsonRpcProvider(NETWORK_URL); | |
const deployerWallet = new ethers.Wallet(DEPLOYER_KEY); | |
// This block will come from DynamoDB last checkpoint block | |
const originBlock = 10730324; |