This site contains Angeles Broullon’s coding notes.

They mostly help me keep track of my current work, and help me clear my memory after intense projects. Most of what is stored here is related to Java, vanilla NodeJS and Python, but there is always room to learn more. Also check up the date of the note, as it may not be bleeding edge anymore: these are mostly a development diary.

This site is made with Hexo, and using the Hexo Next Theme. The Mermaidjs graphics are inserted using hexo-filter-mermaid-diagrams.

You are welcome to wander around and I hope you find something useful.

What are OhMyZsh and OhMyBash

Oh my Zsh and Oh My Bash are frameworks which add new functionalities modifiying the environment to improve the user experience.

Installing

They can be installed from the command line:

install-ohmybash.sh
1
bash -c "$(wget https://raw.githubusercontent.com/ohmybash/oh-my-bash/master/tools/install.sh -O -)"
install-oh-myzsh.sh
1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

❗ Be careful: it replaces the configuration file with a new one, creating a backup adding the date to its name. If profile does not exist, it creates a new one with the default configuration.

  • bash: configuration is on ~/.bashrc, profile is on : ~/.bash_profile.

  • zsh: configuration is on ~/.zshrc, rofile is on : ~/.zsh_profile

  • Automatic update can be update on the configuration file, changing its value to true or false:

    1
    DISABLE_UPDATE_PROMPT=true
  • Manual update:

    1
    upgrade_oh_my_bash

Uninstalling

Remove and restore the previous .bashrc configuration.

1
uninstall_oh_my_bash

Themes

You can check the on the OhMyZhs wiki or OhMyBash wiki. You can change it on the .bashrc file, or even choose “random”.

1
OSH_THEME="powerline-icon"

Plugins

Small programs that add new functions. Edit the .bashrc file on the plugins section:

1
2
3
4
plugins=(
git
bashmarks
)

Autocomplete

Shows command options, example: write gitand press tab willñ show different available options for that command, writing the first common letters available for the option you started typing.

Aliases

An alias is a custom command which executes a longer terminal command that can be set on the configuration file.

1
alias weather="curl wttr.in"

The framworks also provide some useful aliases packages:

1
2
3
aliases=(
general
)

Example: general brings typing C and pressing enter to clean the terminal.

Chafa is a command-line utility that enables users to print and display images directly within the terminal. It can also convert images into ASCII or colored character art, allowing them to be viewed in a text-based environment.

It can convert various image formats, such as JPEG, PNG, GIF, and BMP, into ASCII or colored character representations. It utilizes special characters and symbols to create an artistic representation of the image within the terminal.

Install

  • python

    1
    pip install chafa.py
  • nodejs

    1
    npm install chafa-wasm

Filters

ASCII Art

The tool can convert images into ASCII art, which is a technique where characters from the ASCII character set are used to represent different shades and patterns in an image. This allows users to view images using text characters, which can be useful in situations where graphical interfaces are not available or when working with text-based environments.

  • ASCII black and white.
    basic-ascii.sh
    1
    chafa -c none --symbols none --fill ascii /path/to/file

Colored Output

It supports various color modes:

  • ANSI 8-bit.

    8-bits.sh
    1
    chafa -c 8 /path/to/file
  • ANSI 24-bit true color.

    24-bits.sh
    1
    chafa -c full /path/to/file
  • grayscale.

    24-bits.sh
    1
    chafa -c nnone /path/to/file

Customization Options

Users can:

  • specify the width and height of the output.

    length-width.sh
    1
    chafa -w 9 full /path/to/file
  • adjust the character set used for rendering.

    monochome-braille.sh
    1
    chafa -c none --symbols braille /path/to/file
  • set the background and foreground colors.

    pixelated.sh
    1
    chafa -w 9 -c none --symbols braille --fg gray60 /path/to/file
  • apply various dithering and scaling algorithms to enhance the image quality

    pixelated.sh
    1
    chafa --symbols vhalf /path/to/file
  • apply blapinus Art! fonts.

    art-fonts.sh
    1
    2
    3
    sudo cp blapinus.pcf.gz /usr/share/fonts/misc/
    xterm -font -blap-*
    chafa -f symbols --glyph-file blapinus.pcf.gz --symbols imported /path/to/file

