Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

102 total results found

Running SAM in Local Computer

Running AWS Lambda Function on Local En...

SAM stands for Serverless Application Model. Run this following command : sam local invoke

Running BookStack in aaPanel Using Docker

Running BookStack in aaPanel Using Docker

Create Docker compose in YAML file Write this following code: version: '3.8' services: bookstack: image: lscr.io/linuxserver/bookstack:latest container_name: bookstack_app environment: - PUID=1000 - PGID=1000 - TZ=<You timezone...

Activating SSL for BookStack Application

Running BookStack in aaPanel Using Docker

Add New Site This following code is the original nginx setup. server { listen 80; server_name learning.introvesia.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/learning.introvesia.com; #S...

Creating Global Environment Variables

Creating Database Importer with NodeJS ...

Global environment variables are varible that is accessible globally. Usually it's declared in file with name .env. # PostgreSQL PGHOST="Your DB IP address" PGPASSWORD="Your DB password" PGDATABASE="You DB name" PGUSER="Your DB username" # CSV files on S3 buc...

Handler Function

Creating Database Importer with NodeJS ...

Handler function is a function that will be invoked by AWS Lambda when the trigger is activated. /** * The main function * @param {object} event Event from system * @returns */ export const handler = async (event) => { // Return the output return ...

Credential Configuration File

Creating Database Importer with NodeJS ...

Accessing AWS S3 bucket needs permission using credential. The credential will be stored into a file named prd_s3.cfg. [default] access_key = <Access key> secret_key = <Secret key>

Database Structure

Creating Database Importer with NodeJS ...

This database helps AWS Lambda to index importing tasks. Tables Date Indexing Table CREATE TABLE indices.s3_date_hns ( id bigserial NOT NULL, date_hns timestamp NULL, is_imported bool DEFAULT false NULL, started_at timestamp NULL, finished_at timestamp NU...

UWSG Configuration

Running Django Framework API on aaPanel

INI File [uwsgi] module = introvesia.wsgi:application master = true processes = 4 socket = /var/www/html/introvestama/introvesia.sock chmod-socket = 660 vacuum = true die-on-term = true Service File [Unit] Description=uWSGI Service After=network.target [Serv...

Nginx Server Configuration

Running Django Framework API on aaPanel

server { listen 80; server_name investment.introvesia.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/investment.introvesia.com; #SSL-START SSL related configuration, do NOT delete or modif...

Managing CronJobs List

Managing Pods

List all CronJobs in the current namespace: kubectl get cronjobs This will display a list of all CronJobs in the namespace you are currently working in. List CronJobs in a specific namespace: kubectl get cronjobs -n <namespace> Replace <namespace> with t...

Add a New CronJob

Managing Pods

Option 1: Create a CronJob Using a YAML Manifest 1. Create a new cronjob.yaml file: apiVersion: batch/v1 kind: CronJob metadata: name: example-cronjob spec: schedule: "*/5 * * * *" # Runs every 5 minutes jobTemplate: spec: template: sp...

CronJobs

Linux Commands

Command Format # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunda...

Kubernetes Commands

Managing Pods

Access inside a pod kubectl exec -ti <pod_name> -n <namespace_name> -- /bin/bash Find and stop pods for i in `kubectl get deployment -n <namespace> | grep <pod-name-prefix> | awk '{print $1}'` do echo $i kubectl scale deployment $i -n <namespace> --replic...

Deleting Log Files inside other Pods Using CronJob

Managing Pods

apiVersion: batch/v1 kind: CronJob metadata: name: delete-server-log namespace: <namespace> spec: schedule: "*/5 * * * *" # Runs every 5 minutes jobTemplate: spec: template: spec: containers: - name: <pod-name> ...

Bash Script to Delete Log Files Inside Pods Based on Retention Days

Managing Pods

#!/bin/bash # Retention days for log files (delete files older than this many days) RETENTION_DAYS=2 # Change this to your desired retention period in days # Directory where the logs are mounted (should be the same as mountPath in Kubernetes) LOG_DIR="/Log"...

File and Folder

Linux Commands

Show file contents from tail with specific line number limit: tail -n 200 <file> Show file contents from head with specific line number limit: head -n 200 <file> Show only modified time of a file: stat -c %y filename Human-readable format: stat -c %y filena...

Cannot Log in to an Instance via SSH

Error Debugging

Eventhough port for SSH, port 22, has opened, the connection to the instance is still failed. One of the problem is the volume where the server's SSH key files has deleted. So, the authentication cannot access the key files from that volume. Eventhough you use...

Build and Run a Container

Docker Commands

Build the Docker image docker build -t <image-name> . Run the container: docker run -d --name <container-name> <image-name> You can verify it’s working by checking the logs with: docker logs <container-name> Or by viewing the cron log specifically: docker e...

Bash Script to Delete Log Files Inside Pods Based on Retention Days with Different Target Folders

Managing Pods

#!/bin/bash # Retention days for log files (delete files older than this many days) RETENTION_DAYS=1 # Change this to your desired retention period in days # Namespace where the pods are located NAMESPACE="app5-ns" # Change this to your actual namespace #...

Table Indexing

PostgreSQL Tips

1. What is Indexing? An index is a data structure that allows the database to find and retrieve specific rows much faster than scanning the entire table. Think of it like the index in a book, which helps you quickly locate a topic without reading every page. 2...