Learning
  • Software Engineering Golden Treasury
  • Trail Map
  • Caching
    • Alternatives to use before using cache
    • Caching Architecture
    • Cache Invalidation and Eviction
    • Cache Patterns
    • Cache
    • Consistency
    • Distributed Caching
    • Issues with caching
    • Types of caches
  • Career
    • algo types
    • Backend Knowledge
    • Burnout
    • consultancy
    • dev-level
    • Enterprise Developer
    • how-to-get-in-tech-from-other-job
    • how-to-get-into-junior-dev-position
    • induction
    • Interview
    • junior
    • mid
    • New Job
    • paths
    • Principle/staff Engineer
    • Requirements for job
    • Senior Dev capabilities
    • learning
      • automating-beginner
      • company1
        • analyst-progression
        • core-eng-progression
        • dev-progression
        • perf-eng-progression
        • soft-deliv-progression
    • mentoring
      • mentor-resources
    • recruitment
      • questions
      • Spotting posers
  • Computer Science
    • boolean-algebra
    • Compiler
    • Finite State Machine
    • Hashing
    • Algorithms
      • Breadth Firth Search
      • complexity
      • Depth First Search
      • efficiency
      • Sliding Window
      • sorting
    • data-structures
      • AVL Trees
      • data-structures
      • Linked List
    • machines
      • Intel Machine
      • Turing Machine
      • von neumann machine
      • Zeus Machine
  • devops
    • The 5 Ideals
    • microservice
    • Artifact repository
    • Bugs and Fixes
    • Build police
    • cloud-servers
    • Deployments
    • Environments
    • GitOps
    • handling-releases
    • infrastructure-as-code
    • System Migrations
    • SDP
    • On Premises Hosting
    • Properties/configuration
    • Release process
    • Release
    • Roll Outs
    • serverless
    • Serverless
    • Cloud Services
    • Versioning
    • AWS
      • deploy-docker-esc
      • cloud-practitiioner-essentials-notes
        • Module 1 - Intro to AWS
        • Module 2 Compute in the cloud
        • Module 3 Global Infrastructure and Reliability
        • Module 4 Networking
        • Module 5 Storage and Databases
        • Security
        • 7 Monitoring and Aanlytics
        • 8 Pricing and Support
        • 9 Migration and Innovation
      • developer-associate
        • AWS Elastic Beanstalk
    • build-tools
      • Managing dependecies
      • Apache ANT
      • Gradle
        • Custom Plugins
        • local-jars
      • Project Management - maven
        • Archtypes
        • Build Lifecycles
        • Customising build lifecycle
        • Dependencies
        • Directory layout
        • jar-files
        • one-to-one
        • Modules
        • Phases
        • Maven Plugins
        • POM
        • profiles
        • setup
        • Starting a maven project
        • wrapper
    • CI/CD
      • Continuous Delivery
      • zookeeper
      • Continuous Integration (CI)
      • github-actions
      • Pipeline
      • Teamcity
    • Cloud computing
      • Overview
      • Service Models
      • Cloud Services
    • containers
      • Best Practices
      • Docker
    • Infrastructure
      • IT Infrastructure Model
      • Non functional Attributes (Quality Attributes)
        • Infrastructure Availability
        • Performance
        • Secruity
    • monitoring
      • Alerting
      • Monitoring & Metrics
      • Metrics
      • Ready pages
      • Splunk
      • Status pages
      • notes-devops-talk
      • logging
        • logging
        • issues
        • Logging
        • Logging
    • Service mesh
      • Service Discovery
      • Istio
    • Terraform
    • container-management
      • Kubernetes
        • commands-glossary
        • OLTP
        • config-maps
        • Links
        • ingress
        • SDP
        • minikube
        • filter
        • indexes
        • sidecar
        • continuous-deployment
  • General Paradigms
    • CAP theorem
    • designing data-intensive applications summary
    • a-philosophy-of-software-design-notes
    • Aspect oriented Programming (AOP)
    • Best Practice
    • Cargo Cult
    • Clean Code
    • Coding reflections
    • Cognitive Complexity
    • Complexity
    • Conventions
    • Design discussions
    • Design
    • Error Handling Checklist
    • Exceptions
    • Feature Flags/toggle
    • Functional requirements
    • Last Responsible Moment
    • Lock In
    • Named Arguments
    • Naming
    • Performance Fallacy
    • Quality
    • Redesign of a system
    • Resuse vs Decoupling
    • Rules for software designs
    • Sad Paths
    • Scaling Webservices
    • Scientific Method
    • stream-processing
    • Upstream and Downstream
    • Patterns
      • Client-SDK-Pattern
      • ORM
      • Api gateway
      • Business Rules Engine
      • cache
      • Composition Root
      • Dependency Injection Containers
      • Dependency Injections
      • Double Dispatch
      • Exception Handling
      • Gateway pattern
      • Humble Object
      • Inheritance for reuse
      • Null Object Pattern
      • Object Mother
      • Patterns
      • Collection pipeline pattern
      • Service Locator
      • Setter constructor
      • Static factory method
      • Step Builder Pattern
      • telescopic constructors
      • Toggles
      • API
        • Aims of API designs
        • Avoid Checked Exceptions
        • Avoid returning nulls
        • Be defensive with your data
        • convience-methods
        • Fluent Interfaces
        • Loan Pattern
        • prefer-enums-to-boolean-returns
        • return-meaningful-types
        • Small intefaces
        • Support Lambdas
        • Weakest type
      • Gang of Four
        • Builder
        • Factory Pattern
        • Strategy Pattern
        • Template
        • abstract Factory
        • Adapter
        • Bridge Pattern
        • Chain of responsibility
        • Command Pattern
        • Composite Design Pattern
        • Decorator Pattern
        • Facade Pattern
        • Flyweight pattern
        • Guard Clause
        • Interpreter
        • html
        • Mediator Pattern
        • Memento Pattern
        • Observer
        • Prototype
        • Proxy
        • Singleton
        • State Pattern
        • Visitor Pattern
    • Architecture
      • Entity Component System
      • Integration Operation Segregation Principle
      • Adaptable Architecture
      • Architecture
      • C4 Modelling
      • cell-based
      • Clean/Hexagonal Architecture
      • Codifying architecture
      • Correct By configuration
      • Cost Base Architecture
      • Data Oriented Design
      • deliberate
      • Domain oriented DOMA
      • Event Driven Architecture
      • Evolutionary Architecture
      • examples
      • Feature Architecture
      • Framework and Libraries
      • functional-core-imperative-shell
      • Layered Architecture
      • Micro services
      • monoliths-to-services
      • Multi tiered Architecture
      • Multi tenant application
      • Resilient Architecture
      • stage event driven architecture (SEDA)
      • links spring rest app
      • Tomato Architecture
      • Tooling
      • Types of architecture
      • checklist
        • Checklist for new project
        • Back end Architecture Checklist
        • Front end Architecture Checklist
        • Mobile Architecture Checklist
      • Cloud Patterns
        • Command and Query Responsibility Segregation (CQRS)
        • Event Sourcing & CQRS
        • Asynchronous Request and Reply
        • Circuit Breaker
        • Retry
        • Sidecar
        • Strangler pattern
      • Domain driven design
        • value & entity
      • Microservices
        • Alternatives to choosing microservices first when scaling
        • Consistency in distributed systems
        • 12 Factor applications
      • Modularity
        • Module monolith vs Microservices
        • Spring Moduilth
      • Architecture Patterns
        • Hexagonal architecture
        • Inverting dependencies
        • Layering & Dependency Inversion Principle
        • Mappings
        • Vertical Slice architecture
        • Web Client Server
        • domain
          • Business and Data Layers Separation
          • DTO
          • Domain Model Pattern
          • Domain Object
          • Transaction Script/ Use Case pattern
        • Enterprise Patterns
          • Concurrency
          • Distribution strategies
          • Domain layer patterns
          • Layering/organisation of code
          • Mapping to datasource
          • Session State
        • Usecases
          • Use case return types
      • Serverless
        • Knative
    • Design architecture aims
      • back of envelope
      • Design ideas
      • Design mistakes
      • high-volume-design
      • ISO Quality Attributes
      • Non functional requirements
      • “Designing for Performance” by Martin Thompson
      • High Performance
      • Qaulity Attributes
        • Availability
        • System Availability
        • Fault Tolerance
        • interoperability
        • Latency
        • Maintability
        • Modifiability
        • Performance
        • Readability
        • Reliability
        • Scalability vs performance
        • Scalability
        • Scaling
        • statelessness
        • Testability
        • Throughput
      • System Design
      • web-scalability-distributed-arch
        • scalable-and-distributed-web-architecture
    • README
      • Conflict-free Replicated Data Type
      • Fallacies
      • Load balancing
      • Rate Limiting
      • Transactions
    • Patterns of Enterprise Application Architecture
      • Repository Pattern
      • Rules Engines
      • scatter-gather
      • Specification Design Pattern
      • Table Driven Development
      • Workflow Design Patterns
        • Triggers
    • Principles
      • Do It Or Get Bitten In The End
      • Dont Repeat Yourself
      • Habitability
      • Keep it simple
      • Responsibility Driven Design
      • Ya Ain’t Gonna Need It
      • Conceptual Overhead
      • CUPID
      • Reuse existing interfaces
      • Facts and Fallacies
      • locality of behaviour
      • Separation of Concerns
      • Simplicity
      • SLAP principle
      • Step down rule
      • Unix Philosophy
      • Wrong abstractions
      • SOLID
        • 1. Single Responsibility Principle
        • 2. Open Close Principle
        • 3. Liskov Substitution Principle
        • 4. Interface Segregation Principle
        • 5. Dependency Inversion Principle
        • GRASP (General Responsibility Assignment Software Principles)
        • Solid for packages
          • jobs
          • CCP
          • CRP
          • REP
          • egress
          • gossip-protocol
        • STUPID
    • programming-types
      • Coding to Contract/Interface
      • Links
      • Declarative vs Imperative Programming Languages
      • defensive-programming
      • Design by contract
      • Domain Specific Languages (DSL)
      • Event Driven
      • file-transfers
      • Logical Programming
      • Mutability
      • Self Healing
      • Simplicity
      • Type Driven Design
      • Value objects
      • Aspect Oriented Programming
      • Concurrent and Parallel Programming
        • Actor Model
        • Asynchronous and Synchronous Programming
        • Batch processing
        • Concurrency Models
        • SAP
        • Multithreading
        • Non Blocking IO
        • Optimistic vs Pessimistic Concurrency
        • Thread per connection or request model
        • Actor
        • aysnchronous-tasks
          • Computational Graphs
          • Divide and conquer
          • Future
          • Thread Pool
        • barriers
          • Barriers
          • Race conditions
        • design
          • agglomeration
          • Communication
          • Mapping
          • Partitioning
        • Liveness
          • Abandoned Lock
          • Deadlocks
          • Livelock
          • Starvation
        • locks
          • Read write lock
          • Reentrant lock
          • Try Lock
        • Mutual Exclusion
          • Data Races
          • Mutual Exclusion AKA Locks
        • performance
          • Amdahl's Law
          • Latency, throughput & speed
          • Measure Speed up
        • synchronization
          • Condition variable
          • producer consumer pattern
          • Semaphore
        • Threads and processes
          • Concurrent and parallel programming
          • Daemon Thread
          • Execution Scheduling
          • sequential-parallel
          • Thread Lifecycle
          • threads-and-processes
      • Functional Programming
        • Currying
        • design-patterns-to-func
        • imperative-programming
        • First class functions
        • Functional Looping
        • Higher Order Functions
        • Immutability
        • Issues with functional Programming
        • Lambda calculus
        • Lazy & Eager
        • map
        • Monad
        • Railway Programming
        • Recursion
        • Reduce
        • referential-transparacy
        • Referential transparency
        • Supplier
      • oop-design
        • Issues with object oriented code
        • Aggregation
        • Anti Patterns
        • Association
        • class-and-objects
        • Composition
        • general-laws-of-programming
        • general-notes
        • Getters and Setters
        • Inside out programming
        • Inversion of control
        • oop-design
        • Other principles
        • Outside in programming
        • Readability
        • Why OO is bad
        • README
          • abstraction
          • encapsulation
          • inheritance
          • Polymorphism
        • clean-code
          • Code Smells
          • Comments
          • Naming
          • CLEAN design
            • code is assertive
            • Cohesion
            • Connascence
            • Coupling
            • Encapsulation
            • Loose Coupling
            • Nonredundant code
      • Reactive Programming
        • reactive-programming
    • Projects and Software types
      • Applicatoin Development
      • Buying or creating software
      • Console Applications
      • Embedded Software development
      • Enterprise
      • Framework Development
      • Games
      • Library development
      • Rewriting
      • White Label Apps
    • State Machines
      • Spring State Machine
  • Other
    • 10x devs
    • Aim of software
    • Choosing Technologies
    • Coding faster
    • Component ownership
    • developer-pain-points
    • Developer Types
    • Effective Software design
    • Full Stack Developer
    • Good coder
    • Issues with Software Engineering and Engineers
    • Learning
    • Logic
    • Role
    • Software Actions
    • Software craftmanship
    • Software Designed
    • Software Engineering
    • Software
    • article-summaries
      • General notes
      • Summary of The Grug Brained Developer A layman's guide to thinking like the self-aware smol brained
      • improve-backend-engineer
      • Optimising Api
      • Simple and Easy
    • README
  • Hardware
    • Cpu memory
    • Storage
  • Integration
    • GRPC
    • API
    • Apis and communications between apps
    • asynchronous and synchronous communications
    • Batch Processing
    • Communications between apps
    • Delivery
    • Distributed Computing
    • Entry point
    • Event Source
    • SDP
    • egress
    • Graphql
    • Idempotency
    • Libraries
    • Long Polling
    • Multiplexing & Demultiplexing
    • Publish Subscribe
    • Push
    • Request & Response
    • REST
    • Remote Method Invocation
    • Remote Procedure Calls
    • Server Sent Events
    • Short Polling
    • Sidecars
    • SOAP
    • Stateless and Stateful
    • Streams
    • Third Party Integrations
    • wdsl
    • Web Services
    • Webhooks
    • repository
    • Kafka
      • Kafka Streams
    • message-queues
      • ActiveMQ
      • Dead Letter Queue
      • JMS
      • Messaging
  • Languages
    • C
    • Choosing A Language
    • cobol
    • Composite Data Types
    • creating
    • Date time
    • Numbers
    • Pass by value vs Pass by reference
    • Primitive Data Types
    • REST anti-patterns
    • Rust
    • Scripting
    • Static typing
    • string
    • Task Oriented Language
    • assembly
    • Getting started
      • Functional Concepts
    • cpp
    • Java
      • Code style
      • Garbage Collection
      • Intellij Debugging
      • Artifacts, Jars
      • Java internals
      • Java resources
      • Java versions
      • JShell
      • Libraries
      • opinionated-guide
      • Starting java
      • Java Tools
      • Why use java
      • Advanced Java
        • Annotations
        • API
        • Database and java
        • Debugging Performance
        • Files IO
        • Finalize
        • JDBC
        • jni
        • Libraries
        • Logging
        • SAP
        • Memory Management
        • Modules
        • OTher
        • Packaging Application
        • Pattern matching
        • performance
        • Properties
        • Reference
        • reflection
        • Scaling
        • Scheduling
        • secruity
        • Serilization
        • Time in Java
        • validation
        • Vector
        • Concurrency and Multithreaading
          • Akka
          • ExecutorCompletionService
          • Asynchronous Programming
          • Concurrency and Threads
          • CountDownLatch
          • Conccurrent Data Structures
          • Executor Service
          • Futures
          • reactive
          • Semaphore
          • structured concurrency
          • Threadlocal
          • Threads
          • Virtual Threads
          • Mutual Exclusion
            • Atomic
            • Synchronized
            • Thread safe class
            • Threads
        • debug
          • heap-dumps
          • thread-dumps
        • functional
          • Collectors
          • Exception Handling
          • Flatmap
          • Functional Programming
          • Generators
          • Immutability
          • issues
          • Optional
          • Parallel Streams
          • Reduce
        • networks
          • HTTP client
          • servlet-webcontainers
          • sockets
          • ssl-tls-https
      • Basics of java
        • compilation
        • computation
        • Conditonal/Flow control
        • Excuting code
        • Instructions
        • Looping/Iterating
        • memory-types-variables
        • methods
        • Printing to screen/debugging
        • Setup the system
        • Data structures
          • Arrays
          • Arayslist/list
          • Map
      • Effective Java notes
        • Creating and Destroying Objects
        • Methods Common to All Objects
        • best-practice-api
        • Classes and Interfaces
        • Enums and Annotations
        • Generics
      • framework
        • aop
        • bad
        • Dagger
        • Databases
        • Lombok
        • Mapstruct
        • netty
        • resliance4j
        • RxJava
        • Vert.x
        • Spring
          • Spring Data Repositories
          • actuator
          • cloud-native
          • H2 Db in Spring
          • Initializrs
          • JDBC Template
          • Java Persistence API (JPA)
          • kotlin
          • Pitfalls and advice
          • PRoxies
          • Reactive
          • spring security
          • spring-aop
          • Spring Boot
          • spring-jdbc
          • Spring MVC
          • Spring Testing
          • Testing
          • Transaction
          • patterns
            • Component Scan Patterns
            • Concurrency
            • Decorator Pattern in Spring
        • Micronaut
          • DI
        • Quarkus
          • database
          • Links
      • Intermediate level java
        • String Class
        • Assertions
        • Casting
        • Clonable
        • Command line arguments
        • Common Libraries/classes
        • Comparators
        • Where to store them?
        • Shallow and Deep Copy
        • Date and Time
        • Enums
        • Equals and Hashcode
        • Equals and hashcode
        • Exceptions
        • Final
        • Finally
        • Generics
        • incrementors
        • Null
        • packages and imports
        • Random numbers
        • Regex
        • Static
        • toString()
        • OOP
          • Accessors
          • Classes
          • Object Oriented Programming
          • Constructors
          • Fields/state
          • Inheritence
          • Interfaces
          • Methods/behaviour
          • Nested Classes
          • Objects
          • Static VS Instance
          • Whether to use a dependency or static method?
        • Other Collections
          • Other Collections
          • Arraylist vs Linkedlist
          • LinkedHashMap
          • Linked List
          • Priority queue
          • Sequenced Collections
          • Set
          • Shallow vs Deep Copy
          • Time Complexity of Collections
          • What Collection To use?
    • kotlin
      • Domain Specific Language
      • learning
      • Libraries
      • Personal Roadmap
      • Links
    • Nodejs
      • Performance
  • Management & Workflow
    • Agile
    • Take Breaks
    • # Communication
    • Engineering Daybook
    • Estimates
    • Feedback Loops
    • Little's law
    • Managing Others
    • poser.
    • Presentations
    • self-improvement
    • software-teams
    • Task List
    • trade-off
    • Types of devs
    • Type of work
    • Waterfall Methodology
    • coding-process
      • Bugs
      • Code Review
      • Code Reviews
      • Documentation
      • Done
      • Handover
      • Mob Programming
      • Navigate codebase
      • Pair Programming
      • Pull Requests
      • How to do a story
      • Story to code
      • Trunk based development
      • Xtreme Programming (XP)
      • debugging
        • 9 Rules of Thumb of Dubugging
        • Debugging
        • using-debugger
      • Legacy code
        • Legacy crisis
        • Working with legacy code
    • Managing work
      • Theory of constraints
      • Distributed Teams
      • estimations
      • Improving team's output
      • Kanban
      • Kick offs
      • Retrospectives
      • Scrum
      • Sign offs
      • Stand ups
      • Time bombs
      • Project management triangle
    • Notion
    • recruitment
      • In Person Test
      • Interviews
      • Unattended test
  • Networks
    • Content Delivery Network - CDN
    • DNS
    • cache control
    • Cookies and Sessions
    • Docker Networking
    • Duplex
    • Etags
    • HTTP Cache
    • HTTP - Hyper Text Transfer Protocol
    • HTTP/2
    • Http 3
    • Internet & Web
    • iptables
    • Keep alive
    • Leader Election
    • Load balancer
    • long-polling
    • Network Access Control
    • Network Address Translation (NAT)
    • Network Layers
    • Nginx
    • OSI network model
    • Persistent Connection
    • Polling
    • Proxy
    • Quic
    • reverse-proxy
    • servers
    • Server sent events (SSE)
    • SSH
    • Streaming
    • Timeouts
    • Url Encoding
    • Web sockets
    • WebRTC (Web Real-Time Communication)
    • Wireshark
    • tcp/ip
      • Congestion
      • IP - Internet Protocol
      • TCP - Transmission Control Protocol
  • Operating Systems
    • Cloud Computing
    • Distributed File Systems
    • Distributed Shared Memory
    • Input/Output Management
    • Inter-Process Communication
    • Threads and Concurrency
    • Virtualization
    • Searching using CLI
    • Bash and scripting
    • Booting of linux
    • makefile
    • Memory Management
    • Processes and Process Management
    • Scheduling
    • Scripting
    • Links
    • Ubuntu
    • Unix File System
    • User groups
    • Linux
  • Other Topics
    • Finite state machine
    • Floating point
    • Googling
    • Setup
    • Unicode
    • Machine Learning
      • Artificial Intelligence
      • Jupyter Notebook
    • Blockchain
    • Front End
      • Single Page App
      • cqrs
      • css
      • Debounce
      • Dom, Virtual Dom
      • ADP
      • htmx
      • Island Architecture
      • Why use?
      • Java and front end tech
      • mermaidjs
      • Next JS
      • javascript
        • Debounce
        • design
        • Event loop
        • testing
        • Typescript
        • react
          • Design
          • learning
          • performance
          • React JS
          • testing
      • performance
      • Static website
    • jobs
      • Tooling
      • bash text editor - vim
      • VS code
      • scaling
        • AI Assistant
        • Debugging
        • General features and tips and tricks
        • IDE - Intellij
        • Plugins
        • Spring usage
  • persistance
    • ACID - Atomicity, Consistency, Isolation, Durability
    • BASE - Basic Availability, Soft state, Eventual Consistency
    • Buffer
    • Connection pooling
    • service
    • Database Migrations - flywaydb
    • Databases
    • Eventual Consistency
    • GraphQL
    • IDs
    • indexing
    • MongoDB
    • Normalisation
    • ORacle sql
    • Partitioning
    • patterns
    • PL SQL
    • Replication and Sharding
    • Repository pattern
    • Sharding
    • Snapshot
    • Strong Consistency
    • links
    • Files
      • Areas to think of
    • hibernate
      • ORM-hibernate
    • Indexes
      • Elastisearch
    • relationships
      • many-to-many
      • SDP
      • serverless
      • x-to-x-relationships
    • sql
      • Group by
      • indexes
      • Joins
      • Common mistakes
      • operators
      • performance
    • types
      • maven-commands-on-intellij
      • in-memory-database-h2
      • Key value database/store
      • Mongo DB
      • NoSQL Databases
      • Relational Database
      • Relational Vs Document Databases
  • Security
    • OAuth
    • API Keys
    • Certificates and JKS
    • Cluster Secruity
    • Communication Between Two Applications via TLS
    • Cookies & Sessions
    • CORS - Cross-Origin Resource Sharing
    • csrf
    • Encryption and Decryption
    • Endpoint Protection
    • JWT
    • language-specific
    • OpenID
    • OWASP
    • Secrets
    • Secruity
    • Servlet authentication and Authorization
    • vault
  • Testing, Maintainablity & Debugging
    • Service-virtualization and api mocking
    • a-test-bk
    • Build Monitor
    • Builds
    • Code coverage
    • consumer-driven contract testing
    • Fixity
    • Living Documentation
    • Mocks, Stubs & Doubles
    • patterns
    • Quality Engineering
    • Reading and working with legacy code
    • Reading
    • remote-debug-intellij
    • simulator
    • Technical Debt
    • Technical Waste
    • Test cases
    • Test Data Builders
    • Test Pyramids
    • Test Types
    • Testing Good Practice
    • Testing
    • What to prime
    • What to test
    • Debugging
      • Debugging in kubernetes or Docker
    • fixing
      • How to Deal with I/O Expense
      • How to Manage Memory
      • How to Optimize Loops
      • How to Fix Performance Problems
    • Legacy Code
      • Learning
      • Legacy code
      • techniques
    • libraries
      • assertj
      • Data Faker
      • Junit
      • mockito
      • Test Containers
      • Wiremock
      • Yatspec
    • Refactoring
      • Code Smells
      • refactoring-types
      • Refactoring
      • Technical Debt
      • pyramid-of-refactoring
        • Pyramid of Refactoring
    • Test first strategies
      • Acceptance Testing Driven Developement (ATDD)
      • Behaviour Driven Development/Design - BDD
      • Inside out
      • Outside in
      • Test driven development (TDD)
    • testing
      • Acceptance tests
      • How Much Testing is Enough?
      • Approval Testing
      • Bad Testing
      • End to end tests
      • Honeycomb
      • Testing Microservices
      • Mutation testing
      • Property based testing
      • Smoke Testing
      • social-unit-tests
      • solitary-unit-tests
      • Static Analysis Test
      • Unit testing
  • Version Control - Git
    • Branch by Abstraction
    • feature-branching
    • Git patches
    • Trunk Based Development
