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
# Use Ubuntu as base image | |
FROM ubuntu:25.04 | |
# Set non-interactive frontend for apt | |
ENV DEBIAN_FRONTEND=noninteractive | |
# Install prerequisites | |
RUN apt update && apt upgrade -y && apt install -y \ | |
wget \ | |
curl \ |
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
services: | |
ubuntu-container: | |
image: ubuntu:latest | |
container_name: ubuntu_container | |
tty: true | |
stdin_open: true | |
volumes: | |
- ./data:/data # Optional: Mount a local directory to the container | |
ports: | |
- "22:22" # Optional: Map SSH port if needed (or other services) |
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
services: | |
db: | |
image: mysql:latest | |
environment: | |
- MYSQL_ROOT_PASSWORD=root | |
- MYSQL_DATABASE=mydb | |
- MYSQL_PASSWORD=secret | |
- MYSQL_USER=myuser | |
restart: always |
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
java -version | |
docker run hello-world | |
docker pull mysql | |
docker images | |
docker images | |
REPOSITORY TAG IMAGE ID CREATED SIZE | |
mysql latest 680b8c60dce6 7 weeks ago 586MB | |
hello-world latest d2c94e258dcb 16 months ago 13.3kB |
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
Spring Boot Notes | |
@Component vs @Bean | |
The @Bean annotation is a method-level annotation, whereas @Component is a class-level annotation. | |
The @Component annotation doesn't need to be used with the @Configuration annotation, whereas the @Bean generic annotation has to be used within a class annotated with @Configuration. | |
If your component doesn't need to communicate with a database or return an HTTP result, you can use the @Service annotation whenever using the @Component annotation is possible. |
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
MySQL installation in ubuntu | |
sudo apt update | |
sudo apt upgrade | |
sudo apt install mysql-server | |
sudo apt install mysql-client | |
mysql --version | |
sudo usermod -d /var/lib/mysql/ mysql | |
sudo service mysql start | |
sudo service mysql status |
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
thanooj@thanoojWin10Home:~$ sudo apt update | |
thanooj@thanoojWin10Home:~$ sudo apt upgrade | |
thanooj@thanoojWin10Home:~$ sudo apt autoremove | |
thanooj@thanoojWin10Home:~$ sudo apt install redis-server | |
sudo service redis-server start | |
or |
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
Hadoop 3.2.2 | |
Start-up commands: | |
-------------------------------- | |
1. Stop the dfs and yarn first. | |
2. Remove the datanode and namenode directories as specified in the core-site.xml file. | |
3. Re-create the directories. | |
4. hdfs namenode -format | |
5. Then re-start the dfs and the yarn as follows. | |
start-dfs.sh | |
start-yarn.sh |
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
MySQL Shell 8.0.28 | |
Copyright (c) 2016, 2022, Oracle and/or its affiliates. | |
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. | |
Other names may be trademarks of their respective owners. | |
Type '\help' or '\?' for help; '\quit' to exit. | |
MySQL JS > \connect thanooj@localhost | |
Creating a session to 'thanooj@localhost' | |
Please provide the password for 'thanooj@localhost': ******** |
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
from pyspark.sql import SparkSession | |
from pyspark.sql.functions import * | |
from pyspark.sql.types import StructType, StructField, StringType, TimestampType | |
if __name__ == "__main__": | |
spark = SparkSession \ | |
.builder \ | |
.master('local') \ | |
.appName('pyspark-test-run') \ |
NewerOlder