Solution for a personal problem

My car dash cam is a peculiar one bought off amazon.com forgot its name. Something like petzio and an old model. Does not have wifi nor does it unmount the microsd card. Hence taking it out and inserting into a linux laptop is the only way to recover the recordings. Even then the last file if not stopped recording before ignition off will be corrupt with no proper header. Also the rear cam records only mirror image with time stamp embedded and at resolution 640×480. I have my own shell script to convert the front and back files and combine them with rear camera view flipped and cropped at 640×320 and scaled down to embed into the front camera combined file.

Recently I had few requirements to keep the rear cam feed as a flipped and cropped separate file with correct timestamp embedded. Had thought about this for long and found a solution using a combination of php, imagemagic and ffmpeg to generate a time stamp embedded sequence. Will show off the screenshots one by one and explain.

The above is a screenshot of the raw file being played and one can see that it seems my car as well as the biker is on the wrong side of the road, because this video is a mirror image and needs flipping. But as the timestamp is embedded, flipping will render the timestamp unusable. So an ffmpeg command is run as below.

ffmpeg -i input.mov -filter:v "crop=640:320:0:0,hflip"  bc.mp4

This one image is the flipped note hflip in the ffmpeg video filter and the crop also to cut away the timestamp.

The above is a screenshot from vscode editor with the php code which I used to generate the timestamps but actually for another video as the start time is a bit skewed and the final echo contains the imagemagick command which is piped to /bin/bash to generate 25 frames for each second and finally ffmpeg is used to create the combined video from the sequence of zero padded files with following command

ffmpeg -y -i tx_%05d.png -hide_banner -c:v libx264 -r 25 -pix_fmt yuv420p timex.mp4

Original cropped and flipped file is now overlayed with this time stamp video again with ff-mpeg. The command which worked for me is as follows.

ffmpeg -i bc.mp4 -i timex.mp4 -filter_complex "[1:v]scale=in_w:-2[over];[0:v][over]overlay=0:270" -c:v libx264 "combined.mp4"

Screen shot from the final output more or less at the same point in the video

OpenShift On-Premises vs. AWS OKS and ROSA: A Comparative Analysis

The choice between OpenShift on-premises, Amazon Elastic Kubernetes Service (EKS), and Red Hat OpenShift Service on AWS (ROSA) is a critical decision for organizations seeking to leverage the power of Kubernetes. This article delves into the key differences and advantages of these platforms.

Understanding the Contenders

  • OpenShift on-Premises: This is a self-managed Kubernetes platform that provides a comprehensive set of tools for building, deploying, and managing containerized applications on-premises infrastructure.
  • Amazon Elastic Kubernetes Service (EKS): A fully managed Kubernetes service that allows users to run and scale Kubernetes applications without managing Kubernetes control plane or worker nodes.
  • Red Hat OpenShift Service on AWS (ROSA): A fully managed OpenShift service on AWS, combining the strengths of OpenShift and AWS for a seamless cloud-native experience.

Core Differences

Advantages of AWS Offerings

While OpenShift on-premises offers granular control, AWS EKS and ROSA provide significant advantages in terms of scalability, cost-efficiency, and time-to-market.


Scalability and Flexibility

  • Elastic scaling: EKS and ROSA effortlessly scale resources up or down based on demand, ensuring optimal performance and cost-efficiency.
  • Global reach: AWS offers a vast global infrastructure, allowing for seamless deployment and management of applications across multiple regions.
  • Hybrid and multi-cloud capabilities: Both EKS and ROSA support hybrid and multi-cloud environments, enabling organizations to leverage the best of both worlds.

Cost-Efficiency

  • Pay-as-you-go pricing: EKS and ROSA eliminate the need for upfront infrastructure investments, allowing organizations to optimize costs based on usage.
  • Cost optimization tools: AWS provides a suite of tools to help manage and reduce cloud spending.
  • Spot instances: EKS supports spot instances, offering significant cost savings for non-critical workloads.

Time-to-Market

  • Faster deployment: EKS and ROSA provide pre-configured environments and automated provisioning, accelerating application deployment.
  • Focus on application development: By offloading infrastructure management, teams can concentrate on building and innovating.
  • Continuous integration and delivery (CI/CD): AWS offers robust CI/CD tools and services that integrate seamlessly with EKS and ROSA.

