Normal view

There are new articles available, click to refresh the page.
Before yesterdayIRC mates

A Day with Linux Ubuntu Experience

22 November 2024 at 19:00

Explore the "A Day with Linux Ubuntu Experience," where you'll discover how Ubuntu offers a smooth and powerful operating system tailored for developers. This blog highlights its customizable interface, allowing users to tailor their environments to fit their workflow seamlessly.

Image description

This blog takes you through a typical day using Ubuntu, showcasing its user-friendly interface, robust security features, and extensive software library.

Discover how Ubuntu enhances productivity with essential applications for web browsing, communication, and multimedia tasks. Whether you're a beginner or an experienced user, learn tips and tricks to customize your environment and maximize efficiency.

Join us as we explore the seamless integration of tools that make Linux a preferred choice for developers and everyday users alike.

Day 1 of postgreSQL

21 November 2024 at 16:58

Today I am post my experiences and some notes of learning postgreSQL from Syed Jafer from “Parotta Salna” youtube channel.

Firstly made discussion about “flat files” and how to store data on flat files.

Flat Files

flat files refers similar to a csv file where data is stored separated by a space. for example,

Let us consider a hospital management of recording patient details.

name date-of birth phone disease
varun 12/12/2003 2837298372 fever
sakthiraj 12/11/2003 8273492989 whooping-cold&fever
saravana 27/09/2003 8237192929 stomach-ache

here all of them are separated with spaces. It is difficult for larger data to handle also we cannot add more than one value inserted, which causes confusion. for example,

sakthiraj 12/11/2003 8273492989 8239102983 whooping-cold&fever

phone number is added twice which causes confusion between phone and disease row.

This can be resolved by adding column names = value showing sample below

[varun]
name=varun
date_of_birth=12/11/2003
phone=2423453455
phone=9384753349
disease=fever

INTRODUCTION TO DATABASES

databases comes into picture, by handling large amounts of data, by handling duplicates or more than one value and can be queried based on the user needs at faster rate.

  • Databases contains list of tables which has number of rows and columns.

Database management System (DBMS)

Database Management System (DBMS) is a software system designed to manage, organize, and provide access to databases in an efficient and secure manner.

Types of Database models

  1. Hierarchial database model
  • Hierarichial database model is arranged like a “family tree like structure”.
  • data will be stored one below another.
- Hi
    * Hello
    * World

2. Network Database model

Network database model stores in a form of graph data structure.

  • A graph contains edges and vertices.
  • Vertices are the thing are object that are represented in a graph
  • Edges are used to connect between two vertices.

Best example: Neo4j is a graph database which has network of people with edges connected between people for a common cause between two people.

3. Relational database model

Relational database model is a organized list of data which is stored in a group of lists which are called tables. Also we make relationship between two tables by calling each of the list in a table.

Example: MySQL, postgreSQL, etc.,

Types of Integrity

  • Entity integrity – uniqueness

Entity integrity is defined as the maintainance of records which is unique and can be found with no duplication.

  • Referential integrity – verify connection

referential integrity is used to verify connection between relationship on two or more tables.

  • User-defined integrity – custom rules for the data

User can set their own rules for the given data to stored. Not feasible using SQL. Only done with programming languages (backend).

  • Domain integrity – valid data

domain integrity ensures valid data on each columns in a table.

for example: if we consider a column named ‘date’ then it must contain day/month/year format.

My first blog

8 May 2024 at 12:20
Greetings everyone. This is the very first blog I am ever posting on my personal site as a test. Thanks for stopping by.

uv- A faster alternative to pip and pip-tools

26 April 2024 at 17:52

Introduction

If you’re a Python developer, you’re probably familiar with pip and pip-tools, the go-to tools for managing Python packages. However, did you know that there’s a faster alternative that can save you time and improve your workflow?

Meet UV

uv is a package installer used for installing packages in python in a faster way. Which is written on Rust 🦀 , makes a warping speed in installation of packages as compared to pip and pip-tools.

Also, It is Free and Open Source done by astral-sh. which has around 11.3k stars on GitHub makes a very trending alternative package manager for python.

pip vs uv

As per astral-sh, they claim uv makes as very faster on installation of python packages, as compared to poetry , which is a another python package manager and pip-compile

Image courtesy: astral-sh ( Package Installation )

Also, we can able to create a virtual environment, at a warping speed as compared to python3 venv or virtualenv.

Image courtesy: astral-sh ( Virtual Environment )

My experience and Benchmarks

Nowadays, I am using uv as a package manager for doing my side projects. Which feels very good on developing python applications and it will be definitely useful on containerizing python applications using docker.

But now, uv has make my life easier with warping speed in installation on packages, suitable for building and deploying our containers as our need with many repitition and hassle-free in building docker containers.

Here is my comparison on pip and uv, Let’s start with pip

creating virtual environment with pip

The above pic shows that it takes almost 3.84 or approximately 4 seconds to create a virtual environment in python whereas,

