Advanced Search
Search Results
102 total results found
Running SAM in Local Computer
SAM stands for Serverless Application Model. Run this following command : sam local invoke
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
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
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
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
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
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
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
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
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
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
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
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
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
#!/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
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
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
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
#!/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
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...