Security and Compliance

  • Robust security: AWS is known for its strong security posture, offering a comprehensive set of security features and compliance certifications.
  • Regular updates: EKS and ROSA benefit from automatic updates and patches, reducing the risk of vulnerabilities.
  • Compliance frameworks: Both platforms support various compliance frameworks, such as HIPAA, PCI DSS, and SOC 2.

Conclusion

While OpenShift on-premises offers control and customization, AWS EKS and ROSA provide compelling advantages in terms of scalability, cost-efficiency, time-to-market, and security. By leveraging the power of the AWS cloud, organizations can accelerate their digital transformation and focus on delivering innovative applications.

Note: This article provides a general overview and may not cover all aspects of the platforms. It is essential to conduct a thorough evaluation based on specific organizational requirements and constraints.

From Laggy Listings to Lightning Speed: A Database Optimization Case Study

Problem: Filtered listings on the web frontend were taking a long time (22-25 seconds) to load.

Analysis: Identified inefficient database queries as the culprit. Specifically, tables lacked proper indexing, causing the database to scan through a large amount of data unnecessarily when filtering was applied. Joins with filtering conditions were especially slow because the primary key alone wasn’t enough to optimize the search.

Solution:

  • Added required indexes: Created indexes on the columns used for filtering. Indexes act like an organized filing system for the database, allowing it to quickly locate relevant data based on the filter criteria. This significantly reduces the amount of data the database needs to scan.
  • Combined partitioning with the filter field and primary key: Partitioning is a technique that divides large tables into smaller, more manageable chunks. By combining partitioning with the filter field and the primary key, you further optimized the search process. When a filter is applied, the database can quickly identify the relevant partition(s) containing the filtered data, reducing the search scope even further.
  • Few code changes: When analyzed in detail found that in this particular scenario the concerned situation demanded only to fetch those records related to the currently logged in user. The original developers had used a join statement with the user_master and condition was user name. But the userid (int ) was already in the session, so just tweaked to remove the join statement and use the userid from the session to filter on the single table with userid = ‘xx’ condition.

Result: These optimizations led to a significant improvement in performance. The filtered pages now load and render in just 4-5 seconds, which is a massive improvement from the original 22-25 seconds.

Percentage decrease in loading time:

  • The average of the original loading time range: (22 seconds + 25 seconds) / 2 = 23.5 seconds
  • The difference between the original and optimized times: 23.5 seconds – 4.5 seconds = 19 seconds
  • Divide this difference by the original average time and multiply by 100% to arrive at a percentage: (19 seconds / 23.5 seconds) * 100% = 80.85% (approximately 81%) decrease in loading time.

Percentage increase in loading speed:

  • Calculate the improvement by dividing the original average time by the optimized time and multiply by 100%: (23.5 seconds / 4.5 seconds) * 100% = 522.22% (approximately 522%) increase in loading speed. This is absolutely insane and mind-blowing.

The anonymized captures of Firefox developer tools network performance analysis is added.

screenshots of analysis

Built a Feature-Rich QR Code Generator with Generative AI and JavaScript

In today’s digital world, QR codes have become ubiquitous. From restaurant menus to product packaging, these scannable squares offer a convenient way to access information. This article details the creation of a versatile QR code generator that leverages the power of generative AI and JavaScript for a seamless user experience, all within the user’s environment.

Empowering Development with Generative AI

The project began by utilizing generative AI tools to generate boilerplate code. This innovative approach demonstrates the potential of AI to streamline development processes. Prompts are used to create a foundation, allowing developers to focus on implementing advanced functionalities.

Generative AI Coding primer

Open Google Gemini and type the following

Assume the role of a HTML coding expert <enter>

Watch for the response, and if it is positive, go ahead and continue to tell it what you want. Actually for this project the next prompt I gave was:

Show me an HTML boiler plate starter with Bootstrap and JQquery linked from public cdn libraries.

Then for each element, the correct description was suggested, like adding form, text input, further reset button, submit button, and download button initially hidden. The rest of the functionality was very easy with qrcodejs library and further new chat with role setting.

Assume the role of a JavaScript programmer with hefty JQuery experience.

Further prompts were curated to get the whole builder ready still I had to use a bit of my expertise and commonsense, while local testing was done using the node js utility HTTP-server which was installed with Gemini’s suggested command.

prompt:

node http server install

from the response:

npm install http-server -g

Key Functionalities

