paint-brush
RaspberryPi: Technology Overload - LAMP🕯 to UASP🐝by@tudoracheabogdan
445 reads
445 reads

RaspberryPi: Technology Overload - LAMP🕯 to UASP🐝

by Bogdan TudoracheApril 30th, 2024
Read on Terminal Reader
Read this story w/o Javascript

Too Long; Didn't Read

The LAMP stack has been reengineered to make it easier for developers to get started. The stack includes an operating system, a webserver, a database, and a programming language. We will look at how this stack can be applied to the Raspberry Pi and other small computers.
featured image - RaspberryPi: Technology Overload - LAMP🕯 to UASP🐝
Bogdan Tudorache HackerNoon profile picture

Stack:

Older developers and engineers might remember the LAMP stack💡 and although it’s reengineered, if we strip down everything to the basics what we find and need is:


  1. an operating system

  2. a web server

  3. a database

  4. a programming language


What I’m going to talk to you today is how I reimagined the LAMP stack in an alternative format:

  • Linux
  • Apache
  • MySql
  • Php to:
  • Ubuntu
  • Apache
  • Sqlite3
  • Python

What Does It Take?

Nowadays, all that I hear all too often is: “I want to become a developer how do I get started?”, “I want to become a developer what laptop do I need?” or “Do I need to buy the latest MacBook to become a developer?” and to be honest, it’s starting to get to me.


No kids, you don’t need the latest fancy tech or a rocket🚀 to become a developer, what you need is an operating system that is capable of installing programming packages and can compile them; you can even use your grandma’s old laptop. And now you ask: “How can this be?!”


Let’s take a short trip down memory lane; almost 3 and a half years ago, I started tinkering with an SBC - single board computer that starts at under 50E to buy, and on it right now, I have a web server, a database, am performing hundreds of web-scrapes per hour, and on top of it, I’m working on developing an API endpoint.


This SBC is not even the latest in its range and has:

  • 8GB of LPDDR4  internal memory

  • 1.5GHz quad-core ARM Cortex-A72 CPU (launched in 2015) - that you can easily and safely overclock at 2GHz (+fan extension & heatsink)


Here’s what GPT has to say about these specs: The specifications you provided are decent for certain types of computing tasks, but they may not be sufficient for others. Here's an evaluation:


  • 8GB LPDDR4 internal memory:
  • LPDDR4 is a relatively fast and power-efficient type of RAM commonly used in mobile devices and some laptops.
  • 8GB is a moderate amount of memory that should be sufficient for everyday tasks like web browsing, office work, and light multitasking. It can also handle moderate gaming and content creation applications.
  • However, for more demanding tasks like video editing, graphic design, or running virtual machines, 8GB may be limiting, and you might experience performance bottlenecks.
  • 1.5GHz Quad-Core ARM Cortex-A72 CPU:
    • The ARM Cortex-A72 is a capable processor design commonly found in smartphones, tablets, and other mobile devices.

    • A quad-core configuration means it has four cores, allowing it to handle multiple tasks simultaneously more efficiently.

    • The 1.5GHz clock speed is decent for general-purpose computing tasks, including web browsing, media consumption, and productivity applications.

    • However, for more demanding tasks such as gaming, video editing, or running complex software, a higher clock speed and possibly more cores would provide better performance. In summary, these specifications are suitable for light to moderate computing tasks, such as everyday productivity, web browsing, and multimedia consumption. However, for more demanding tasks or future-proofing, you may want to consider upgrading to a system with more RAM and a faster CPU.


Trust me, in the beginning, light to moderate is more than sufficient, so with a Pi board, you can easily have a working desktop environment in which you can learn how to code, and not only frontend but even backend programming languages such as Python, c++ (which is even more energy efficient), or javascript.


What do I use?

On my Raspberry Pi, I am developing code with:

  • Ubuntu Desktop - courtesy of desktopify:

  • VSCode remotely connecting to the server


  • Python3 scripts which scrape the web and build HTML webpages embodied by CSS

    • requests

    • selenium

    • pandas

    • parallel processing - concurrent.futures


  • Javascript coupled with PHP here and there.


  • Python3 scripts that automatically write in my Sqlite3 database in JSON format.


  • Flask app, a small and lightweight Python web framework that provides useful tools and features that make creating web applications in Python.


  • And lastly, a Javascript piece of code that calls the Flask endpoint - a RESTful API endpoint


    For close to 4 years at a definitely amortized cost of 120E and < 4E per month in electricity🔌.


To summarize everything, here’s the BerryNews system architecture:

The key factors here are Efficient Resource Utilization + Resource Utilization Constraints.


Why splurge when you can write efficient code?

Conclusion:

If we were to sum up everything, we’d end up with a table such as this on a 100-dollar computer:

Category

Keywords

Programming languages

Python3, Javascript, PHP, CSS, HTML, SQL

Data formats

JSON

Frameworks

flask, selenium, concurrent.futures

Databases

sqlite3

Networking

router config, DNS

Cybersecurity

UFW (firewall), ClamAV (antivirus), Fail2ban (IPS), password management, SSH Keys, Let’s Encrypt (SSL certificate)

Linux

Raspberry Pi, Ubuntu Desktop, VSCode

So, tell me, do you still think you need the latest laptop specs to become a developer?