Powered by GitBook
On this page
  • Shortcuts
  • profiles
  • bash commands
  • Help/Manuals
  • Tab completion
  • Pipes
  • cd
  • pwd
  • ls
  • mv
  • cp
  • file
  • symlinks
  • create file or directory
  • deleting file or directory
  • zipping and unzipping
  • find
  • locate
  • clear
  • Bash history
  • diff
  • cat
  • less
  • more
  • Head and Tail
  • echo
  • cut
  • grep
  • sed
  • awk
  • kill a process
  • show processes
  • Watch
  • view ports
  • Permissions
  • ssh
  • Network information
  • Curl
  • Ping
  • telnet
  • scp
  • sftp
  • cron
  • shutdown
  • environment variables
  • xargs
  • Chmod and chown
  • Alarms
  • Fun
  • Others
  • makefiles
  • vi
  • Links

Was this helpful?

  1. Operating Systems

Bash and scripting

PreviousSearching using CLINextBooting of linux

Last updated 1 year ago

Was this helpful?

  • Born again shell

  • Interpts your commands and feeds it to the kernal

Shortcuts

  • to got beginning of line - ctrl + a

  • to got end of line - ctrl + e

  • clear screen - ctrl + l

  • terminate command - ctrl + c

  • previous command - arrow up

  • later command - arrow down

  • Exit out of shell - ctrl + d