creating Virtual environment using uv

uv takes just 0.01 seconds to create a virtual environment in python. Now we move on with installing packages such as fastapi and langchain at same time, which has more dependencies than ever worked with.

pip install fastapi langchain
Installation of fastapi and langchain using pip

This takes around 22.5 seconds, which is fast today 😂, Sometimes which makes it even slower during installation at crucial time. Now let’s check with uv.

Installation of langchain and fastapi using uv

uv, makes a warping installation of langchain and fastapi at same time within 0.12 seconds. 🤯💥

Which makes me to use ‘uv’ as my package manager for python while developing my projects at recent times.

uv Installation and usage

Firstly copy the command for installation using linux,

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.1.38/uv-installer.sh | sh

on Windows,

powershell -c "irm https://github.com/astral-sh/uv/releases/download/0.1.38/uv-installer.ps1 | iex"

for mac users, go and download official binaries provided by astral-sh, given here.

Virtual Environment creation

for creating virtual environments for python, we can use

uv venv <environment-name>

for <environment-name> give any name your wish.

Package Installation

for package Installation , we have to use

uv pip install <package-name>

Conclusion

Through this blog post, we have learned about uv package manager and how it is effective in making our python workflows faster and building our containers faster and ease of deployment .

To know about me, click on my github, Linkedin.


uv- A faster alternative to pip and pip-tools was originally published in Towards Dev on Medium, where people are continuing the conversation by highlighting and responding to this story.

How to create Servlet and Deploy on Apache Tomcat 10.1 in Linux

4 April 2023 at 17:00

I am going to explain about how to create servlet and Deploy on Apache Tomcat Server 10.1 manually in any Linux distributions.

Directory Structure should be represented as below

directory structure to run servlets

You can keep ‘aaavvv’ folder as any name you want.

How to create Servlet on Apache Tomcat 10 in Linux

Step:1

Create a folder in /usr/share/tomcat10/webapps folder , In that folder create any folder name as you like, I create ‘myapps’ folder name as example.

cd /usr/share/tomcat10/webapps/;sudo mkdir myapps

Step:2

Go into myapps , then create ‘WEB-INF’ directory

cd myapps;sudo mkdir WEB-INF

Step:3

Go into WEB-INF, then create ‘classes’ directory

cd WEB-INF;sudo mkdir classes

Step:4

Go into classes directory, and create java file named ‘TeamTesters.java’ for this example, you can create any name you want.

cd classes;sudo nano TeamTesters.java

code for TeamTesters.java

Step:5

Run java program using javac command

sudo javac TeamTesters.java -cp /usr/share/tomcat10/lib/servlet-api.jar

here -cp represents classpath to run the program

Step:6

Go to backward directory (i.e., WEB-INF) and copy the web.xml file from ROOT directory present in the webapps folder present in tomcat10 folder

cd ..;sudo cp ../../ROOT/WEB-INF/web.xml web.xml;

Then edit web.xml file by adding <servlet> and <servlet-mapping> tag inside <web-app> tag

sudo nano web.xml

<servlet> and <servlet-mapping> in web.xml file

Step:9

Goto backward directory , (i.e., aaavvv) then create index.html file

cd ..; sudo nano index.html

content in index.html

Step:10

goto browser and type,

http://localhost:8080/myapps

servlet running on browser
Statement printed on html page declared in java

Common Troubleshooting problems:

  1. make sure tomcat server and java latest version is installed on your system .
  2. check systemctl or service status in your Linux system to ensure that tomcat server is running.

Automate this stuff…

If you wanted to automate this stuff… checkout my github repository

GitHub - vishnumur777/ServletCreationJava


How to create Servlet and Deploy on Apache Tomcat 10.1 in Linux was originally published in Towards Dev on Medium, where people are continuing the conversation by highlighting and responding to this story.

A simple design calculator on linux command line

25 June 2022 at 09:57

when we open terminal or Konsole in Linux we used to think by using many utilities why calculators was not there interactively in it ?

Now here is the solution for it just by cloning a repository from GitHub on your PC. Here is the GitHub link to clone it.

Just open your terminal and make a directory for safety purpose for that type,

mkdir calculator;cd calculator

creating directory on my home directory and changing it to calculator

the above command explain about making and changing directory from home directory.

then type,

git clone https://github.com/vishnumur777/simplecalculatorbash

cloning repository through git command

this command will clone all the files present in the repository.

but please make sure that you have installed git on your PC.

Then change directory to simplecalculatorbash using

cd simplecalculatorbash/

changing directory to simplecalculatorbash

then type,

chmod +x calci.sh

modifying permissions to executables

this command changes the permission to run on user without depending on root . So that many PC cause this error that permission was denied while executing the file.

For execution run type,

./calci.sh

command to execute simplecalculator

and press enter key

which will run very colourful calculator interactive prompt by installing dependencies which I posted on GitHub.

calculator performing addition of two numbers interactively
❌
❌