aws s3 ls --profile userY
https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html
python3 -m http.server
aws s3 ls --profile userY
https://docs.aws.amazon.com/AmazonS3/latest/userguide/WebsiteHosting.html
python3 -m http.server
aws dynamodb list-tables --profile userX --region us-east-1
api: https://docs.aws.amazon.com/cli/latest/reference/dynamodb/index.html#cli-aws-dynamodb
get-item put-item update-item delete-item batch-get-item batch-write-item
https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/dynamodb/src/main/java/com/example/dynamodb/ListTables.java
https://javatodev.com/spring-boot-dynamo-db-crud-tutorial/ (old java1 example, but with dynamodb from docker)
https://www.techgeeknext.com/cloud/spring-boot-aws-dynamodb-crud-example
$ docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -inMemory -sharedDb
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/examples-dynamodb-enhanced.html
https://bluexp.netapp.com/blog/aws-cvo-blg-dynamodb-pricing-how-to-optimize-usage-and-reduce-costs
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.html
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/service_code_examples.html
vite
next.js
Example with Vite:
npm create vite@latest
================================
npm install -g create-react-app
maxschwarzmueller https://github.com/academind/react-complete-guide-course-resources
PizzaStore: CartContext Modal Button
Modal basic:
https://github.com/academind/react-complete-guide-course-resources/blob/main/code/08%20Refs%20Portals/07-adding-a-modal-cmp/src/components/ResultModal.jsx
Modal forwardRef:
https://github.com/academind/react-complete-guide-course-resources/blob/main/code/08%20Refs%20Portals/08-forwarding-refs/src/components/ResultModal.jsx
Section 8 Working with Refs and Portals
Demo project: Project Manager:
https://github.com/academind/react-complete-guide-course-resources/blob/main/code/09%20Practice%20Project%20-%20Project%20Management/10-finished/src/App.jsx
Demo project: Quiz app:
https://github.com/academind/react-complete-guide-course-resources/blob/main/code/13%20Demo%20Project%20-%20React%20Quiz/08-finished/src/App.jsx
Authentication: https://github.com/academind/react-complete-guide-course-resources/blob/main/code/22%20Authentication/09-finished/frontend/src/components/AuthForm.js
{data && data.errors && (
<ul>
{Object.values(data.errors).map((err) => (
<li key={err}>{err}</li>
))}
</ul>
)}
https://github.com/jonasschmedtmann/ultimate-react-course
https://react.new/ - code sandbox
VS Code extentions:
prettier, eslint, liveserver
Quokka - JavaScript and TypeScript playground in your editor.
1) we should never update the state in render logic
2) component will be re-rendered on:
-state change
-props change
-parent change
-
https://www.youtube.com/watch?v=i-hoSg8iRG0&t=231s
https://github.com/facebook/create-react-app
npx create-react-app my-app
cd my-app
npm starthttps://react-bootstrap.github.io/getting-started/introduction/
npm install react-bootstrap bootstrap
const [items, setItems] = useState([]);
function handleAddItems(item) {
setItems((items) => [...items, item]);
}
function handleDeleteItem(id) {
setItems((items) => items.filter((item) => item.id !== id));
}
function handleToggleItem(id) {
setItems((items) =>
items.map((item) =>
item.id === id ? { ...item, packed: !item.packed } : item
)
);
}
<PackingList
items={items}
onDeleteItem={handleDeleteItem}
onToggleItem={handleToggleItem}
onClearList={handleClearList}
/>
export default function PackingList({
items,
onDeleteItem,
onToggleItem,
onClearList,
}) {...}
<button onClick={() => onDeleteItem(item.id)}>❌</button>
https://i.pravatar.cc/
https://i.pravatar.cc/200
https://i.pravatar.cc/200?u=499476
https://jsonplaceholder.typicode.com/
https://api.adviceslip.com/
https://api.adviceslip.com/advice/1
https://www.omdbapi.com/apikey.aspx
const isWatched = watched.map((movie) => movie.imdbID).includes(selectedId);
const watchedUserRating = watched.find(
(movie) => movie.imdbID === selectedId
)?.userRating;
function handleDeleteWatched(id) {
setWatched((watched) => watched.filter((movie) => movie.imdbID !== id));
}
localStorage.setItem('test', new Array((i * 1024) + 1).join('a'));
// Function to update the object state
const updateObject = () => {
// Update the state by creating a new object with the updated values
setMyObject({
...myObject, // Spread the current state
key2: 'updatedValue' // Update the desired key/value pair
});
};jconsole
jcmd; jcmd 207639 JFR.start duration=10s filename=asdf.jfr
jmc :
Standalone JMC and Plug-ins Download
Download JMC from: JDK Mission Control (JMC) 8 Downloads; ensure that you accept the license agreement.
IntelliJ IDEA provides integration with the following profilers:
Java Flight Recorder – the standard profiling tool shipped as part of the JDK.
Async Profiler – a very accurate profiler that can also collect native call and memory allocation data.
https://github.com/nodejs/help/wiki/Installation
https://www.youtube.com/watch?v=Gx4iBLKLVHk&list=PLwvrYc43l1Mz_c-vV1yVyvFNFZPAleSNE&index=8
1) Download zip from https://nodejs.org/en
2) Unzip and add to .bashrc
export NODE_HOME=/home/encaps/Downloads/node-v18.15.0-linux-x64/
export PATH=$PATH:$NODE_HOME/bin
git config credential.helper storegit config credential.helper 'cache --timeout 36000' # 10 hoursSpring Boot 3 + Spring Security 6 - JWT Authentication and Authorisation [NEW] [2023]
https://www.youtube.com/watch?v=KxqlJblhzfI
Spring Security Tutorial - [NEW] [2023]
https://www.youtube.com/watch?v=b9O9NI-RJ3o&t=1s
Java Tutorial - Complete User Login and Registration Backend + Email Verification
https://www.youtube.com/watch?v=QwQuro7ekvc&list=PLwvrYc43l1MzeA2bBYQhCWr2gvWLs9A7S&index=3
https://www.youtube.com/watch?v=KYNR5js2cXE
PostgreSQL tips: https://www.youtube.com/watch?v=9SGDpanrc8U&t=2273s
Postgres & docker compose https://youtu.be/-mwpoE0x0JQ?t=3943
https://github.com/amigoscode/microservices/blob/main/docker-compose.yml
docker compose up -d
docker compose ps
docker logs postgres -f
postgres https://youtu.be/p485kUNpPvE?list=PLwvrYc43l1Mwqpf9i-1B1gXfMeHOm6DeY&t=2438
https://github.com/amigoscode/spring-boot-fullstack-professional/blob/6-spring-data-jpa/src/main/resources/application.properties
spring.datasource.url=jdbc:postgresql://localhost:5432/amigoscode
spring.datasource.username=postgres
spring.datasource.password=password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.format_sql=true
> docker exec -it postgres bash
psql -U amigoscode
\l (to list databases)
CREATE DATABASE customer;
CTRL+D
CTRL+D
####
@Id
@SequenceGenerator(
name = "customer_id_sequence",
sequenceName = "customer_id_sequence",
allocationSize = 1
)
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator = "customer_id_sequence"
)
private Integer id;
##############################
\c customer (connect to db customer)
\dt (list of relations)
\d (list of relations)
\d customer (see table structure)
##########################
Mongo:
Developing with Docker - Docker in Practice || Docker Tutorial 8 https://youtu.be/6YisG2GcXaw?list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&t=231
Docker commands: https://gitlab.com/nanuchi/techworld-js-docker-demo-app/-/blob/master/README.md
https://gitlab.com/nanuchi/techworld-js-docker-demo-app/-/blob/master/docker-compose.yaml
https://gitlab.com/nanuchi/techworld-js-docker-demo-app/-/blob/master/Dockerfile
#################################
h2db
spring.h2.console.enabled=true
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.show-sql=true
#spring.jpa.properties.hibernate.format_sql=true
https://youtu.be/5yquJa2x3Ko?t=759 Mapper as Function
Create new test: Ctrl + Shift + t
Security:
https://amigoscode.com/courses/728126/lectures/13124158
https://www.youtube.com/watch?v=KxqlJblhzfI
https://www.youtube.com/watch?v=b9O9NI-RJ3o
Dan Vega:
https://www.youtube.com/playlist?list=PLZV0a2jwt22s5NCKOwSmHVagoDW8nflaC
ObjectMapper:
https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/ObjectMapper.html
https://www.baeldung.com/jackson-object-mapper-tutorial
https://link.springer.com/book/10.1007/978-1-4842-3676-5
An Authoritative Guide to Building Microservices, Web and Enterprise Applications, and Best Practices
@Entity
@PrePersist
void onCreate() {
this.setCreated(LocalDateTime.now());
this.setModified(LocalDateTime.now());
}
@PreUpdate
void onUpdate() {
this.setModified(LocalDateTime.now());
}
# H2-Console: http://localhost:8080/h2-console
# jdbc:h2:mem:testdb
spring.h2.console.enabled=true
<form id="logout" action="/logout" method="POST">
<input type="hidden" name="_csrf" value="{{_csrf.token}}" />
</form>
<script>
$(function(){
$('#logoutLink').click(function(){
$('#logout').submit();
});
});
</script>
JAVA DTO Pattern Tutorial
@ResponseStatus(HttpStatus.NOT_FOUND)
public class TestRuntimeException extends RuntimeException{
public TestRuntimeException(String id_not_found) {
}
}
spring:
h2.console.enabled: true
datasource:
url: jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
username: sa
password:
driver-class-name: org.h2.Driver
jpa:
hibernate.ddl-auto: create-drop
show-sql: true
defer-datasource-initialization: true
# properties.hibernate.format_sql: true
| @Bean | |
| CommandLineRunner commandLineRunner() { | |
| return args -> { | |
| System.out.println("Command line runner hooray"); | |
| }; | |
| } |
https://www.youtube.com/watch?v=azuwXALfyRg&list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&index=20
minikube kubectl -- apply | delete -f demo.yaml
minikube kubectl -- get deployment | nodes | pod | services | replicaset
minikube kubectl -- describe pod nginx-deployment-6895854749-7mjft
8 Basic Docker Commands || Docker Tutorial 4
- 2:25 docker pull
- 4:04 docker run
- 4:40 docker ps
- 5:06 docker run --options
- 6:17 docker stop
- 6:43 docker start
- 10:08 - docker ports, docker port mapping
- docker logs (in part 2)
- docker exec -it (in part 2)
Debugging Docker Containers with docker exec and docker logs || Docker Tutorial 5
- 1:56 docker logs
- 5:28 docker exec -it
Docker vs Virtual Machine | simply explained || Docker Tutorial 6
Overview of Workflow with Docker - Docker in Practice || Docker Tutorial 7
Developing with Docker - Docker in Practice || Docker Tutorial 8
0:14 - Pre-Requisites
0:55 - what we will do in this video
1:44 - 1st part: The JavaScript App (HTML, JavaScript Frontend, Node.js Backend)
https://gitlab.com/nanuchi/techworld-js-docker-demo-app
3:30 - 2nd part: MongoDB and Mongo Express Set-Up with Docker
5:00 - Docker Network concept and demo (docker-compose uses docker network under the hood, in the next video(s) I will show you how to do it with docker-compose)
15:33 - 3rd part: Connect Node Server with MongoDB container
Ingress, tls certificate
https://www.youtube.com/watch?v=5cNrTU6o3Fw
multiple containers in a pod, yaml example
https://www.youtube.com/watch?v=6YisG2GcXaw&list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&index=8
Mongo + NodeJS
stream the logs: docker -f
https://www.youtube.com/watch?v=WmcdMiyqfZs&list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&index=10
Dockerfile
docker ps -a
docker stop <containerid>
docker rm <containerid>
docker images
docker rmi <imageid>
docker build -t tagname:version .
docker images
docker run tagname:version
docker logs <containerid> -f
docker exec -it <containerid> /bin/sh
env (lists all env vars)
https://www.youtube.com/watch?v=vWSRWpOPHws&list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&index=11
AWS ECR - Elastic Container Registry
https://www.youtube.com/watch?v=p2PH_YPCsis&list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&index=13
Docker volumes
host volume:
docker run -v /home/mount/data:/var/lib/mysql/data
anonymous vokume:
docker run -v /var/lib/mysql/data
named volumes:
docker run -v name:/var/lib/mysql/data
https://www.youtube.com/watch?v=SBUCYJgg4Mk&list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&index=14
volumes demo
https://youtu.be/SBUCYJgg4Mk?list=PLy7NrYWoggjwPggqtFsI_zMAwvG0SqYCb&t=291
mongo, mysql, postgresql