profiles

  • files

    • profiles

      • .bash_profile and .profile which are only run at the start of a new login shell. (bash -l)

      • run once

    • .bashrc

      • is a shell script that Bash runs whenever it is started interactively. It initializes an interactive shell session. You can put any command in that file that you could type at the command prompt.

      • You put commands here to set up the shell for use in your particular environment, or to customize things to your preferences. A common thing to put in .bashrc are aliases that you want to always be available.

        • place where you can set up variables, functions and aliases, define your (PS1) prompt and define other settings that you want to use every time you open a new terminal window.

      • .bashrc runs on every interactive shell launch

        • > bash in terminal will run bashrc

  • alias

    • Can use alias/shortcuts for commands and place them in your profile

    • alias mqc="mvn clean verify"

  • environment variables

    • set export <env variable in uppercase>=<value of env variable>

bash commands

Help/Manuals

  • Examples - not all commands will have these help commands

    • man ps

    • ps --help

    • ps --help simple

    • ps -h

    • ps help

    • info ps

Tab completion

  • can use tab to complete a command, or give options for the command

  • Instead of searching contents of directory first (ie cd then ls)

  • examples

    • cd /dir/h then tab, will autocomplete if one exists -> cd /dir/hello

      • if multiple options exists -> will show them below hello hi hop