Terminal Compatibility

It is designed to work with a wide range of terminal emulators.

  • Basic rendering command.
    1
    chafa /path/to/file

Performance Optimization

It is optimized for performance to ensure efficient image rendering, even for large and complex images. It leverages multi-threading and parallel processing techniques to speed up the conversion process and provide real-time or near-real-time image display within the terminal.

  • Improve image rendering with small color palettes using dithering:

    dithering.sh:
    1
    chafa -c 16 --dither ordered /path/to/file
  • Teletext filter

    teletext.sh
    1
    chafa -c 8 --symbols legacy+space /path/to/file

Integration and Automation

  • It can be easily integrated into scripts and automated workflows.
  • It provides command-line options and supports standard input/output, allowing users to pipe image data and automate image conversion tasks.

Introduction

The 3 major cloud platform platform providers on 2025 are Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). They basically offer the same services, but they have different names. The following tables have the goal of putting some order on those naming patterns.

Cloud Computing

Service AWS Azure GCP
Computing Elastic Compute Cloud (EC2) Virtual Machines Compute Engine
AutoScaling AWS EC2 Autoscaling Azure Autoscale Compute Engine Autoscaler
VMS VMware Cloud on AWS Azure VMware Solution VMware Engine
Dedicated hosts Amazon EC2 dedicated host Azure Dedicated Host Sole-tenant nodes
App deployment Elastic Beanstalk Azure App Service App Engine

Storage Services

Service AWS Azure GCP
Block storage Amazon Elastic Block Storage (EBS) Disk Storage Persistent Disk
Cloud Storage Amazon S3 Azure Blob Storage Cloud Storage
File storage Amazon Elastic File System (EFS) Azure Files File Store
Infrequently accessed Amazon Glacier Blob Storage: Archive Storage Cloud Storage Archive

Containers and serverless

Service AWS Azure GCP
Serverless container App Runner and AWS Fargate Container Apps Cloud Run
Function as a service AWS Lambda Function App Cloud Functions
Event handling Eventbridge Event Grid Event Arc
Kubernetes service Elastic Kubernetes Service (EKS) Azure Kubernetes Service (AKS) Google Kubernetes Engine (GKE)
Container orchestration Elastic Container Service (ECS) Azure Container Apps (ACS) Google Kubernetes Engine (GKE)

Databases

Service AWS Azure GCP
In-memory storage Amazon Elasticache Azure Cache Memorystore
RDBMS Amazon RDS Azure SQL Database Cloud SQL
NoSQL DynamoDB CosmoDB Cloud Datastore and Cloud Bigtable
Data warehouse Redshift Azure Synapse Analytics Big Query

NIST SP 800-86 concepts

  • National Institute of Standards and Technology, Special Publications 800 Series.
    • Evidence collection order

      1. Volatile data collection (can be lost when pulling the cable of the computer).
      2. Data integrity (on ackups and imaging).
      3. Data preservarion.
          graph LR;
      A[Media];
      B[Data];
      C[Information];
      D[Evidence];
      E[Report];
      
      A -- collection --> B;
      B -- examination --> C;
      C -- analysis --> D;
      D -- reporting --> E;
      D --> A;

Security management concepts

  • Security policies: document that spells out the rules, expectations, and approachto maintain the confidentiality, integrity, and availability of data.
    • Asset management:
      • Every sigle asset should be accounted for.
      • Asset in compliance.
      • Response when out of compliance.
    • Configuration management:
      • Discovery.
      • Configuration baseline (detect configuration drifts).
      • Assess, alert, report.
      • Remediate.
      • Rely on automation.
    • Mobile device management:
      • Software tool for smartphones, laptops, tablets, IoT devices.
      • Manage, productivity and compliance.
    • Patch management:
      • Starts with aasset management.
      • Identify, adquire, install and verify patches.
      • Correct security flaws and mitigate vulnerabilities.
      • Must not neglect.
      • Balance, usability and availability.
    • Vulnerability management.
      1. Discover (identify).
      2. Prioritize (handle list).
      3. Assess (only mitigation, or remdiation).
      4. Remediate.
      5. Verify.
      6. Report.