The QR code generator boasts several user-friendly features, all processed entirely on the client-side (user’s device):

  • Phone Number Validation and WhatsApp Integration:
    • Users can input phone numbers, and the code validates them using regular expressions.
    • Validated numbers are converted into WhatsApp direct chat links, eliminating the need for external servers and simplifying communication initiation.
  • QR Code Generation for Phone Calls:
    • The application generates QR codes that trigger phone calls when scanned by a mobile camera when provided with the proper intent URL. tel://<full mobile number>
    • This is a practical solution for scenarios like displaying contact information on a car, without ever sending your phone number outside your device.

Technical Deep Dive

The project leverages the following technologies, emphasizing the client-side approach:

  • Client-Side Functionality with JavaScript:
    • This eliminates the need for a server, making the application fast, efficient, and easy to deploy. Users experience no delays while generating QR codes, and all processing stays within their browser.
  • AWS S3 Website Delivery:
    • Cost-effective and scalable hosting for the static website ensures smooth operation. S3 simply serves the application files, without any server-side processing of user data.
  • AWS CloudFront for Global Edge Caching and Free SSL:
    • CloudFront enhances performance by caching static content closer to users globally, minimizing latency. Free SSL certification guarantees secure communication between users and your website, even though no user data is transmitted.
    • Please visit review and comment on my QR Code Generator, the known bug in some mobile phones is the download fails, which I will see to as soon as possible, if that is the case with your phone take a screenshot and crop it up for the time being. On Samsung devices I think the power button and volume down pressed together would take a screenshot.

Unveiling the Cloud: A Recap of AWS Community Day Mumbai 2024

On April 6th, the Mumbai cloud community converged at The Lalit for AWS Community Day 2024. This electrifying one-day event, organized by the AWS User Group Mumbai, brought together enthusiasts from all walks of the cloud journey – from budding developers to seasoned architects.

A Day of Learning and Sharing

The atmosphere crackled with a shared passion for cloud technology. The agenda boasted a variety of sessions catering to diverse interests. Whether you were keen on optimizing multi-region architectures or building personalized GenAI applications, there was a talk designed to expand your knowledge base.

Workshops: Deep Dives into Specific Topics

For those seeking a more hands-on experience, workshops offered an invaluable opportunity to delve deeper into specific topics. Attendees with workshop passes could choose from two exciting options:

  • Lower latency of your multi-region architecture with Kubernetes, Couchbase, and Qovery on AWS: This workshop equipped participants with the know-how to optimize their multi-region deployments for minimal latency.
  • Create a personalised GenAI application with Snowflake, Streamlit and AWS Bedrock to cross-sell products: This session focused on building engaging GenAI applications that leverage the power of Snowflake, Streamlit, and AWS Bedrock to personalize the customer experience.

A Community of Builders

Beyond the technical learning, the true spirit of the event resided in the sense of community. The venue buzzed with conversations as attendees exchanged ideas, shared experiences, and built connections. This collaborative atmosphere fostered a valuable space for peer-to-peer learning and professional growth.

A Noteworthy Collaboration

The event was further enriched by the collaboration with Snowflake. Their insightful workshop on building personalized GenAI applications provided a unique perspective on leveraging cloud technologies for enhanced customer experiences.

A Day Well Spent

AWS Community Day Mumbai 2024 proved to be a resounding success. It offered a platform for attendees to gain valuable knowledge, explore the latest cloud innovations, and connect with a vibrant community. If you’re based in Mumbai and have a passion for cloud computing, attending the next AWS Community Day is a surefire way to elevate your skills and stay ahead of the curve.

Unleashing the Power of AWS DynamoDB: Exploring Common Use Cases

Amazon Web Services (AWS) DynamoDB stands tall as a powerful, fully managed NoSQL database service, offering seamless scalability, high availability, and low latency. Its flexibility and performance make it a favorite among developers and businesses across various industries. Let’s delve into some common use cases where DynamoDB shines brightly:

1. Real-Time Analytics: DynamoDB’s ability to handle massive volumes of data with lightning-fast response times makes it ideal for real-time analytics applications. Whether it’s tracking user interactions on a website, monitoring IoT devices, or analyzing streaming data, DynamoDB efficiently stores and retrieves data, enabling businesses to make data-driven decisions in real-time.