Pipes

  • Takes the output of one command passes it as the input to the next command

  • Can keep chaining

  • Examples

    • echo 123 | rev -> 321

    • echo 123 | rev | rev -> 123

cd

  • change directories

  • navigate to dir directory from current directory: cd dir

  • navigate to directory using home path: cd ~/dir

  • navigate to directory using full path: cd /home/temp/dir

  • navigate to directory using env variable: cd $BASE/temp/dir

  • navigate to home directory: cd

  • navigate to previous directory: cd -

  • navigate up a directory: cd ..

    • navigate up two directories up: cd ../..

    • navigate up a directory and down to another: cd ../childDir

pwd

  • pwd - shows current directory

ls

  • shows contentst of directory

  • ls - shows files and directories in current directory

  • ls dir/child - shows files and directories, from directory dir/child in current directory

  • ls /dir/child - shows files and directories, from directory dir/child from root

  • ls -a - shows files and directories, including hidden ones

  • ls -l - shows one per line, showing file or directory permission, Owner and Group Name, File size, created/modified date and time, file/folder name"

    • ls -l file.txt - shows detail of specific file

    • ls -l dir/ - shows detail of all files in directory

    • ls -lh - output is human readable, useful when details are given, shows you can combine flags

  • ls -F - shows files and directories, but directories will have trialing /

  • ls -lR - shows files and directories, of current and child directories

  • ls -lS - shows files and directories, sorted by size

  • unzip -l dir.zip - shows contents of zipped file