SOC metrics and scope analysis

  • People in the SOC (escalation model):
    • Tier 1: alert analyst (front line response):
      • Monitoring incidents.
      • Open tickets.
      • Basic threat mitigation.
    • Tier 2: incident responder (review for indicator, try some remediation):
      • Deep investigation.
      • Advice.
      • Recommend action.
    • Tier 3: subject matter expert (SME) or Hunter:
      • Knowledge.
      • Hunt trheats.
      • Prevention (pass this info back to Tier 1 and Tier 2).
  • Goal SOC metrics:
    • Criteria:
      • Speed.
      • Focus.
      • Accuracy.
    • Goals:
      • Understand identify risks.
      • Meassure effectiveness.
      • Optimize resources.
      • Investment allocation.
    • Metrics:
      • Time to detect (MTTD).
      • Time to response (MTTR).
      • Time to control.
      • Time to contain.

Protected data in a network

  • Personal, privacy and protected:
    • PII (Person Identifiable Information): it can lead back to real person.
    • PSI (Privacy Sensitive Information): “you choose what information you want to reveal”.
    • PHI (Protected Health information): can lead to discrimination.
  • Intellectual property (“creation of the mind”):
    • Inventions.
    • Literary and artistic works.
    • Symbols, names, images.
    • Designs used in commerce.

Network and server profiling elements

Set baseline, and heck things out of the norm.

  • Network profiling:
    • Total throughput (e.g. saturation = DDoS).
    • Session duration (e.g. connection during off-hours).
    • Ports used (e.g. ports allowed).
    • Critical assets address space (e.g. having server ranges, if you notice a client on one of those ranges, it is abnormal).
  • Server profiling:
    • Listening ports.
    • Logged in users, service accounts.
    • Running processes.
    • Running tasks.
  • Profiling tools:
    • Baselines.
    • Policies (e.g. asset, configuration, vulnerability).
    • Wireshark, nmap, netstat.
    • Logs.

Integrate forensic elements into incident analysis

  • NIST SP-800-61 Revision 2.
    • Incidents:

      • Data breach.
      • Provacy breach.
      • Physical breach.
      • Missing assets.
    • Steps of incident handing (by coordination and incident-reponse teams flow):

          graph LR;
      A[fa:fa-shield Preparation];
      B[fa:fa-magnifying-glass Detection, analysis];
      C[fa:fa-truck-medical Containment, eradication, recovery];
      D[fa:fa-road Post-indicent activity];
      
      A --> B;
      B --> C;
      C --> B;
      C --> D;
      D --> A;
      1. Preparation:
        • “Readiness”.
        • Communication and facilities.
        • Hadrware and software.
        • Documentation.
        • Images.
      2. Detection and analysis:
        • Determine incident ocurred.
        • Prioritize handling.
        • Report incident to stakeholders.
      3. Containment, eradication, recovery:
        • Limits damage.
        • Acquire and preserve evidence.
        • Eradicate.
        • Recovery.
      4. Post-incident analysis:
        • Lessons learned.
        • Learn to improve.
        • Report.
    • Sharing information with other parties

          graph LR;
      A[Incident response team];
      B[Other ncident response team];
      C[Internet reporters];
      D[Internet service providers];
      E[Customers, Constituents and media];
      F[InteSoftware and support vendores];
      G[Law enforcement agencies]
      
      A --> B;
      A --> C;
      A --> D;
      A --> E;
      A --> F;
      A --> G;

Elements of an IRP

  • Incident reponse plan (IRP) according to NIST SP-800-61 Revision 2 (with National Footbal League analogy):
    • Leadership (head coach):
      • Mission.
      • Strategies and goals.
      • Senior management approval.
    • Organizational approach (ofensive and defensive coordinators):
      • Organizational approach to incident response.
    • Resource mobilitazion (special teams coach):
      • How the incident response team will communicate with the rest of the organization and with other organizations.
      • Metrics for measuring the incident response capability and its effectiveness.
    • Incident reponse plan (playbook):
      • Roadmap for maturing the incident response capability.
      • How the program fits into the overall organization.
0%