2. Ad Tech Platforms: Ad tech platforms deal with immense amounts of data generated from ad impressions, clicks, and user interactions. DynamoDB’s ability to handle high throughput and scale automatically makes it an excellent choice for storing and retrieving this data rapidly. Additionally, its integration with other AWS services like Lambda and Kinesis enables seamless data processing and analysis pipelines.

3. Gaming Leaderboards: Gaming applications often require storing and updating leaderboards in real-time to provide players with up-to-date rankings. DynamoDB’s fast read and write capabilities, along with its scalability, make it a perfect fit for maintaining dynamic leaderboards, ensuring a smooth and engaging gaming experience for players worldwide.

4. Content Management Systems (CMS): Content-heavy applications, such as CMS platforms and blogging websites, benefit from DynamoDB’s ability to handle large volumes of structured and unstructured data. Whether it’s storing user-generated content, managing metadata, or tracking user interactions, DynamoDB provides the scalability and performance required to deliver content quickly and reliably to users.

5. E-commerce Applications: DynamoDB plays a crucial role in e-commerce applications by efficiently managing product catalogs, customer profiles, and transaction data. Its seamless scalability ensures that e-commerce platforms can handle sudden spikes in traffic during peak shopping seasons, while its low latency guarantees a smooth shopping experience for customers browsing and purchasing products online.

6. Internet of Things (IoT) Data Management: IoT devices generate vast amounts of data that need to be collected, processed, and analyzed in real-time. DynamoDB’s ability to handle high throughput and store structured and semi-structured data makes it an ideal choice for managing IoT data streams. Whether it’s monitoring sensor data, tracking device status, or analyzing telemetry data, DynamoDB provides the scalability and performance required for IoT applications.

7. User Session Management: Applications that require managing user sessions, such as chat applications and collaborative platforms, can leverage DynamoDB to store session data securely and efficiently. DynamoDB’s fast read and write operations ensure quick access to session data, enabling seamless user experiences across multiple devices and sessions.

8. Financial Services: In the financial services sector, DynamoDB is used for various applications, including fraud detection, risk management, and transaction processing. Its ability to handle high volumes of data with low latency makes it well-suited for real-time financial analytics and compliance reporting, ensuring the security and reliability of financial transactions.

In conclusion, AWS DynamoDB offers a versatile and scalable solution for a wide range of use cases across industries. Whether it’s real-time analytics, gaming leaderboards, e-commerce applications, or IoT data management, DynamoDB empowers businesses to build high-performance, scalable, and reliable applications that deliver exceptional user experiences. As technology continues to evolve, DynamoDB remains at the forefront, driving innovation and enabling businesses to thrive in the digital age.

Unleash Your Productivity: Samsung Galaxy Tab S7 FE with Bookcase Keyboard

The Samsung Galaxy Tab S7 FE is a powerful and versatile tablet that can be your perfect companion for work, entertainment, and creativity. When paired with the Samsung Bookcase Keyboard, it transforms into a productivity powerhouse, allowing you to tackle tasks on the go with ease.

Samsung Galaxy Tab S7 FE: Built for Performance
  • Large and Vivid Display: Immerse yourself in a stunning 12.4-inch LTPS TFT LCD display with a resolution of 2560 x 1600 pixels. Whether you’re browsing the web, watching videos, or working on documents, the Tab S7 FE delivers a crisp and vibrant viewing experience.
  • Powerful Processor: The Qualcomm Snapdragon 750G processor ensures smooth performance for all your daily tasks, from multitasking to gaming.
  • Long-lasting Battery: Stay productive all day long with a massive 10,400mAh battery.
  • S Pen Support: Unleash your creativity with the included S Pen (on most models). Take notes, draw, and edit photos with unmatched precision and control.
  • Expandable Storage: With a microSD card slot, you can expand the storage capacity of your Tab S7 FE to keep all your files and media close at hand.
Samsung Bookcase Keyboard: Transform Your Tablet
  • Seamless Integration: The Bookcase Keyboard attaches magnetically to your Tab S7 FE for a secure and convenient connection.
  • Laptop-like Typing Experience: The keyboard features well-spaced keys with good travel, making typing comfortable and efficient.
  • Multiple Viewing Angles: Prop your tablet up at a comfortable viewing angle for work, watching videos, or gaming.
  • Integrated S Pen Holder: Keep your S Pen always within reach, conveniently stored in the dedicated holder on the keyboard.
  • Built-in Trackpad (Optional): Some versions of the Bookcase Keyboard come with a built-in trackpad, offering greater control over your tablet