mv

  • moves a file or directory from one location to another

  • Change the name of a file

  • Examples

    • Change name of file: mv file.txt newFile.txt

    • Change name of directory: mv dir newDir

    • Move directory to similar format: mv dir{1,11}

    • Move file from current location to a directory: mv file.txt /tmp

    • Move multiple files: mv file1 file2 dir1

    • Move all files and directories to another, not dot files: mv ~/dir/* ~/dir1/

    • Move all files and directories to another: (shopt -s dotglob; mv ~/dir/* ~/dir1)

    • Move all files but subfolders: find ~/dir/ -type f -print0 | xargs -0 mv -t ~/dir1

    • Move all files of type to a directory: mv *.pdf ~/dir

    • Move file from specific location to a directory: mv /current/file.txt /tmp

    • Move directory to another directory: mv dir1 dir2

    • Overwrite a file on moving, will ask for confirmation: mv -i file.txt newFile.txt

    • Force a file to be moved, especially if it is read only: mv -f file.txt newFile.txt

    • Dont move a file if it already exists at new location: mv -n file.txt newFile.txt

    • Back up a file, at the current location, this will append a ~: mv -b file1 .

cp

  • Copies a file

  • Examples

    • Copy a file to a new file or overwrites an existing one: cp file.txt newFile.txt

    • Copy a file to a new file to new location: cp file.txt /dir

    • Copy multiple files to a new file to new location: cp file1.txt file2.txt /dir

    • Copy all files of a pattern to new location: cp *.txt /dir

    • Copy the contents of folder: cp -r /dir /other

file

  • Describe what type a file is

  • useful for checking type of file, what extension it is, if unknown

  • file file.txt - returns details about the file

symlinks

  • A symlink (symbolic) is a type of file that points to other files or directories (folders) in Linux.

  • Create symlink: ln -s file.txt file_link.txt

  • Create symlink for dir: ln -s dir dir_link

  • remove symlink: rm file_link.txt

  • OVerride symlink: ln -sf file.txt file_link.txt

create file or directory

Directories

  • Create a new directory

  • Examples

    • Create a new directory in current one: mkdir newDir

    • Create a new directory with root permission in current one: sudo mkdir newDir

    • Create a new directory in specific location: mkdir /parent/newDir

    • Create a multiple new directories: mkdir dir1 dir2

    • Create a multiple new directories using shortcut: mkdir dir{1..10}

    • Create directory with permissions (chmod): mkdir -m 777 dir1

    • Create multiple directories with permissions (chmod): (umask u=rwx,g=rwx,o=rwx && mkdir -p a/b/c)

    • Create directoires and subdirectories, but lacks error message: mkdir -p /parent/sub/subsub

      • if already exists, will ignore command

Files

  • Examples

    • empty file: touch file.txt

    • empty file: > file.txt

    • file with contents: echo "ello world" > file.txt

    • Create file with multiple lines: cat > sales.txt then type and to save ctrl+d

    • Append data to a file: echo "next line" >> file.txt

    • Open a nano or vi, and save file

    • open nano or vi with the new filename: vi file.txt

tee

  • read from standard input and write to standard output and files

  • ls -l | tee output.txt - outputs the commands then saves to file

deleting file or directory

  • Delete a file: rm file

  • Delete multiple files: rm file1 file2

  • Delete multiple files of type: rm *.pdf

  • Delete empty directories: rm -d dir1 dir2

  • Delete filled directories: rm -r dir1 dir2

  • Delete a file, with confirmation: rm -i file

  • Delete a file with force: rm -f file

  • Delete a file with logging: rm -v file

zipping and unzipping

  • To install: sudo apt install zip

Zipping

  • Zipping multiple folders: zip -r temp.zip dir1 dir2

  • Zipping multiple files: zip temp.zip file1 file2

  • Zipping all files in same dir: zip temp.zip *

  • Zipping all files in same dir, of type: zip -0 temp.zip *.txt

  • Zipping all files in same dir, including hidden: zip temp.zip .* *

  • Zipping multiple files, quiet mode: zip -q temp.zip file1 file2

  • Zipping multiple files, password protected: zip -e temp.zip file1 file2

  • Zipping multiple files, split into multiple zip files: zip -s 1g temp.zip file1 file2

  • Zip files using specific compression, default is 6: zip -9 temp.zip file1 file2

  • Add file to zipped file: zip exisiting.zip newFile

  • Add dir to zipped file: zip -r exisiting.zip newdir/*

Unzipping

  • unzip: unzip temp.zip

  • unzip to specific location: unzip temp.zip -d ./tmp

find

  • find all files in directory: find .

  • find all files in specific directory: find dir

  • find all files with file name extension: find . -name=*.log

  • find all files with file name: find . -name=file.*

  • find all files with file name with size: find . -size +500k

  • Execute a command for all results returned by find: find . -name=file.* -exec echo {} \ or find . -name=file.* -exec du -h {} \

  • Precheck/dry run execute a command for all results returned by find, especially for rm: find . -name=file.* -exec echo rm {} \

locate

  • searches in a snapshot of your disk, so need to run updatedb if adding a new file/dir

  • find file, return path of file: locate file.txt

clear

  • https://phoenixnap.com/kb/clear-termina

  • Ctrl+L / Ctrl+Shift+K

  • clear - clear screen, but can scroll up for it

  • reset - reset command reinitializes the terminal and restores settings to default

Bash history

  • show history

    • search history | grep your_search

  • clear bash history completely: history -c

  • rerun last command !!

  • rerun last command with sudo: sudo !!

  • history shows key value pair, can run the key for a specific command in history: !2003

  • rerun last nth command !!-n

  • Reverse search

    • ctrl + r then start typing the command that is in history it will show, and can autocomplete with tab

    • can repeatedly press ctrl + r to show other matching entries in history

    • might need to use ctrl + shift + r

  • Links

    • https://www.howtogeek.com/howto/44997/how-to-use-bash-history-to-improve-your-command-line-productivity/

diff

  • find difference between two files

    • good for comparing log files, especially large files

  • diff file1.txt file2.txt - shows the difference between the two files

    • diff file1.txt file2.txt --side-by-side - show both files

    • diff file1.txt file2.txt --color - add colour

cat

  • Displays the contents of a file

  • concatenate files and print on the standard output

  • Examples

    • cat file.txt

    • Display contents of multiple files: cat file1.txt file2.txt

    • Display contents of multiple files, after input will show next file: cat file1.txt - file2.txt

    • Display contents of pattern: cat *.txt

    • Display content of specific lines (lines 3 to 6): cat file.txt | sed -n '3,6p'

    • Sort line and display contents: cat -v file.txt | sort

    • Display line numbers: cat -n file.txt

    • Suppress empty lines: cat -s file.txt

    • Highlight end of line: cat -E file.txt

    • Display all tabs and nonprinting characters: cat -A file.txt

    • Display contents in reverse order: tac file.txt

    • Copy contents of one file to another: cat file1.txt > file2.txt

    • Append contents of one file to another: cat file1.txt >> file2.txt

    • Append contents of multiple files to another: cat file1.txt file2.txt > newfile.txt

less

  • displays the contents of a file or a command output, one page at a time

  • less file open file in less

  • less -N file open showing line numbers

  • less -F file follow file

  • searching in less

    • Down arrow, Enter, e or j - Move forward one line

    • Up arrow, y or k - Move backward one line

    • Space bar or f Move Forward one page

    • b - Move back one page

    • /<regex search term> searching forward

    • ?<regex search term> search back

    • n - repeat previous search

    • N - repeat previous search backwards

    • pg up or pg down goes up and down through output

    • Ng - go to nth line

    • shift + g - to end of output

    • shift + p - to start of output

    • shift + f - to follow output while in less

  • https://www.lifewire.com/what-to-know-less-command-4051972

more

  • allows you to quickly view a file and shows details in percentage. You can page up and down. Press ‘q‘ to quit out from the more window.

  • Commands in more:

    • enter - scroll next line

    • space - next page

    • b - previous page

    • z 10 - displays next 10 lines

    • d 10 - scolls next 10 lines

    • / word - search for regex

    • q - exit

  • Examples:

    • more -d sample.txt - with instructions

    • more -p sample.txt - clear screen then prints

    • more -c sample.txt - keep screen, and overlaps

    • more -s sample.txt - squash multiple blank lines

    • more +/word sample.txt - searches for word/regex, use commands to navigate results

    • more +30 sample.txt - displays text, after 30 lines

Head and Tail

  • head -3 <filename> - show first n number of lines

  • tail -3 <filename> - show last n lines

  • tail -f <filename> - follow end of file, great for following logs as a program is run

echo

  • This takes the text you give it and sends it somewhere—back to the screen, to a file, or to another command. Example: echo "hello!"

  • Examples

    • echo Hello

    • echo "Hello World"

    • echo -n "Hello World" - remove new line

    • echo -e "Hello\tWorld\n\n" - backslash enabled for special characters

    • echo -E "Hello\tWorld\n\n" - backslash disabled

    • price="\$100 "$ echo 'The price of this book is $price" - sub variable, Only substitutes if using double quotes

cut

  • When you have a string with separators in it, use cut to filter out certain fields.

  • echo "this, that, and the other" | cut -d, -f2 # "that"

  • TBC ....................

grep

  • To find lines of text that contain a certain string, use grep.

  • Example:

    • help: grep --help or man grep

    • Specific word from a file: grep 'root' /etc/passwd # root:x:0:0:root:/root:/bin/bash

    • Specific word from any file in directory: grep “string” *

    • Show all results that dont match the specific pattern from any file in directory: grep -v “string” *

    • Match multiple strings, return matching line, across new lines: grep -e ‘hello’ -e ‘fizz’’ file.txt

    • Specific word from any file in directory, return filename: grep -l “string” *

    • Specific word from any file in directory, return line number: grep -n “string” file.txt

    • Specific word, ignoring case, from any file in directory: grep -i “string” *

    • Specific word from specific files in directory: grep “string” file.txt file1.txt

    • Specific word from specific files with extension in directory: grep “string” *.txt

    • Specific word from any file in specific directory: grep -r “string” dir

    • Specific word from any file in specific directory, excluding directory: grep -r --exclude-dir=dir1 “string” *

    • Specific word from any file in specific directory, excluding directories: grep -r --exclude-dir={dir1,dir2} “string” *

    • Specific word from any file in directory and subdirectories: grep -r “string” *

    • Specific word from any file in directory and subdirectories and follow symbolic links: grep -R “string” *

    • Specific word with wild card (match word and anything after) from any file in directory: grep “string*” *

    • Count number of appearance of word and location across multiple files: grep -0 “string” | cut -d ‘:’ -f 1 | uniq -c

    • match across multiple lines in a file: grep -Pzo ‘(?s)from.*to’ file.txt

    • match across multiple words on the same line: grep ‘from.*to’ file.txt

    • Show 3 lines before and after the matched word: grep -C 3 "pattern" file.txt

    • Show 3 lines before the matched word: grep -B 3 "pattern" file.txt

    • Show 3 lines After the matched word: grep -A 3 "pattern" file.txt

    • Show 1 line before and 2 lines after matched word: grep -B 1 -A 2 "pattern" file.txt

    • Show all lines before the 2nd matched word in the file: head -n $(( $(grep -m 2 -n "sed" lorem.txt | tail -n 1 | cut -d ':' -f 1) - 1 )) lorem.txt

    • Show all lines after the 2nd matched word, not including matched word, in the file: tail -n $(( $(wc -l < lorem.txt | tr -d ' ') - $(grep -m 2 -n "sed" lorem.txt | tail -n 1 | cut -d ':' -f 1) )) lorem.txt

    • Count

      • https://www.warp.dev/terminus/grep-count

sed

  • Sed is the ultimate stream editor.

  • Links

    • https://www.grymoire.com/Unix/Sed.html

    • https://www.digitalocean.com/community/tutorials/the-basics-of-using-the-sed-stream-editor-to-manipulate-text-in-linux

    • https://www.baeldung.com/linux/sed-editor

  • Deleting text

    • examples...

  • Printing text

    • examples...

  • Substitution

    • examples...

  • Search

    • Given file containing multiple lines of this form: Time: 2022-12-08 00:25:10.828 UTC AccountID: 1563 Env: prod [...] and we want to find the value between AccountID and Env, we can use: sed -e 's/.*AccountID: \(.*\)Env.*/\1/' log_file.txt

