Skip to content

Instantly share code, notes, and snippets.

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

Santhosh NC SanthoshNC

🏠
Working from home
View GitHub Profile
xdg-open custom_diagram.jpg # Opens the generated diagram in default image viewver.
from diagrams import Diagram, Cluster, Edge
from diagrams.custom import Custom
from diagrams.onprem.network import Nginx
from diagrams.onprem.network import Tomcat
from diagrams.onprem.inmemory import Memcached
from diagrams.onprem.queue import Rabbitmq
from diagrams.onprem.database import Mongodb
from diagrams.onprem.database import Mysql
from diagrams.elastic.elasticsearch import Elasticsearch
from diagrams import Cluster, Diagram
from diagrams.aws.compute import ECS
from diagrams.aws.network import ELB, Route53
from diagrams.aws.database import RDS
from diagrams.onprem.client import User
graph_attr = {
"fontsize": "25",
"bgcolor": "transparent"
}
xdg-open my_diagram.jpg # Opens the generated diagram in default image viewver.
xdg-open simple_diagram.png # Opens the generated diagram in default image viewver.
python3 1_basic_diagram.py # To run the file to generate diagram
ls -lrt # To check the files. A file called simple_diagram.png will be generated in the directory
from diagrams import Diagram # importing diagram package
from diagrams.aws.compute import EC2 # importing AWS EC2 resource
with Diagram("Simple Diagram"): # "Simple Diagram" is the name of the diagram. The image will be stored as "simple_diagram.png"
EC2("web") # An icon of EC2 will be generated with the name "web"
# To install Diagrams
pip install diagrams
# To install Graphviz
choco install graphviz
@SanthoshNC
SanthoshNC / gist:d2474ddb269b6cb822f9c6e447fe0b42
Last active August 6, 2021 16:28
Command to check Python3 version
# To check python version
python3 -V (or) python3 --version