<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by APorkolab’s DevHackery on Medium]]></title>
        <description><![CDATA[Stories by APorkolab’s DevHackery on Medium]]></description>
        <link>https://medium.com/@aporkolabsdevhackery?source=rss-2a56ccbaddd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*DrF4NpI-0gbje4_seCJFCg.png</url>
            <title>Stories by APorkolab’s DevHackery on Medium</title>
            <link>https://medium.com/@aporkolabsdevhackery?source=rss-2a56ccbaddd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 14:35:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aporkolabsdevhackery/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Rethinking Developer Interviews in the Age of AI]]></title>
            <link>https://aporkolabsdevhackery.medium.com/rethinking-developer-interviews-in-the-age-of-ai-2dbc6f999c24?source=rss-2a56ccbaddd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2dbc6f999c24</guid>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[real-world-assessments]]></category>
            <category><![CDATA[decline-of-leetcode-tests]]></category>
            <category><![CDATA[ai-in-hiring]]></category>
            <dc:creator><![CDATA[APorkolab’s DevHackery]]></dc:creator>
            <pubDate>Mon, 10 Feb 2025 13:29:35 GMT</pubDate>
            <atom:updated>2025-02-10T13:29:35.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*irXp5J3GZjDACzEFKWWNiQ.jpeg" /><figcaption>Fotó: ThisIsEngineering: <a href="https://www.pexels.com/hu-hu/foto/asztal-hordozhato-szamitogep-laptop-notebook-19895773/">https://www.pexels.com/hu-hu/foto/asztal-hordozhato-szamitogep-laptop-notebook-19895773/</a></figcaption></figure><p>It’s about to get a radical change in how one recruits a developer. With AI-powered coding assistants like ChatGPT and GitHub Copilot increasingly popular, algorithmic tests in the style of LeetCode are becoming increasingly obsolete. These assessments once provided a standardized filter for technical competency; today, AI tools can game them with ease. This begs the question: if AI can write, optimize, and refactor code, then how should companies actually assess software engineers?</p><p><strong>The Trouble with Traditional Coding Assessments</strong></p><p>For years, the traditional and most common approach to many hiring processes has revolved around solving abstract algorithmic challenges. <em>But actually, most developers never will or should write binary search trees or implement quicksort from scratch in day-to-day work.</em> Real software engineering is all about understanding existing systems, extending their functionality, and debugging and collaborating effectively.</p><p>The thing is, with AI capable of churning out solutions to the classics in seconds, LeetCode assessments have lost a lot of their filtering power. Banning the use of AI tools during tests is not a long-term solution, just as banning IDEs would be unworkable. Instead of resisting technological progress, hiring managers need to change the way they test candidates so that it better reflects what matters in real-world development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JR2B1rDcxuTNRoxz9xnirg.png" /><figcaption>Source: DALL-E</figcaption></figure><p>Moreover, excessive orientation to problem-solving logic or heavy combinatorial tasks can hardly be representative of the real everyday problems which a developer has to cope with. Most engineering tasks are highly structured and algorithmic in their nature, and the ability to implement well-defined solutions efficiently is often more critical than pure algorithmic ingenuity.</p><p><strong>Alternative Interview Approaches</strong></p><p>To get beyond these outdated coding tests, companies should be looking at assessment methods that better reflect the reality of software development. Here are a few promising alternatives:</p><ol><li><strong><em>Take-Home Projects with Interactive Feedback</em></strong></li></ol><p>Instead of timed algorithmic tests, candidates can be given a realistic take-home assignment that simulates an actual work task. Once they submit their solution, they discuss trade-offs, improvements, and alternative approaches with the hiring team. This creates a much more meaningful evaluation of their problem-solving and collaboration skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1hVxQwDPYgSo2066OTSI7Q.jpeg" /><figcaption>Fotó: Djordje Petrovic: <a href="https://www.pexels.com/hu-hu/foto/2102413/">https://www.pexels.com/hu-hu/foto/2102413/</a></figcaption></figure><p><strong><em>2. Feature Planning and Architecture Design</em></strong></p><p>Rather than hiring a person based on sheer coding speed, a company must present the problem statement to that candidate and should let him or her explain approaches taken to arrive at building a feature. An interviewer is better able to question his reasoning through scalable, maintainable design in this manner. Proper discussion related to system architecture provides great insights into a candidate’s thought and decision-making capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vS2jnnKEG_mFlp2N1D2QVQ.jpeg" /><figcaption>Fotó: Mikhail Nilov: <a href="https://www.pexels.com/hu-hu/foto/emberek-hivatal-iroda-dolgozo-7988742/">https://www.pexels.com/hu-hu/foto/emberek-hivatal-iroda-dolgozo-7988742/</a></figcaption></figure><p><strong><em>3. Real-world Problem-Solving Discussion</em></strong></p><p>Instead of putting them on the spot with live coding, discussing some real-life technical scenario-in a very natural way-is much better: for instance, “How would you integrate a new API into the legacy system?” or “How would you troubleshoot a performance issue in a large-scale application?” Open-ended conversations in such a way mirror real-world challenges, not some sort of artificial pressure of performance during the live-coding session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zju1tgngT05XyDkHUkeqxA.jpeg" /><figcaption>Fotó: Mizuno K: <a href="https://www.pexels.com/hu-hu/foto/ferfi-no-hordozhato-szamitogep-laptop-12899151/">https://www.pexels.com/hu-hu/foto/ferfi-no-hordozhato-szamitogep-laptop-12899151/</a></figcaption></figure><p><strong><em>4. Evaluating Collaboration Over Examination</em></strong></p><p>Hiring is not interrogation. A lot of interview processes are still based on questioning the candidates in such a way that it feels like an examination rather than assessing how they collaborate and work in a team. Companies should design interviews to be more like conversations among colleagues, where ideas are exchanged rather than rigidly judged, rather than strict Q&amp;A sessions.</p><p>A developer’s ability to explain their choices, work iteratively, and respond to constructive feedback is far more important than their ability to recite memorized algorithms. In a real job, developers work together to refine ideas and improve codebases — they don’t just regurgitate textbook solutions in isolation.</p><p><strong>Why These Methods Work Better?</strong></p><p>These alternative approaches share some key advantages:</p><p><em>They focus on real-world skills</em>: The candidates actually show how they would solve practical development tasks, not some theoretical exercises. They stimulate collaboration: Discussions of design decisions, trade-offs, and architecture lead to valuable conversations instead of test-taking stress.</p><p><em>They are AI-resilient</em>: While AI can assist in coding, it can’t replace human judgment, creativity, or the ability to navigate complex business requirements.</p><p><em>They create a fairer hiring process</em>: Developers are judged based on their real ability to contribute to a team, not based on how well they can cram algorithms.</p><p><em>They reduce artificial stress:</em> Instead of an adversarial “prove your worth” approach, they put candidates in a natural environment to demonstrate their strengths.</p><p><strong>The Future of Developer Hiring</strong></p><p>The shift away from algorithmic whiteboard interviews is inevitable. Companies that continue to rely on outdated assessments risk filtering out excellent engineers while rewarding those who excel at artificial test environments. By adopting interview formats that reflect real-world development challenges, organizations can make smarter hiring decisions and attract top talent.</p><p>After all, hiring is not supposed to be a battle of who can outsmart AI; it should choose engineers who really think and solve problems and write something useful. The future of hiring in developer interviews consists of assessments that will accurately measure what truly matters: real skills, real collaboration, and real impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RdOOMfEngoKJZpiiPkcvtQ.jpeg" /><figcaption>Fotó: Google DeepMind: <a href="https://www.pexels.com/hu-hu/foto/absztrakt-technologia-kutatas-digitalis-18069697/">https://www.pexels.com/hu-hu/foto/absztrakt-technologia-kutatas-digitalis-18069697/</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2dbc6f999c24" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Step-by-Step Guide to Deploying Fullstack Angular + Node.js/Spring]]></title>
            <link>https://aporkolabsdevhackery.medium.com/a-step-by-step-guide-to-deploying-fullstack-angular-node-js-spring-c5521dbd8767?source=rss-2a56ccbaddd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5521dbd8767</guid>
            <category><![CDATA[dokku-setup-on-ubuntu]]></category>
            <category><![CDATA[ssl-with-lets-encrypt]]></category>
            <category><![CDATA[docker-virtualization]]></category>
            <category><![CDATA[fullstack-deployment]]></category>
            <category><![CDATA[mysql-integration-config]]></category>
            <dc:creator><![CDATA[APorkolab’s DevHackery]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 06:14:36 GMT</pubDate>
            <atom:updated>2024-09-03T06:20:14.851Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Step-by-Step Guide to Deploying Fullstack Angular + Node.js/Spring Boot Applications on a VPS Using Dokku (Ubuntu 24.04 LTS)</h3><p>This guide provides a detailed walkthrough for deploying a fullstack application with an Angular frontend and a Node.js or Spring Boot backend on a VPS running Ubuntu 24.04 LTS, using Dokku.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNceK6nfZ1ogVVvuki5gbw.png" /><figcaption>A flowchart or network diagram showing the overall architecture and deployment process of a fullstack application (Angular frontend, Node.js/Spring Boot backend) on a VPS using Dokku.</figcaption></figure><h4>0. Dockerization: Choosing the Right Virtualization Platform — LXC vs. KVM</h4><p>When considering Dockerization, it’s crucial to choose the right virtualization technology for your Virtual Private Server (VPS). Two popular options are KVM (Kernel-based Virtual Machine) and LXC (Linux Containers). Each has its strengths and weaknesses, which can significantly impact your Docker environment. However, for beginners, it’s often recommended to start with a Managed Virtual Server (MVS), as it requires less configuration and is simpler to Dockerize.</p><h4>KVM (Kernel-based Virtual Machine)</h4><p>KVM is a full virtualization solution integrated into the Linux kernel. It allows multiple independent operating systems to run on a single physical machine, with each virtual machine (VM) having direct access to hardware resources like CPU and RAM. This setup provides near-native performance, making KVM an excellent choice when performance is a priority.</p><p><strong>Advantages of KVM:</strong></p><ul><li><strong>Full Isolation:</strong> KVM provides complete isolation between VMs, enhancing security and stability. This is particularly beneficial when running different operating systems, such as Windows, macOS, and various Linux distributions.</li><li><strong>Versatile OS Support:</strong> KVM supports a wide range of operating systems, making it ideal for environments where different OS versions need to be tested or deployed.</li><li><strong>High Performance:</strong> The direct access to hardware resources ensures that VMs run at near-native speeds, which is critical for resource-intensive applications.</li></ul><p><strong>Using Docker with KVM:</strong></p><p>KVM’s strong isolation and versatility make it a solid foundation for running Docker. Docker can be installed within a KVM-based VM, providing a robust environment where Docker containers can operate with high security and performance.</p><h4>LXC (Linux Containers)</h4><p>LXC is a lightweight virtualization solution that leverages the Linux kernel’s cgroups and namespace features. Unlike KVM, LXC uses containers that share the host system’s kernel, resulting in faster startup times and lower resource consumption.</p><p><strong>Advantages of LXC:</strong></p><ul><li><strong>Faster Startup:</strong> Containers in LXC start almost instantly, making it ideal for scenarios where quick deployment and scaling are crucial.</li><li><strong>Lower Resource Usage:</strong> Since LXC containers share the host’s kernel, they require significantly fewer resources compared to full VMs, leading to higher efficiency in resource utilization.</li><li><strong>Simplified Administration:</strong> LXC’s lightweight nature simplifies management, making it easier to handle large-scale deployments.</li></ul><p><strong>Limitations of LXC:</strong></p><ul><li><strong>Reduced Isolation:</strong> LXC containers are less isolated than KVM VMs, which can pose security risks, especially in multi-tenant environments.</li><li><strong>Kernel Dependency:</strong> LXC containers rely on the host’s kernel, limiting the flexibility to run different operating systems.</li></ul><p><strong>Docker vs. LXC:</strong></p><p>While both LXC and Docker involve containerization, they serve different purposes. Docker is designed specifically for creating, deploying, and managing applications in isolated containers, with a focus on ease of use and scalability. LXC, on the other hand, is more geared towards creating virtualized environments with a focus on system-level management.</p><p>It’s important to note that Docker cannot be run directly within LXC containers due to conflicts in their containerization approaches. However, Docker can be run within KVM-based VMs, providing a more secure and isolated environment for Docker containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*H62-IU_QDh-wR5HSJwfF_w.png" /><figcaption>A side-by-side comparison chart or infographic showing the differences between LXC and KVM, highlighting the key points such as performance, isolation, resource usage, and OS support.</figcaption></figure><h4>Which to Choose for Dockerization?</h4><ul><li><strong>Use KVM</strong> if you need strong isolation, high performance, and the ability to run multiple operating systems. KVM is ideal for running Docker in scenarios where security and resource allocation are critical.</li><li><strong>Use LXC</strong> if you prioritize fast deployment, lower resource consumption, and simpler management. LXC is better suited for environments where containers need to be quickly spun up and down with minimal overhead, but be cautious of the reduced isolation.</li></ul><h4>Recommendation for Beginners: MVS Server</h4><p>For those new to Dockerization, starting with a <strong>Managed Virtual Server (MVS)</strong> is often the best choice. An MVS server comes pre-configured with many of the necessary settings, reducing the amount of manual configuration required. This makes it easier to set up Docker and get your containers running without dealing with the complexities of configuring a VPS from scratch. Additionally, managed services often provide better support and easier scalability, allowing beginners to focus more on developing and deploying their applications rather than managing the underlying infrastructure.</p><p>In summary, the choice between KVM, LXC, and an MVS server depends on your specific needs and experience level. For beginners, an MVS server offers simplicity and ease of use, making Dockerization more accessible. For more advanced users, KVM provides strong isolation and performance, while LXC offers a lightweight alternative for less demanding use cases where speed and efficiency are the primary concerns.</p><figure><img alt="A screenshot or photo of a terminal running Ubuntu, with the command line showing the installation of Dokku." src="https://cdn-images-1.medium.com/max/1024/1*QTlBJ0fExFEGXn65FIDZRQ.jpeg" /></figure><h4>1. Before Installing Dokku</h4><p><strong>How to Resolve Issues During Dokku Installation — Before Installing Dokku</strong></p><p>When attempting to install Dokku, you might encounter an error indicating that certain dependencies are unavailable or cannot be installed. This issue can prevent Dokku from being successfully set up. The following steps can help you troubleshoot and resolve this problem:</p><p><strong>Check and Update Repositories</strong></p><p>First, ensure that all necessary repositories are added and update your package list:</p><pre>sudo apt-get update</pre><h4>3. Install Docker (if it is not installed already)</h4><p>Dokku relies on Docker, so it’s crucial to have Docker installed. If Docker is not already installed on your system, you can manually install it:</p><pre>sudo apt-get install docker.io</pre><p>After Docker is installed, you may also need to install the required Docker plugins:</p><pre>sudo apt-get install docker-compose-plugin docker-buildx-plugin</pre><p>For more detailed instructions on installing Dokku, refer to the Dokku Installation Guide. Additionally, for deploying applications, you can consult the Application Deployment Documentation.</p><h4>2. Installing Dokku on Ubuntu 24.04 LTS</h4><p>To begin, you can install Dokku on your Ubuntu 24.04 LTS server. Dokku is an open-source platform-as-a-service (PaaS) that allows you to manage your applications on a VPS, offering a self-hosted alternative to services like Heroku.</p><p>After installing Dokku, you’ll be guided through setting up your SSH key and configuring the basic settings. Follow the on-screen instructions to ensure everything is properly configured.</p><p><strong>Here’s how to install Dokku:</strong></p><p><strong>Download and Install Dokku</strong></p><p>First, download the installation script and run it:</p><pre>wget -NP . https://dokku.com/install/v0.34.9/bootstrap.sh <br>sudo DOKKU_TAG=v0.34.9 bash bootstrap.sh</pre><p>During the installation, Dokku will automatically install Nginx and Docker, which are essential components for running your applications.</p><figure><img alt="An image representing domain configuration, perhaps with a browser showing a custom domain." src="https://cdn-images-1.medium.com/max/640/1*M79wUjtxiHrNV8jp2I1RVA.jpeg" /></figure><h4>3. Set Up Virtualhost Routing (Optional)</h4><p>If you want to use virtualhost routing (e.g., my-app =&gt; my-app.dokku.me), set a global domain for your server:</p><pre>dokku domains:set-global &lt;main domain of the server&gt;</pre><h4>4. Add SSH Key for Deployment</h4><p>To enable deployments, you need to add an SSH key for the user. Pass the public SSH key as shown below:</p><pre>echo &#39;CONTENTS_OF_ID_RSA_PUB_FILE&#39; | dokku ssh-keys:add admin</pre><p>By following these steps, you’ll have a fully functional Dokku instance ready for deploying your applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-U16cBAz82vsi-Y7Cenwg.jpeg" /></figure><h4>3. Generate a GitHub Personal Access Token and Clone Your Repository</h4><p>To clone your private GitHub repository, you’ll need a personal access token. This token replaces your password in GitHub’s HTTPS authentication.</p><p><strong>Generate a Personal Access Token:</strong></p><ol><li>Go to your GitHub account.</li><li>Navigate to <strong>Settings &gt; Developer settings &gt; Personal access tokens &gt; Tokens (classic) &gt; Generate new token</strong>.</li><li>Select the necessary scopes, such as repo, and generate the token.</li></ol><p><strong>Clone Your Repository:</strong></p><p>Use the generated token to clone your repository. Replace &lt;your_personal_token&gt; and YourRepository with your actual token and repository name:</p><pre>git clone https://&lt;your_personal_token&gt;@github.com/YourUsername/YourRepository.git <br>cd YourRepository</pre><h4>3. Installing Essential Dokku Plugins</h4><p>To enhance Dokku’s core functionality, you can install various plugins that extend its capabilities. Here are some essential plugins you should consider installing:</p><p><strong>Database Plugins</strong></p><p>These plugins allow Dokku to manage databases. They are crucial for enabling database support within your applications. You can find the official plugins here: <a href="https://dokku.com/docs/community/plugins/#official-plugins-beta">Dokku Official Plugins</a>.</p><p><strong>Let’s Encrypt Plugin</strong></p><p>The Let’s Encrypt plugin automates the process of setting up SSL certificates, making it easy to secure your applications with HTTPS.</p><p><strong>Install the Let’s Encrypt plugin by executing the following command:</strong></p><pre>sudo dokku plugin:install https://&lt;your_personal_token&gt;@github.com/dokku/dokku-letsencrypt</pre><p>These plugins will significantly enhance your Dokku environment, providing vital functionality for managing databases and securing your applications with SSL.</p><h4>4. Configure Dockerfile or Procfile</h4><p>Before deploying, ensure that your backend has a Dockerfile or Procfile configured. Dokku uses these files to understand how to build and run your application. It must be in the root directory.</p><p><strong>For Node.js, a simple Procfile might look like this:</strong></p><pre>web: npm start</pre><p>If you’re using Docker, make sure your Dockerfile is properly configured to build and run your application.</p><p>An example frontend Angular app can be run with this Procfile:</p><pre>web: npx serve -s dist/matching-game-angular</pre><p>A simple frontend HTML website can also be dockerized and run with Nginx or Apache2 if necessary. The content of the Dockerfile:</p><pre># Base image<br>FROM nginx:alpine<br><br># Copy static files to the nginx html directory<br>COPY . /usr/share/nginx/html<br><br># Expose the default port<br>EXPOSE 80</pre><p>This is an example for a fullstack application that stores questions and users in a MySQL database, with a Node.js (Express.js) backend and an Angular frontend.</p><p><strong>Frontend Procfile</strong></p><pre>web: npx serve -s dist/&lt;APP-NAME&gt;</pre><p><strong>Backend Procfile</strong></p><pre>web: node src/wait-for-db.js</pre><p><strong>wait-for-db.js — the environment variables were added by Dokku</strong></p><pre>const mysql = require(&#39;mysql2/promise&#39;);<br>const logger = require(&#39;./logger/logger&#39;);<br>const app = require(&#39;./server&#39;);<br>const port = process.env.PORT || 3000;<br>const seedDatabase = require(&#39;./seed/seeder&#39;);<br>const dbConfig = {<br>  host: process.env.DB_HOST,<br>  user: process.env.DB_USER,<br>  password: process.env.DB_PASSWORD,<br>  database: process.env.DB_NAME,<br>  port: 3306<br>};<br><br>async function checkDatabaseConnection() {<br>  let retries = 5;<br>  while (retries) {<br>    try {<br>      const connection = await mysql.createConnection(dbConfig);<br>      await connection end();<br>      logger.info(&#39;Database connection established. Seeding database...&#39;);<br>      await seedDatabase();<br>      app.listen(port, () =&gt; {<br>        logger.info(`App listening at http://localhost:${port}`);<br>      });<br>      break;<br>    } catch (err) {<br>      logger.error(&#39;Unable to connect to the database. Retrying in 5 seconds...&#39;);<br>      logger.error(err);<br>      retries -= 1;<br>      await new Promise(res =&gt; setTimeout(res, 5000));<br>    }<br>  }<br>  if (!retries) {<br>    logger.error(&#39;Failed to connect to the database after multiple attempts.&#39;);<br>    process.exit(1);<br>  }<br>}<br><br>checkDatabaseConnection();</pre><h4>5. Create Dokku Apps for Frontend and Backend</h4><p>Next, create separate Dokku apps for your frontend and backend. This step ensures that Dokku treats them as independent applications, allowing you to manage them separately.</p><p><strong>Backend (API) app creation</strong></p><pre>dokku apps:create my-backend-app</pre><p><strong>Frontend app creation</strong></p><pre>dokku apps:create my-frontend-app</pre><h4>6. Set Domains for Backend and Frontend</h4><p>You need to configure custom domains for both the backend and frontend. This setup allows your applications to be accessible through the appropriate URLs.</p><p><strong>Backend domain settings (with and without www)</strong></p><pre>dokku domains:add my-backend-app api.myapp.example.com<br>dokku domains:add my-backend-app www.api.myapp.example.com</pre><p><strong>Frontend domain settings (with and without www)</strong></p><pre>dokku domains:add my-frontend-app myapp.example.com<br>dokku domains:add my-frontend-app www.myapp.example.com</pre><p><strong>Domain remove in Dokku — if needed:</strong></p><pre>dokku domains:remove &lt;app-name&gt; &lt;domain-name&gt;</pre><h4>7. Set Environment Variables</h4><p>Environment variables are crucial for configuring various settings of your applications, such as API endpoints, database credentials, and CORS settings.</p><p><strong>CORS settings for the AP</strong></p><pre>dokku config:set my-backend-app CORS_ORIGIN=&quot;https://myapp.example.com, https://www.myapp.example.com&quot;</pre><p><strong>API base URL settings for the frontend</strong></p><pre>dokku config:set my-frontend-app API_BASE_URL=&quot;https://api.myapp.example.com, https://www.api.myapp.example.com&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*TuOMAMA7JUAvjwOkhGK3ww.jpeg" /></figure><h4>8. Enable SSL with Let’s Encrypt</h4><p>Ensuring the security of your web applications is crucial, and using SSL certificates is a key part of that. Let’s Encrypt provides free SSL certificates, and you can easily enable SSL for both your backend and frontend applications with Dokku.</p><p><strong>Follow these steps to enable SSL:</strong></p><ol><li><strong>Set Up Your Email for Let’s Encrypt (once)</strong></li></ol><p>If you encounter an error stating that a certificate cannot be requested without an email address, you need to set your email address. Here’s how you can do it:</p><pre>dokku letsencrypt:set --global email user@example.com</pre><p>This command sets the global email address for Let’s Encrypt notifications. After setting the email, you can re-run the SSL enabling commands if necessary.</p><p><strong>2. Enable SSL for the Backend Application</strong></p><p>To enable SSL for your backend application, use the following commands:</p><pre>dokku letsencrypt:enable my-backend-app  <br>dokku letsencrypt:cron-job --add</pre><p><strong>3. Enable SSL for the Frontend Application</strong></p><p>Similarly, enable SSL for your frontend application:</p><pre>dokku letsencrypt:enable my-frontend-app  <br>dokku letsencrypt:cron-job --add</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P5GZG24aZ6qwuEnzSgzMYg.png" /><figcaption>Visual representation of SSL certificates being applied to a web application</figcaption></figure><h4>Handling Permission Issues (first time)</h4><p>If you encounter a “permission denied while trying to connect to the Docker daemon socket” error, it usually indicates that the user running the commands is not part of the Docker group or lacks the necessary permissions. Here’s how to resolve it:</p><ol><li><strong>Check User Group Membership</strong></li></ol><p>Verify if your user is part of the Docker group:</p><pre>groups</pre><p>If the Docker group is not listed, you need to add your user to the Docker group.</p><p><strong>2. Add User to the Docker Group</strong></p><p>Add the current user to the Docker group:</p><pre>sudo usermod -aG docker $USER</pre><p><strong>3. Apply the Changes</strong></p><p>Log out and log back in for the group changes to take effect, or run the following command to activate the changes immediately:</p><pre>newgrp docker</pre><h4>9. Add MySQL Database and Link It to Backend</h4><p>If your application requires a database, you can create a MySQL database and link it to your backend. Note: We use MySQL 5.7 because it’s more compatible with older CPUs that might not support newer instruction sets used by MySQL 8.0 or later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*MuDW0z1EiL69mIg3YYRFfA.png" /><figcaption>A simple diagram showing the link between a MySQL database and the backend application within Dokku.</figcaption></figure><p><strong>Create a MySQL database</strong></p><pre>dokku mysql:create myapp-db --image-version 5.7</pre><p><strong>Link the database to the backend app</strong></p><pre>dokku mysql:link myapp-db my-backend-app<br><br>or<br><br>dokku mysql:info myapp-db</pre><h4>10. Retrieve and Configure Database Credentials</h4><p>After creating and linking the database, you need to retrieve the database connection information and set it as environment variables in your backend application.</p><p><strong>Retrieve Database Information:</strong></p><p>Use the following command to display the MySQL service information:</p><pre>dokku mysql:info myapp-db</pre><p>This command will provide details such as the database host, username, and password.</p><p><strong>Set Environment Variables:</strong></p><p>Using the information retrieved, set the environment variables required for your backend to connect to the database:</p><pre>dokku config:set my-backend-app DB_HOST=&lt;your_database_host&gt;<br>dokku config:set my-backend-app DB_NAME=&lt;your_database_name&gt;<br>dokku config:set my-backend-app DB_USER=&lt;your_database_user&gt; <br>dokku config:set my-backend-app DB_PASSWORD=&lt;your_database_password&gt; <br>dokku config:set my-backend-app DATABASE_URL=mysql://&lt;your_database_user&gt;:&lt;your_database_password&gt;@&lt;your_database_host&gt;:3306/&lt;your_database_name&gt;</pre><p>An example of fine configured app:</p><blockquote>user@server:~$ dokku config app-name<br>=====&gt; app-name env vars<br>CORS_ORIGIN: <a href="https://example.com/">https://example.com</a>, <a href="https://www.example.com/">https://www.example.com</a><br>DATABASE_URL: mysql://mysql:password@database-host:3306/db_name<br>DB_HOST: database-host<br>DB_NAME: db_name<br>DB_PASSWORD: password<br>DB_USER: mysql<br>DOKKU_APP_RESTORE: 1<br>DOKKU_APP_TYPE: herokuish<br>DOKKU_PROXY_PORT: 80<br>DOKKU_PROXY_SSL_PORT: 443<br>GIT_REV: commit_hash</blockquote><h4>11. Deploy Applications from Git Repository</h4><p>Now that your Dokku environment is fully set up, you can deploy your applications directly from a Git repository. Since your repository includes both frontend and backend code, you’ll use git subtree to specify which part of the repository should be deployed to the respective Dokku app.</p><p><strong><em>If your Dokku server’s SSH connection does not use the default port 22</em></strong>, but instead uses a different port (e.g., 62222), you need to specify this port during the git push command. You can do this by either modifying the remote repository URL or by directly specifying the port in the command.</p><p><strong>1. Modify the Remote Repository URL with the Correct Port</strong></p><p>If you prefer to permanently set the correct port for your remote repository, follow these steps:</p><p><strong>Remove the Old Remote Repository (if needed)</strong></p><p>First, remove the existing remote repository entry:</p><pre>git remote remove my-dokku-app</pre><p><strong>Add the Remote Repository with the Correct Port</strong></p><p>Next, add the remote repository again, this time with the correct port:</p><pre>git remote add my-dokku-app ssh://dokku@your-server-ip:62222:my-dokku-app</pre><p><strong>2. Deploying with the Correct Port</strong></p><p>Once the remote repository is set up with the correct port, you can deploy your application using the git push command:</p><pre>git push my-dokku-app main:master</pre><p><strong>3. Alternative Method: Specifying the Port in the Command</strong></p><p>If you don’t want to modify the remote repository settings, you can specify the port directly in the git push command:</p><pre>git push ssh://dokku@your-server-ip:62222/my-dokku-app main:master</pre><p>By following these steps, you can ensure that you are using the correct port to connect to your Dokku server and successfully deploy your application.</p><p>Now that everything is set up, you can deploy your applications directly from the Git repository. Since your repository contains both frontend and backend code, you’ll use git subtree to specify which part of the repository should be deployed to which Dokku app.</p><h3><strong>Deploy frontend and backend from the same repo</strong></h3><p>For example, suppose you have a full-stack application in a single repository. In the root directory, there’s a Node.js (Express.js) backend located in the backend folder and an Angular frontend in the frontend folder. We will deploy these in two separate repositories because it is safer.</p><p><strong>Backend Deployment:</strong></p><pre>git remote add dokku-backend dokku@your-server-ip:my-backend-app <br>git subtree push --prefix backend dokku-backend main</pre><p><strong>If the SSH runs on the default 22 port:</strong></p><pre>git push dokku-backend main:master</pre><p><strong>If the port number of your SSH or the branch name of the source code is not the default:</strong></p><pre>git subtree push --prefix backend &quot;ssh://dokku@your-server-ip:&lt;portnumber&gt;/dokku-backend&quot; &lt;branch name e.g.: main&gt;</pre><p><strong>Frontend Deployment:</strong></p><pre>git remote add dokku-frontend dokku@your-server-ip:my-frontend-app <br>git subtree push --prefix frontend dokku-frontend main</pre><p><strong>If the port number of your SSH or the branch name of the source code is not the default:</strong></p><pre>git subtree push --prefix frontend &quot;ssh://dokku@your-server-ip:&lt;portnumber&gt;/dokku-frontend&quot; &lt;branch name e.g.: main&gt;</pre><p>When deploying applications using Dokku, it’s common to encounter various challenges or issues that require troubleshooting. Fortunately, Dokku provides an extensive <a href="https://dokku.com/docs/getting-started/troubleshooting/">troubleshooting guide</a> that covers a wide range of potential problems and their solutions. This resource is invaluable for diagnosing deployment errors, resolving connectivity issues, and ensuring that your applications run smoothly in production. Whether you’re dealing with container crashes, build failures, or environment configuration issues, the guide offers step-by-step instructions to help you get your deployment back on track efficiently.</p><h3>Setting Docker Restart Policies for Dokku Applications</h3><p>In a production environment, ensuring that your applications are resilient to failures and automatically restart when needed is crucial. Docker provides a feature called <strong>restart policies</strong>, which dictate how a container should behave when it exits. For applications deployed using Dokku, you can leverage this feature to automatically restart your apps in case of failures or system reboots. In this chapter, we’ll discuss how to set up Docker restart policies both during the initial deployment of Dokku applications and for existing apps, ensuring they remain highly available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G2t_xZedBRShlEE0LN5SpA.png" /><figcaption>A visual representation of how Docker’s restart policy works, possibly showing different states (running, stopped, restarting) and the command used to set this policy in Dokku.</figcaption></figure><h4>Setting Docker Restart Policies During Initial Deployment</h4><p>When deploying a new application on Dokku, it’s important to consider how the application will handle failures or system reboots right from the start. By setting a Docker restart policy during the initial deployment, you can ensure that your application will automatically restart if it crashes or if the server reboots. This proactive step helps maintain high availability and reduces the need for manual intervention.</p><p>Step 1: Set the Docker Restart Policy During Deployment</p><p>Before or immediately after deploying your application, you can set the Docker restart policy to ensure that the application container restarts automatically when needed. Use the following Dokku command to set the restart policy:</p><pre>dokku docker-options:add &lt;app-name&gt; deploy &quot;--restart=always&quot;</pre><p>Replace &lt;app-name&gt; with the name of your Dokku application.</p><p>Step 3: Verify the Restart Policy</p><p>After setting the restart policy, it’s a good practice to verify that it has been correctly applied. You can do this by inspecting the Docker container associated with your Dokku application:</p><pre>docker inspect --format &#39;{{ .HostConfig.RestartPolicy.Name }}&#39; $(dokku ps:inspect &lt;app-name&gt; --format &quot;{{ .ID }}&quot;)</pre><p>This command should return always, confirming that the container is configured to restart automatically.</p><p>Why Set the Restart Policy During Deployment?</p><p>Setting the Docker restart policy during the initial deployment ensures that your application is prepared to handle failures and reboots from the very beginning. This approach is especially important in production environments where downtime can have significant impacts. By configuring the restart policy upfront, you avoid potential issues and ensure that your application remains available to users with minimal disruptions.</p><p>Incorporating this step into your deployment process is a simple yet effective way to enhance the resilience and reliability of your applications, contributing to a smoother and more predictable operation of your services.</p><h4>Automating Docker Restart Policies for Existing Dokku Applications</h4><p>If you already have applications deployed on Dokku, you can configure Docker’s restart policy to ensure that these applications automatically restart if they go down. Below, we’ll walk through the process of setting up this policy for all existing Dokku apps using a simple Bash script.</p><p>Step 1: Listing All Existing Dokku Applications</p><p>First, you need to retrieve a list of all currently deployed Dokku applications. Dokku provides the apps:list command for this purpose. However, by default, this command includes a header (=== App Name) that we need to filter out. Here’s how you can do it:</p><pre>apps=$(dokku apps:list | tail -n +2)</pre><p>The tail -n +2 command skips the first line, ensuring you only get the names of the applications.</p><p>Step 2: Loop Through Each Application and Apply the Restart Policy</p><p>Once you have the list of applications, you can loop through each one and set the Docker restart policy using the docker-options:add command provided by Dokku:</p><pre>for app in $apps; do<br>    echo &quot;Setting restart policy for $app...&quot;<br>    dokku docker-options:add $app deploy &quot;--restart=always&quot;<br>done</pre><p>This loop will iterate over each application and configure Docker to always restart the container whenever it stops, regardless of the reason.</p><p>Step 3: Running the Script</p><p>To automate this process for all your existing applications, you can combine the commands into a Bash script. Here’s the complete script:</p><pre>#!/bin/bash<br># List all Dokku apps<br>apps=$(dokku apps:list | tail -n +2)<br># Loop through each app and set the restart policy<br>for app in $apps; do<br>    echo &quot;Setting restart policy for $app...&quot;<br>    dokku docker-options:add $app deploy &quot;--restart=always&quot;<br>done<br>echo &quot;Restart policy has been set for all Dokku apps.&quot;</pre><ol><li><strong>Create the Script</strong>: Save the above script in a file, for example, set-restart-policy.sh.</li><li><strong>Make the Script Executable</strong>: Grant execute permissions to the script:</li></ol><pre>chmod +x set-restart-policy.sh</pre><p><strong>3. Run the Script</strong>: Execute the script to apply the restart policy to all your Dokku apps:</p><pre>./set-restart-policy.sh</pre><p>Step 4: Verifying the Configuration</p><p>After running the script, you may want to verify that the restart policy has been correctly applied to your applications. You can do this by inspecting the Docker container associated with a particular Dokku app:</p><pre>docker inspect --format &#39;{{ .HostConfig.RestartPolicy.Name }}&#39; $(dokku ps:inspect &lt;app-name&gt; --format &quot;{{ .ID }}&quot;)</pre><p>Replace &lt;app-name&gt; with the name of your Dokku application. If everything is configured correctly, this command should return always, indicating that the restart policy is active.</p><h4>Why This Matters</h4><p>Setting up a Docker restart policy is a crucial step in ensuring the availability and resilience of your applications. In a production environment, unexpected issues such as crashes, system reboots, or failures can occur. By configuring your Dokku applications to automatically restart, you minimize downtime and ensure that your services remain accessible to users with minimal intervention.</p><p>Additionally, this setup is particularly useful in scenarios where you’re managing multiple applications, as it automates recovery processes that would otherwise require manual intervention.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VRlwuLTIqhzi2EvaSN-Xkw.png" /><figcaption>A browser screenshot showing the final deployed application running securely with a custom domain and SSL.</figcaption></figure><h3>Conclusion:</h3><p>By following these steps, you’ve successfully deployed a fullstack Angular + Node.js/Spring Boot application on a VPS using Dokku. The separation of the frontend and backend applications, along with the integration of environment variables, SSL, and database configuration, ensures that your deployment is robust, secure, and scalable.</p><h3><strong><em>Sources of the pictures:</em></strong></h3><p><a href="https://pixabay.com/users/clarkdonald413-9744435/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=4259595">https://pixabay.com/users/clarkdonald413-9744435/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=4259595</a></p><p><a href="https://unsplash.com/@alexacea?utm_content=creditCopyText&amp;utm_medium=referral&amp;utm_source=unsplash">Alexandru Acea (@alexacea) | Unsplash Photo Community</a></p><p><a href="https://pixabay.com/users/viarami-13458823/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=5290465">https://pixabay.com/users/viarami-13458823/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=5290465</a></p><p><a href="https://pixabay.com/users/skylarvision-2957633/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=3344700">https://pixabay.com/users/skylarvision-2957633/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=3344700</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5521dbd8767" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Job Search Juggler: Automate Your Application Follow-Ups]]></title>
            <link>https://aporkolabsdevhackery.medium.com/job-search-juggler-automate-your-application-follow-ups-bfbf6631a39a?source=rss-2a56ccbaddd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfbf6631a39a</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[tech-career]]></category>
            <category><![CDATA[job-hunting]]></category>
            <category><![CDATA[google-scripts]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[APorkolab’s DevHackery]]></dc:creator>
            <pubDate>Fri, 03 Nov 2023 06:13:44 GMT</pubDate>
            <atom:updated>2023-11-03T06:13:44.539Z</atom:updated>
            <content:encoded><![CDATA[<p>Navigating the job market can be a daunting task, especially when it comes to keeping track of numerous applications and their respective follow-ups. A while back, I tackled this challenge head-on by developing a Google Apps Script that automates follow-up emails and reminders. This project not only honed my scripting skills but also provided a much-needed system to manage job applications efficiently. In this post, I’ll share how <a href="https://github.com/APorkolab/JobHuntHelper">this script</a> works and how you can adapt it for your job search process.</p><p>Please, find the link to the GitHub repo here: <a href="https://github.com/APorkolab/JobHuntHelper">https://github.com/APorkolab/JobHuntHelper</a></p><h3>The Genesis of the Project</h3><p>The idea was born out of necessity when I was deeply involved in the tech community’s hiring processes. I noticed a common thread among job seekers: the overwhelming nature of managing multiple applications. It was clear that a streamlined system could significantly improve this experience. Thus, I created a solution that could automate the follow-up process, track application statuses, and schedule reminders with minimal user intervention.</p><p>Basically, I handle applications in two languages: Hungarian and English. The script therefore generates e-mail drafts depending on the language in which the application was made. There is also an option to send an automatic e-mail, but since I’m healthy paranoid, I’d rather send the generated draft myself after double-checking. :) In Hungarian corporate culture, multiple letters on the same topic are discouraged — so the script generates only one e-mail.</p><p>Another important principle in creating a table is that I use - color codes. Orange applications are still in progress and need to be dealt with, red applications are rejections — they no longer matter. The script therefore only checks the orange cells, so it is important to really update and color the table almost immediately when needed.</p><p>With the code just written, reports can also be generated, but their deeper elaboration is still pending: currently, only the basic data can be retrieved, e.g.: the number of inquiries.</p><p>Basically, the script works in 3 steps:</p><ul><li>it creates a reminder in the table 8 days later than the application and also creates a Google Calendar entry for the next day to write an e-mail of interest. If the next day is not a weekday, but a weekend, then the script sets the reminder for Monday morning at 8 o’clock.</li><li>At the same time, a generated e-mail draft is created with the application data, which you just have to check and send.</li><li>The script reminds you 16 and 24 days after applying, and if 1 month has passed, it indicates that the position has probably already been filled.</li></ul><p>The script is based on a Google Spreadsheet, namely it contains the following columns:</p><ol><li>Company Name: The name of the organization where you’ve applied for a position.</li><li>Position: The specific title of the job role you’re applying for, such as “Junior Python Developer” or “Medior Ruby on Rails Developer.”</li><li>Application Form: The method you used to apply, such as “Online Submission,” “Email,” or “Referral.”</li><li>Language: The language in which the application should be made or the main language used by the company.</li><li>Application Time: The date and time when you submitted your job application.</li><li>Warning Message Column: A reminder or alert set for yourself to follow up if you haven’t heard back within a certain time frame.</li><li>Job Description PDF Link: A hyperlink to the PDF containing the job description, which can be a useful reference for interview preparation. I use <a href="https://www.printfriendly.com/">PrintFriendly</a> on the job description page, which can generate pretty PDF’s. This document has been uploaded to my Google Drive, and the sharing link has been copied to this cell. This allows me to see the job description by phone search even after it&#39;s taken off the internet.</li><li>Number of Interested Messages: The count of communications you’ve received from the company, indicating their interest or responses to your application.</li><li>Name of the Contact Person: The individual at the company who is your main point of contact, usually in HR or the hiring manager.</li><li>Contact E-mail Address: The email address of your contact person for follow-ups or additional communication.</li><li>Job Link: A direct link to the job posting on the company’s career page or job board.</li><li>Comment: Personal notes or initial impressions about the job or the application process.</li><li>What I Attached: Documentation or files you’ve included with your application, such as a resume, cover letter, portfolio, etc.</li><li>They Asked for a Wage Claim: Indicates whether the company has requested your salary expectations.</li><li>What I Gave: Your response to the salary expectation inquiry, if applicable.</li><li>Feedback Time: The date when you received feedback on your application, if any.</li><li>Telephone Interview: The date and time of a scheduled telephone interview.</li><li>1st Interview: The date and time of your first in-person or video interview.</li><li>2nd Interview: The date and time of your second interview, if applicable.</li><li>3rd Interview: The date and time of your third interview, if applicable.</li><li>Test/Trial Assignment: Details about any practical tests or assignments given to you as part of the application process.</li><li>Offer: Information on the job offer received, including the date of the offer and any pertinent details.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0uC_CvwuJZ0HGd_nkBX93Q.png" /><figcaption>The spreadsheet was mocked with false data (thanks, <a href="http://mockaroo.com/">Mockaroo</a>)</figcaption></figure><h3>The Mechanics of the Script</h3><p>The script interfaces with Google Sheets and Gmail, turning a spreadsheet into a powerful job application tracking tool. Here’s a brief overview of its core functionalities:</p><ul><li>Daily Triggers: The script sets up triggers to run the application check twice daily, ensuring no follow-up opportunity is missed.</li><li>Application Status Check: It compares the application date with the current date and determines if a follow-up is necessary based on a predefined reminder interval.</li><li>Email Draft Creation: For applications needing a follow-up, the script generates a draft email in Gmail, tailored to the specifics of the application and ready for review.</li><li>Calendar Event Creation: It also schedules calendar events as reminders to check the application status, keeping the job seeker on top of their schedule.</li><li>Reporting: The script can generate visual reports within the Google Sheet, providing insights into the job search efforts and outcomes.</li></ul><h3>Adapting the Script for Personal Use</h3><p>The script is designed to be flexible and can be adapted to fit any job seeker’s needs. You’ll need a Google Sheet with columns for the company name, position, application date, contact name, and email, among others. The script’s settings can be customized, such as the number of days after which a follow-up should be sent.</p><p>The full script includes functions to create triggers, check applications, create email drafts, and generate reports. Each function is meticulously documented, making the script user-friendly and easy to modify.</p><h3>The Mechanics of the Script</h3><p>Custom Alerts and Notifications: The script allows users to set up custom alerts for follow-up reminders. By inputting the desired follow-up interval in the settings, the script calculates the exact date when a follow-up should occur. If no response has been received by this date, the script automatically flags this for the user’s attention.</p><p>Automated Email Follow-Ups: One of the script’s standout features is its ability to automate email follow-ups. It checks the ‘Application Time’ against the current date and, if the follow-up interval has passed without a response, it generates a personalized email draft. This draft can be reviewed and sent out with just a few clicks, ensuring consistent and timely communication with potential employers.</p><p>Interview Scheduling: The script also aids in managing interview schedules. It can be set to track dates and times for telephone screenings, first, second, and third interviews, and even test assignments. By integrating with Google Calendar, the script ensures that all interview appointments are automatically added to the user’s schedule.</p><p>Application Insights: A particularly insightful feature is the script’s ability to generate reports within the Google Sheet. These reports can track metrics such as the number of interested messages from employers, providing users with a clear picture of their job search progress and which applications are garnering the most interest.</p><h3>Adapting the Script for Personal Use</h3><p>Customization: To adapt <a href="https://github.com/APorkolab/JobHuntHelper">the script</a> for personal use, start by setting up a Google Sheet with the necessary columns as outlined in the script. Then, customize the settings within the script to match your preferences. For example, you can adjust the reminderDaysAfter to change how many days after an application you&#39;d like to follow up.</p><p>Installation: Installing the script is straightforward. Simply copy the script into the script editor of your Google Sheet and save it. You’ll need to run the createTriggers function to set up the automated checks and follow-up reminders. The first time you run the script, Google will prompt you to authorize the script to interact with your Gmail and Google Calendar.</p><p>Troubleshooting: If you run into any issues, such as the script not triggering at the correct times, first check the trigger settings in the Google Apps Script dashboard. Ensure that the triggers are set correctly and that the script has the necessary permissions to run.</p><h3>The Impact of the Script</h3><p>Since implementing this automated system, the feedback from users has been overwhelmingly positive. Job seekers have reported a more organized search process, timely follow-ups, and a reduction in the stress associated with job hunting. The script has proved to be a valuable asset in the job application process.</p><p>Personal Reflection: In my use, this script has been a game-changer. It has streamlined the tedious task of tracking applications and follow-ups, allowing me to focus on preparing for interviews and researching companies. The automated reminders and email drafts have saved countless hours and significantly reduced the chance of human error.</p><p>Future Developments: I am continuously looking to improve the script based on user feedback and personal experience. Future updates may include more sophisticated tracking of application stages and integration with other job search tools and platforms.</p><h3>Final Thoughts</h3><p>Automation is not just a buzzword; it’s a practical tool that can bring order and efficiency to the often chaotic job search process. This script is a testament to how a little bit of coding can go a long way in managing personal tasks. I encourage you to try it out, customize it to your needs, and take control of your job search.</p><p>Remember, the full script and detailed instructions are available on the GitHub repository. Your job search doesn’t have to be a disorganized mess. With this script, you can automate the mundane and focus on what truly matters — landing your dream job.</p><p>Please, find the link to the GitHub repo here: <a href="https://github.com/APorkolab/JobHuntHelper">https://github.com/APorkolab/JobHuntHelper</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfbf6631a39a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Raspberry Pi 400: Compact Powerhouse for Modern Web Developers]]></title>
            <link>https://aporkolabsdevhackery.medium.com/the-raspberry-pi-400-compact-powerhouse-for-modern-web-developers-301d949a4662?source=rss-2a56ccbaddd------2</link>
            <guid isPermaLink="false">https://medium.com/p/301d949a4662</guid>
            <category><![CDATA[automation-solution]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[optimization-services]]></category>
            <category><![CDATA[database-management]]></category>
            <category><![CDATA[raspberry-pi-400]]></category>
            <dc:creator><![CDATA[APorkolab’s DevHackery]]></dc:creator>
            <pubDate>Mon, 23 Oct 2023 16:51:37 GMT</pubDate>
            <atom:updated>2023-10-23T17:12:47.145Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*bLb1BcZvDiRjfShwVcUAoQ.png" /></figure><p><em>⚠️ Warning: Please be aware that the Raspberry Pi 400, while a capable device, may encounter issues when running multiple processes simultaneously on larger projects. It’s essential to understand its limitations, especially when handling resource-intensive tasks. It’s not advisable to use this configuration in a live production environment. Always prioritize safety and stability when deploying any application or system.</em></p><p>Web development is evolving rapidly with developers now having the flexibility to choose from a plethora of tools and environments. In this milieu, the Raspberry Pi 400 stands out as a compact yet potent machine for web development. Let’s dive deep into its possibilities and how you can set up a versatile web development environment.</p><p>So I’m working on a Spring Boot + Angular 16 full-stack project, and I was looking for a way to mock the back-end on a local network. I remembered that I have a Raspberry Pi 400 computer that I haven’t really used since 2020.<br>I was wondering, as a web developer, what are the possible applications?</p><p>Step zero, if you’re using it after several months/years of not using it, is to download the latest Raspberry Pi Imager from the Raspberry Pi OS website and create a copy of the OS on a MicroSD card. I myself upgraded from buster (Debian 10) to bookworm (Debian 12) after 3 years. Unfortunately, I only managed such a big version jump with a complete reinstall.</p><h3>Setting Up Your Raspberry Pi 400 for Web Development</h3><p>Before diving into the technicalities, it’s essential to ensure that your Raspberry Pi 400 is set up correctly. As mentioned earlier, updating the OS is crucial. But once that’s done, here are some additional steps to optimize it for web development:</p><ol><li>I<em>nstall Essential Development Tools</em>: Depending on your project requirements, you might need tools like Node.js, npm, or even Docker. Ensure you have all the necessary tools installed and updated.</li><li><em>Secure Your Device</em>: Since you’ll be using it for development, it’s essential to ensure that your Raspberry Pi is secure. Regularly update your software packages and consider setting up a firewall.</li><li><em>Optimize Your Workspace</em>: The Raspberry Pi 400 is compact, but that doesn’t mean you can’t have a robust development environment. Consider using tools like Visual Studio Code, which has a version optimized for the Raspberry Pi.</li></ol><h3>Adding static IP for Raspberry Pi 400</h3><p>To ensure network accessibility for servers running on Raspberry Pi 400, you need to follow a few basic steps:</p><ol><li>Set a static IP address for the Raspberry Pi 400:</li></ol><ul><li>This ensures that you always have access to the same IP address within your local network.</li><li>Modify the /etc/dhcpcd.conf file.</li></ul><pre>sudo nano /etc/dhcpcd.conf</pre><ul><li>Add the following settings:</li></ul><pre>interface eth0<br>static ip_address=192.168.x.x/24<br>static routers=192.168.x.1<br>static domain_name_servers=192.168.x.1</pre><ul><li>(Replace the x values with the corresponding values of your own network.)</li><li>Save and exit: Ctrl + O, Enter, then Ctrl + X.</li></ul><p>2. Firewall settings:</p><ul><li>If you have an active firewall on your Raspberry Pi 400, make sure that the ports used for servers are enabled. For example, if you have ufw (Uncomplicated Firewall) installed:</li></ul><pre>sudo ufw allow 8080  # to Jenkins<br>sudo ufw allow 3000  # to json-server<br>sudo ufw allow 3306  # to MySQL<br># ... additional ports for the services you use</pre><p>3. Router settings:</p><ul><li>If you are using the Raspberry Pi on a network where a router controls access, check the router settings to make sure that the ports are forwarded to the Raspberry Pi’s IP address. The port forwarding procedure varies from router to router, so check the router manufacturer’s instructions.</li></ul><p>4. Software settings:</p><ul><li>Some servers (e.g. database servers) only accept connections from localhost by default. Some hosts (e.g. localhost) may only accept requests from certain hosts (e.g. hosts that are hosted on your server only).</li><li>Example for MySQL: Edit the file my.cnf or mysqld.cnf (location depends on the distribution) and under the [mysqld] section set the bind-address to 0.0.0.0.</li></ul><p>After these steps, the servers running on the Raspberry Pi 400 should be accessible from other devices on your network.</p><h3>Embrace the Power of an (Almost Fully) Automated JSON Server</h3><p>Transform a mundane Sunday into a productive one by integrating the json-server into your web development environment on the Raspberry Pi 400. The json-server stands out as a remarkable tool that requires zero-coding, offering a comprehensive fake REST API, ideal for prototyping and mocking. Dive into this engaging task and enhance your web development workflow with a touch of automation and efficiency.</p><h3>Installing json-server</h3><ol><li>Node.js and npm: If you haven’t already, you’ll first need Node.js and npm:</li></ol><pre>sudo apt-get install -y nodejs npm</pre><p>2. Install json-server globally:</p><pre>sudo npm install -g json-server</pre><h3>Setting Up Automatic Execution</h3><p>For auto-starting json-server, we&#39;ll utilize systemd, which is a system and service manager for Linux.</p><ol><li>Create a systemd service file:</li></ol><pre>sudo nano /etc/systemd/system/json-server.service</pre><p>2. Add the following content:</p><pre>[Unit]<br>Description=JSON Server<br>After=network.target</pre><pre>[Service]<br>ExecStart=/usr/local/bin/json-server --watch /path_to_your/db.json --host your_raspberry_pi_IP<br>Restart=always<br>User=pi<br>Group=pi<br>Environment=PATH=/usr/bin:/usr/local/bin<br>WorkingDirectory=/path_to_directory_containing_db_json</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Replace /path_to_your/db.json with the path to your db.json file and your_raspberry_pi_IP with the IP address of your Raspberry Pi.</p><p>3. Reload systemd to recognize the new service and enable it:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable json-server.service</pre><p>4. Start the service:</p><pre>sudo systemctl start json-server.service</pre><p>With this setup, json-server will watch your db.json file for changes and will automatically restart if the file is modified or if the Raspberry Pi is rebooted. The Restart=always directive ensures that the server will attempt to restart if it crashes or exits for any reason.</p><p>To check the status of your json-server, you can use:</p><pre>sudo systemctl status json-server.service</pre><p>This will allow you to have a robust mock REST API on your Raspberry Pi 400 for rapid web development and testing.</p><p><strong><em>It is just the beginning. We should automatize it further.</em></strong></p><p>To automatically restart json-server upon changes to the db.json file, we&#39;ll use a tool called inotify-tools.</p><p>inotify-tools provides a set of command-line programs for using inotify, a Linux kernel feature to monitor changes to files and directories. Specifically, we&#39;ll use the inotifywait command to watch for changes to the db.json file and then restart the json-server service when a change is detected.</p><h3>Installing inotify-tools</h3><ol><li>Install inotify-tools:</li></ol><pre>sudo apt-get install inotify-tools</pre><h3>Setting Up the Watcher Service</h3><p>2. Create a script that watches for changes and restarts json-server:</p><pre>nano ~/json-watcher.sh</pre><p>3. Add the following content:</p><pre>#!/bin/bash</pre><pre>while inotifywait -e modify /path_to_your/db.json; do<br>    sudo systemctl restart json-server.service<br>done</pre><ul><li>Make sure to replace /path_to_your/db.json with the actual path to your db.json file.</li></ul><p>3. Make the script executable:</p><pre>chmod +x ~/json-watcher.sh</pre><p>4. Create a systemd service file for the watcher:</p><pre>sudo nano /etc/systemd/system/json-watcher.service</pre><p>5. Add the following content:</p><pre>[Unit]<br>Description=JSON Server Watcher<br>After=network.target</pre><pre>[Service]<br>ExecStart=/home/pi/json-watcher.sh<br>Restart=always<br>User=pi<br>Group=pi<br>Environment=PATH=/usr/bin:/usr/local/bin</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>6. Reload systemd, enable and start the watcher service:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable json-watcher.service<br>sudo systemctl start json-watcher.service</pre><p>Now, every time you modify the db.json file, the watcher service will detect the change and restart the json-server service, ensuring your mock REST API reflects the latest data changes immediately.</p><h3>SSH Setup</h3><ol><li>SSH server control on Raspberry Pi:</li></ol><p>Verify that the SSH server is running on the Raspberry Pi:</p><pre>sudo systemctl status ssh</pre><p>If it is not running, start it and enable autostart:</p><pre>sudo systemctl start ssh<br>sudo systemctl enable ssh</pre><p>2. Checking the firewall settings:</p><p>If you have a firewall installed on your Raspberry Pi (such as ufw), check if SSH access is enabled:</p><pre>sudo ufw status</pre><p>If port 22 is not enabled, enable it:</p><pre>sudo ufw allow 22</pre><p>3. Check network settings:</p><p>Check your Raspberry Pi’s IP address. You can do this with the following command:</p><pre>ip a</pre><p>4. Check SSH settings:</p><p>Check the SSH configuration file:</p><pre>sudo nano /etc/ssh/sshd_config</pre><p>Make sure the following settings are set correctly:</p><pre>Port 22<br>PermitRootLogin no<br>AllowUsers &lt;username&gt;</pre><p>After verifying and modifying the above settings as necessary, save the file and restart the SSH server:</p><pre>sudo systemctl restart ssh</pre><p>Now try to connect again with the scpcommand.</p><p>You can use it on another computer with the following command. Let’s enter the folder of the given file.</p><pre>scp &lt;fileName&gt;.json &lt;username&gt;@&lt;raspberry-pi-IP&gt;:&lt;jsonserver/db.json path&gt;</pre><h3>Make a PostgreSQL and MySQL server for our local network</h3><p><strong><em>Adminer with PostgreSQL</em></strong></p><p>After setting up the Raspberry Pi OS, the next step is to introduce database management. While many developers gravitate towards MySQL or SQLite, PostgreSQL offers robust features, making it an attractive option.</p><pre>sudo apt-get update<br>sudo apt-get install postgresql postgresql-contrib</pre><p>Once PostgreSQL is installed and running, managing the database becomes paramount. Here, Adminer steps in. It’s a lightweight database management tool, which seamlessly integrates with PostgreSQL, offering a user-friendly web interface.</p><pre>sudo apt-get install adminer<br>sudo ln -s /usr/share/adminer/adminer.php /var/www/html/adminer.php</pre><p>I have had a problem after installation: the style sheet of the Admin page does not appear, and I got 404’s on the console. In this case, you must download the <a href="https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.zip">full source code from adminer.org</a> and copy the /adminer/static folder from the ZIP file to /var/www/html/adminer.</p><p><strong><em>MySQL and PHPMyAdmin</em></strong></p><p>MySQL is undeniably one of the most popular database solutions. Setting it up on Raspberry Pi 400 is straightforward:</p><pre>sudo apt-get install mysql-server</pre><p>For managing MySQL databases via a web interface, PHPMyAdmin is an excellent choice:</p><pre>sudo apt-get install phpmyadmin</pre><p>This setup ensures you have both PostgreSQL and MySQL at your disposal, providing the flexibility to choose the right database for your projects.</p><p><strong><em>Node.js and npm</em></strong></p><p>Modern web development is incomplete without the Node.js environment. Along with npm (Node Package Manager), it offers a potent combination to run server-side JavaScript and manage dependencies.</p><pre>sudo apt-get install -y nodejs npm</pre><p><strong><em>Local Web Servers</em></strong></p><p>To run and test websites locally, setting up a web server is essential. Both Apache and Nginx are viable options:</p><pre># For Apache<br>sudo apt-get install apache2</pre><pre># For Nginx<br>sudo apt-get install nginx</pre><p><strong><em>Version Control with Git</em></strong></p><p>Managing and tracking your code changes is fundamental in web development. Installing Git offers this capability:</p><pre>sudo apt-get install git</pre><h3>Expanding Possibilities</h3><p>Beyond these setups, Raspberry Pi 400 can be equipped with:</p><ul><li><em>Web Development Frameworks</em>: Tools like Flask or Express can be installed to accelerate backend development.</li><li><em>Text Editors</em>: Lightweight editors like Nano or Vim come pre-installed. For a GUI-based solution, Geany is an excellent option.</li><li><em>File Transfer</em>: Tools like scp can be used to securely transfer files between your Raspberry Pi and other devices.</li><li><em>Using it as a Learning Platform</em>: The Raspberry Pi 400 is a great tool for practicing and learning web development skills. You can install development tools like Visual Studio Code and study the workings of HTML, CSS, JavaScript, and other technologies.</li><li><em>Prototyping Web Applications or APIs</em>: If you have an idea for a web application or an API, the Raspberry Pi 400 is a great tool for creating a prototype.</li><li><em>Hosting Static Websites</em>: If you want to run simple, static websites, the Raspberry Pi 400 is perfectly suitable.</li><li><em>Web-based IoT Projects</em>: You can integrate the Raspberry Pi 400 into IoT (Internet of Things) projects, creating web-based interfaces for managing and monitoring various sensors or devices.</li><li><em>Testing Web Applications in Different Browsers</em>: You can install various browsers on the Raspberry Pi 400, allowing you to test your applications’ compatibility and performance on these platforms.</li><li><em>Using it as a Portable Web Development Station</em>: Given the compact size of the Raspberry Pi 400, you can make it portable, taking your development environment anywhere you go.</li><li><em>Monitoring Servers and Databases</em>: You can install software like Grafana or Prometheus to monitor your web applications and their backend infrastructure.</li></ul><h3>Concluding Thoughts</h3><p>The Raspberry Pi 400 is an excellent choice for web development projects, especially if you’re looking for a cost-effective and compact solution. Its capabilities, especially in the realm of web development, are immense. From setting up databases to running local servers to coding, this pocket-sized marvel is reshaping how we perceive and approach web development. With just a few commands, it’s ready to serve as your mini workstation, making web development efficient, portable, and more fun.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=301d949a4662" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deleting All Tables in a MariaDB Database Using SQL]]></title>
            <link>https://aporkolabsdevhackery.medium.com/deleting-all-tables-in-a-mariadb-database-using-sql-7bc08b2b7223?source=rss-2a56ccbaddd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bc08b2b7223</guid>
            <category><![CDATA[data-backup-and-recovery]]></category>
            <category><![CDATA[database-management]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[mariadb]]></category>
            <category><![CDATA[data-deletion]]></category>
            <dc:creator><![CDATA[APorkolab’s DevHackery]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 19:49:36 GMT</pubDate>
            <atom:updated>2023-10-14T07:45:25.078Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>When working with databases, there may be scenarios where you need to delete all tables in a database. While there is no direct SQL statement to accomplish this in MariaDB, we can still achieve the desired result using a simple SQL query combined with a script. In this blog post, we will explore a method to delete all tables in a MariaDB database using SQL.</p><p><em>I would like to express my gratitude to Olivér Tölcsér, who was my former senior colleague in the development team, for providing me with clarification.</em></p><p>If you have a graphical user interface (GUI), such as PHPMyAdmin, it may be more convenient and safer to discard and recreate the entire database, especially if the goal is to make significant changes to the database structure. <strong>However, it is important to note that this method is not always applicable, especially when keys and references are defined in the database.</strong></p><p>When the database is completely discarded and recreated, keys and references can be lost, which can cause problems with relationships and data integrity. In such cases, it is recommended to ensure that the database structure is correctly updated and keys are restored before proceeding.</p><p>Also, always have a good backup of the database before performing any operations that could lead to data loss. Database security and data integrity is always of paramount importance, and you should never delete or modify a database without taking the necessary precautions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*omggSOHp0yM8qBnH.png" /></figure><h3>Prerequisites</h3><p>Before proceeding, ensure that you have access to a MariaDB server and a database where you want to delete all the tables. Make sure you have the necessary permissions to perform deletion operations.</p><h3>Solution</h3><p>To delete all tables in a MariaDB database, we can generate a series of DROP TABLE statements dynamically. Let&#39;s take a look at the steps involved:</p><ol><li>Connect to your MariaDB server using a client such as MySQL Workbench or the command-line interface.</li><li>Identify the database schema where the tables exist. In this example, we will use the example_db schema.</li><li>Run the following SQL query to generate the DROP TABLE statements for all tables in the specified schema:</li></ol><pre>SELECT CONCAT(&#39;DROP TABLE IF EXISTS &#39;, table_name, &#39;;&#39;)<br>FROM information_schema.tables<br>WHERE table_schema = &#39;example_db&#39;;</pre><p>This query retrieves the table names from the information_schema.tables view and concatenates them with the DROP TABLE IF EXISTS statement.</p><p>4. Copy the generated DROP TABLE statements from the result set.</p><p>5. Paste the statements into the MariaDB client and execute them to delete the tables.</p><blockquote><em>Note: Ensure that you are connected to the correct database before executing the </em><em>DROP TABLE statements.</em></blockquote><h3>Example</h3><p>Let’s illustrate the solution with an example. Assume we have the example_db database with multiple tables that we want to delete. Here&#39;s how we can achieve that using the steps outlined above:</p><ol><li>Connect to the MariaDB server using a client.</li><li>Execute the following SQL query to generate the DROP TABLE statements:</li></ol><pre>SELECT CONCAT(&#39;DROP TABLE IF EXISTS &#39;, table_name, &#39;;&#39;)<br>FROM information_schema.tables<br>WHERE table_schema = &#39;example_db&#39;;</pre><p>3. Copy the resulting DROP TABLE statements:</p><pre>DROP TABLE IF EXISTS table1;<br>DROP TABLE IF EXISTS table2;<br>DROP TABLE IF EXISTS table3;<br>...</pre><p>4. Paste the copied statements into the MariaDB client and execute them to delete the tables.</p><h3>Conclusion</h3><p>Although there is no direct SQL statement to delete all tables in a MariaDB database, we can achieve the desired result by generating and executing DROP TABLE statements dynamically. This approach allows us to automate the process of deleting multiple tables in a schema.</p><p>However, it is crucial to exercise caution when performing such operations, as the deletion is permanent and irreversible. Always ensure you have a data backup and verify that there are no dependencies or references to the tables you intend to delete.</p><p>Following the steps outlined in this blog post, you can confidently delete all tables in a MariaDB database using SQL and simplify your database management tasks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bc08b2b7223" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>