awk

  • TBC..............

kill a process

  • kills a process

  • xkill and click window to close

  • xlsclients list open windoes

  • ps -A | grep -i <processName> - to kill process

  • kill 7507 - kill a process using pid

show processes

top

  • monitoring processes, mem usuage etc

  • headings

    • PID - process ID, a unique positive integer that identifies a process.

    • USER - usernmae that maps to user id, who started the process

    • PR - priority of the process

    • NI - nice value of process, affects the priority

    • VIRT - total amount of memory consumed by a process

    • RES - memory consumed by the process in RAM

    • SHR - memory shared with other processes

    • %MEM - value as a percentage of the total RAM available

    • S - state of process

    • %CPU - % of cpu

    • TIME+ - total CPU time used by the process since it started

    • COMMAND - name of process

  • Commands

    • pg up/pg dwn - to scroll

    • N - sort by PID

    • M - sort by memory usage

    • T - sort by running time

    • R - reverse order

    • H - shows running threads

    • c - show full path of command

    • V - show parent child heirachy of commands

    • U - search process by user

    • O - search by filter, after applying one filter, can apply another filter on top

      • COMMAND=blah

      • !COMMAND=blah

      • %CPU>3.0

      • = to clear filters

    • q - to quit

  • Examples

    • top -o %CPU - sort by CPU