Together, a Perfect Match

The Samsung Galaxy Tab S7 FE and Bookcase Keyboard are a perfect combination for users who demand both portability and productivity. The tablet’s powerful performance and stunning display are ideal for work and entertainment, while the keyboard enhances your typing experience and transforms your Tab S7 FE into a laptop alternative.

Additional Considerations

  • Price: Be sure to research current pricing for both the Tab S7 FE and Bookcase Keyboard before making your purchase.
  • Alternatives: Consider third-party keyboard options that might offer different features or price points.
  • Software: The Tab S7 FE works with Samsung DeX, which provides a more desktop-like experience when connected to a monitor.
  • FfMpeg:- Video editing which does everything without the frills and folleys on the go. Yes it is a bit clumsy but with some help from google and other channels and keeping a command reference in Samsung Notes fast and precise editing and voiceover can be done on videos taken on other mobiles.
  • With Samsung quick share transfer files in and out wirelessly between Samsung devices and even text copy on one device and paste in the other device when connected to the same wifi and both are using the same gmail login.
  • Canva in subscription mode will facilitate more powerful video and image editing with templates for almost all social media and other printable materials too.
  • Amazon Code Catalyst is an IDE with DevOps integrated as well as a linux console and all sort of features like collaborative editing in code view and can integrate code whisperer.

The last combination above will facilitate developers to break free from concrete jungles and enjoy fresh air while still doing their tasks on time. As I have been doing here.

With its impressive features and sleek design, the Samsung Galaxy Tab S7 FE with Bookcase Keyboard is a great option for anyone who wants a versatile and powerful tablet that can keep up with their busy lifestyle.

Agree or Disagree? Let me know what you think in the comments below! Or send a tweet tag me too @ jijutm

If you are gonna purchase it use my affiliate link

Attempt to create animated representation of AWS DevOps pipeline

Though the title says something technical this is just a self-promotion and cheap boasting

Continuing with the boosting as I have been doing this for the past couple of days. No, I am not insane, but wanted to do this by hand and use some shell commands. Initially the scenes were identified as 10 and folders created with a base flowchart made using Libre Office Draw copied into each of the folders.

Finally the full image sequence was copied into “full” with renaming in sequence with the following command.

Before that, the same command was previewed using echo instead of cp as seen below.

And finally all images were in the “full” folder as below.

It was time to invoke ffmpeg as shown below.

ffmpeg -i dop%04d.png -c:v libx264 -an -r 30 ../dop-anim.mp4 -hide_banner

What could have been achieved with paid tools like Canva or many others, with some effort and free tools available with Ubuntu Linux achieved with minimal expense, without considering my work time earnings that should be a concern.

When I went to SJCCD 2024

This is not a technical document but rather a place to show off some pictures which I took. A few of them were posted on Twitter ( now the platform is X) while the event was running. Pictures that I am there have been salvaged from other sources and I wholeheartedly thank those who took those. I don’t want to hurt the feelings of anyone or to poach these. If I knew the person directly I would have asked the permission. Still, if any copyright owners want to take these off, please DM me on LinkedIn as those photos were taken from a LinkedIn post.

The event at St. Joseph’s Group of Institutions, Chennai was stupendous and a grand function. Take this opportunity to thank the staff and management as well as congratulate all those who took the extra effort to make it such a great one.

About 15 new security controls added to AWS Security Hub

AWS Security Hub announced the addition of 15 new security controls through their post yesterday. This should increase the number of controls available to 307. AWS services such as Amazon FSx and AWS Private Certificate Authority (AWS Private CA) are some of the newly added controls that were in demand also. More and enhanced controls of previously supported services like Amazon Elastic Compute Cloud (Amazon EC2), Amazon Elastic Kubernetes Service (Amazon EKS), and Amazon Simple Storage Service (Amazon S3) are also added with this release. For the full list of recently released controls and the AWS Regions in which they are available, suggested to review the Security Hub user guide from time to time.

To use the new controls, turn on the standard they belong to. Security Hub will then start evaluating your security posture and monitoring your resources for the relevant security controls. You can use central configuration to do so across all your organization accounts and linked Regions with a single action. If you are already using the relevant standards and have Security Hub configured to automatically enable new controls, these new controls will run without taking any additional action.

The original announcement on their site is here.