Skip to content

Instantly share code, notes, and snippets.

View thanoojgithub's full-sized avatar
🏠
Working from home

thanooj kalathuru thanoojgithub

🏠
Working from home
View GitHub Profile
@thanoojgithub
thanoojgithub / Install_redis-server_on_ubuntu
Last active April 21, 2022 13:06
Install redis server on ubuntu
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
@thanoojgithub
thanoojgithub / MySQL installation in WSL2 ubuntu
Created April 22, 2022 09:50
MySQL installation in WSL2 ubuntu
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
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.
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
@thanoojgithub
thanoojgithub / docker_compose_1
Created September 17, 2024 07:08
Docker Compose for Spring Boot with MySQL
services:
db:
image: mysql:latest
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=mydb
- MYSQL_PASSWORD=secret
- MYSQL_USER=myuser
restart: always
@thanoojgithub
thanoojgithub / docker-compose.yml
Last active December 2, 2024 18:50
pull and execute ubuntu container using docker compose
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)
@thanoojgithub
thanoojgithub / Dockerfile
Last active December 26, 2024 00:28
Dockerfile - Ubuntu with basic Java configurations
# 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 \
@thanoojgithub
thanoojgithub / ParentChildList.sql
Created October 4, 2025 22:32
postgreSQL - to get list of parent and child relationship tables list
SELECT
n.nspname AS table_schema,
c.relname AS table_name,
COALESCE(parents.parent_tables, ARRAY[]::text[]) AS parent_tables,
COALESCE(children.child_tables, ARRAY[]::text[]) AS child_tables
FROM
pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN (
SELECT