vmstat

  • https://www.redhat.com/sysadmin/linux-commands-vmstat

du

  • monitoring disk usuage

  • `du -sh *`` summarises disk usages of the files in the current directory we use

    • du -sh /root/test total disk usage in folder and subfolders

  • du -sh .[!.]* * to include hidden files

df -h

  • summarises disk usage of each harddrive

SSD usage

  • https://www.cnet.com/how-to/find-how-how-much-longer-your-ssd-will-last/

Watch

  • running user-defined commands at regular intervals

  • Example:

    • watch ls - watches the command at a defualt 2s

    • watch -n 5 ls - watches the command at a 5s

    • watch -d ls - watches the command, highlights diff

    • watch -g ls - watches the command, exit on change

view ports

  • the last column shows the PID, can use to kill it off

  • netstat

  • netsat -pant 8080 - shows info on who is listening on 8080

  • lsof -i :8080 - shows info

  • TBC.............

Permissions

  • permissions

  • chmod

  • chown

ssh

  • logging into a remote machine and for executing commands on a remote machine.

  • provide secure encrypted communications between two untrusted hosts over an insecure network

  • Can use without using a password, but need to setup asymmetric keys

    • https://www.ssh.com/academy/ssh/public-key-authentication

  • Examples

    • ssh usere@sample.ssh.com - login into remote machine under user, this will ask for password

    • ssh user@sample.ssh.com ls - perform a command on remote machine

Network information

  • ifconfig - shows information regarding networks (ethernet, vpn, wifi etc)

  • ifconfig | grep inet - to show all the ip addresses

Curl

Ping

  • Check network connectivity

  • This resolves the hostname to ip (DNS) then sends small packets to it

  • ping www.google.com - can use hostname or ip address

telnet

  • connect to remote systems over a TCP/IP network

  • Layer 7 protocol, similar to http

  • connects to servers and network equipment over port 23

  • not secure, better to use ssh

  • When connecting

    • telnet www.google.com 80

    • This will allow you send commands manually to a server

  • To install: yum install telnet telnet-server -y

  • https://www.digitalocean.com/community/tutorials/telnet-command-linux-unix

scp

  • secure copy over ssh

  • Example:

    • scp -r /dir user@remotehost:~/dir - will copy from your folder to a remote host at the home base path at dir folder

sftp

  • secure transfer of files

  • sftp remotehost

  • This will open interactive terminal and can transfer files

    • mput -r /dir

cron

  • TBC..................

shutdown

  • Use shut down the system and turn off the power. Example: shutdown -h now shuts down the system immediately. shutdown -h +5 shuts down the system after five minutes.

environment variables

  • only for session

  • echo $<name of env variable> - display env var if exists

  • export DATABASE_URL=localhost - sets env var for bash session

xargs

  • TBC................

Chmod and chown

Alarms

  • leave {1258}

    • set alarm for current day

Fun

  • printf "\n\n"; printf "Mastering\nthe\nLinux command line" | figlet -ctk; printf "\n\n"; printf '%0.1s' ' '{1..49} && printf "Han Bobo\n\n" && printf '%0.1s' ' '{1..48} && printf "blah@goole.com\n" && printf '%0.1s' ' '{1..52} && printf "@blah\n\n"

Others

  • cut and paste

  • calendar

    • shows current calendar month - cal

    • Shows months of a year - cal 2023

  • Calculator

    • bc

    • type in expression and press enter

    • set scale=3 will set the decimal points

    • quit to exit

    • instead of starting can feed it in

      • echo 2+3 | bc

  • uptime

    • shows how long your system has been running and the number of users that are currently logged in. It also displays load average for 1,5 and 15 minutes intervals.

  • w

    • displays users currently logged in and their process along with load averages. Also shows the login name, tty name, remote host, login time, idle time, JCPU, PCPU, command and processes.

  • users

    • displays currently logged in users.

  • date

    • Just type date when you want to know what time it is. Example: date "+It's %l:%m%p on %A"

  • who

    • simply returns user name, date, time and host information. The who command is similar to the w command. Unlike w, who doesn’t print what users are doing

  • whoami

    • prints the name of the current user. You can also use “who am i” to display the current user. If you are logged in as a root, using sudo command “whoami” returns root as current user. Use “who am i” if you want to know the exact user logged in

  • sudo

  • source ./bashrc

    • to run bash profile, if updating it

makefiles

vi

  • editor

  • commands:

    • vi - open

    • vi file.txt - open file in vi

    • i - to insert and then can type

    • :wq - write and exit

    • :q - exit

Links

  • http://www.ee.surrey.ac.uk/Teaching/Unix/

  • https://learncodethehardway.org/unix/

  • https://github.com/Idnan/bash-guide

  • https://github.com/enkidevs/curriculum/wiki/Linux-Topic

  • https://www.freecodecamp.org/news/terminal-tips-tweets/

  • https://github.com/bertjan/mastering-the-linux-command-line

    • presentation https://www.youtube.com/watch?v=qmh7Uppd3x0

  • https://www.baeldung.com/linux/

Bash and scripting
profiles
bash commands
Help/Manuals
Tab completion
Pipes
cd
pwd
ls
mv
cp
file
symlinks
create file or directory
deleting file or directory
zipping and unzipping
find
locate
clear
Bash history
diff
cat
less
more
echo
grep
sed
xkill
show processes
Permissions
Curl
cron
shutdown
environment variables
running scripts
Fun
Others
makefiles
vi
Links