- Display Your Current Location
- Print the current directory.
pwd
- Print the current directory.
Challenge 1: Summing Values using reduce
Write a function called sumArray that takes an array of numbers as input and returns the sum of all the numbers using the reduce method.
Example:
const numbers = [1, 2, 3, 4, 5];
const sum = sumArray(numbers);
console.log(sum);-
Which command is used to create a new database in MongoDB? a) use dbname b) create database c) db.createDatabase('dbname') d) db.createCollection('dbname')
-
How can you create a collection named "destinations" in the "travelr" database? a) db.createCollection('travelr.destinations') b) db.createCollection('destinations', 'travelr') c) db.createCollection('destinations')
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| def update_dynamodb_records(table_name, primary_key, new_field_name, new_field_value): | |
| # Create DynamoDB client | |
| dynamodb = boto3.client('dynamodb') | |
| # Update the records | |
| for key_value in primary_key: | |
| response = dynamodb.update_item( | |
| TableName=table_name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| def scan_dynamodb_gsi(table_name, index_name, account_tokens_file, output_file): | |
| # Read account tokens from file | |
| with open(account_tokens_file, 'r') as file: | |
| account_tokens = [line.strip() for line in file if line.strip()] | |
| # Create DynamoDB client | |
| dynamodb = boto3.client('dynamodb') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import argparse | |
| def delete_records(table_name, primary_keys): | |
| # Create DynamoDB client | |
| dynamodb = boto3.client('dynamodb') | |
| # Delete records one by one | |
| for key in primary_keys: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| locals { | |
| upload_directory = "${abspath("${path.root}/../..")}${var.static_content_directory}" | |
| app_fileset = fileset(local.upload_directory, "**/*.*") | |
| } | |
| variable "mime_types" { | |
| default = { | |
| htm = "text/html" | |
| html = "text/html" | |
| css = "text/css" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import time | |
| import boto3 | |
| import json | |
| sqs = boto3.resource('sqs') | |
| sqs_client = boto3.client('sqs') | |
| queueURL = "https://sqs.us-east-1.amazonaws.com/212612999379/terraform-example-deadletter-queue" | |
| queueURL2 = "https://sqs.us-east-1.amazonaws.com/212612999379/terraform-example-deadletter-queue-2" | |
| queueURL3 = "https://sqs.us-east-1.amazonaws.com/212612999379/terraform-example-deadletter-queue-3" | |
| queueURL4 = "https://sqs.us-east-1.amazonaws.com/212612999379/terraform-example-deadletter-queue-4" | |
| queueURL5 = "https://sqs.us-east-1.amazonaws.com/212612999379/terraform-example-deadletter-queue-5" |
afdafafsadfsafafafafdsadd