Note: Regular user may skip the --authenticationDatabase admin
part
mongodump --host 127.0.0.1 -u root -p password --authenticationDatabase admin --db db_name --forceTableScan;
In this exercise, we will walk through the process of creating a basic infrastructure on AWS using Terraform, an open-source Infrastructure as Code (IaC) tool. Specifically, we'll create a Virtual Private Cloud (VPC) with two subnets, a public and a private one. We will also create an Internet gateway and a route table, which will be associated with our public subnet. This setup mimics a typical cloud infrastructure configuration, separating resources into public and private subnets for improved security and control.
If you wish to give it a shot before looking into the detailed step-by-step and the solution videos, here is an overview of what the created solution should deploy:
In this exercise, we will focus on manually building a simple VPC-subnet infrastructure on the AWS Console. This includes creating a VPC, two subnets (one public and one private), an Internet Gateway, and a public route table. By creating these elements manually, we will gain a deeper understanding of how intricate and challenging the process of creating and managing infrastructure can be. This will provide a foundation for appreciating the benefits of Infrastructure as Code (IaC) in automating these tasks and maintaining consistency across environments.
If you wish to give it a shot before looking at the detailed step-by-step and the solution videos, here is an overview of what the created solution should deploy:
Create an all around user for MySQL for dev purposes.
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'admin'@'%' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' WITH GRANT OPTION;
Forget about API passwords, they are useless in production.
You need the "Application Passwords" instead which can be used for "Basic" authentication when calling the REST API.
This requires HTTPS so this is normally not enabled in local development.
Problem: https://leetcode.com/problems/single-element-in-a-sorted-array/description/ Solution: https://leetcode.com/problems/single-element-in-a-sorted-array/solutions/4254843/rust-solution-using-binary-search/
Using binary search, seek middle. The idea is that since this is a sorted array, finding which side has the single element is just a matter of comparing adjacent items from the middle and the distance between middle and the edges.
For example, if the middle item and the item to the left is equal and the distance between the middle and the left is even, then the single element must not be on the left since the distance is an event number. It must be to the right.
impl Solution {
pub fn single_non_duplicate(nums: Vec<i32>) -> i32 {
Original problem: https://leetcode.com/problems/add-to-array-form-of-integer/description/
Posted solution: https://leetcode.com/problems/add-to-array-form-of-integer/solutions/4212467/rust-add-digits-by-digits-in-an-array-to-sum-very-large-numbers/
I thought it was just a simple string conversion and simple arithmetic but it's more complicated than that.
Given a very large number, simply add operation breaks even on i128 in rust.
I am working on several projects with neovim with TypeScript LSP installed.
In some projects, the auto import correctly set the path using relative paths.
However, some projects always starts its import at src
for some reason.
Tried to configure LSP to always use relative path but can't make it work.
Somehow, there is something in my project configuration that broke the LSP import.