Posts

Custom Domain to GitHub Pages (Hostinger Edition)

Image
Go to your Hostinger domain DNS settings The first step is to go to your Hostinger domain DNS settings. You can do this by visiting  https://hpanel.hostinger.com/domain/yourdomain.com/dns . Create two new CNAME records We need to create two new CNAME records. The first record will point  www.yourdomain.com  to  <your-github-username>.github.io . The second record will point  yourdomain.com  to  <your-github-username>.github.io . Enter Type - CNAME, Name - www, Points to - .github.io, TTL you can leave as default. This is for when someone types  www.yourdomain.com . Then we need the same for APEX domains or when someone just types  yourdomain.com , for this enter another CNAME with Name - @ and Points to .github.io. This will automatically set an ALIAS type and add it to the DNS records.  Add the GitHub Pages IP addresses Finally, we need to add the IP addresses and the txt value(this is obtain in the github/gitlab itself) for...

Resizing partition in AWS

  First lsblk If Using a Standard Partition (No LVM) Resize the partition: sudo growpart /dev/nvme0n1 1 Resize the filesystem: sudo resize2fs /dev/nvme0n1p1 # For ext4 sudo xfs_growfs /dev/nvme0n1p1 # For XFS Step 4: Verify the New Storage df -h You should now see the increased disk space. 🚀

Gitlab docker commands

Image
 sudo docker exec -it <container_id> bash Check for all GitLab services running in gitlab gitlab-ctl status  To stop any GitLab services gitlab-ctl stop prometheus To start any GitLab services gitlab-ctl startprometheus When Sidekiq Is Stopped: Email Notifications Won't Be Sent : Since Sidekiq is responsible for handling background tasks like email delivery, if you stop Sidekiq, the forgot password email won't be sent to the user. The request for a password reset will still be processed, but the system will not be able to send the email due to Sidekiq being down. Other Email-Related Features : Any other features that rely on email notifications (like user invitations, confirmation emails, or CI/CD notifications) will also be affected. To check whether GitLab is enforcing authentication (which could be affecting the ELB health check), run the following inside the GitLab Rails console (command: gitlab-rails console): ApplicationSetting .first.password_authentication...

Mbda portal config error

 ubuntu@ip-10-0-11-34:/var/www/html/laravel/mbda-data-portal$ ls -ld /var/www/html/laravel/mbda-data-portal/storage/framework/sessions drwxr-xr-x 2 ubuntu www-data 4096 Nov  3 12:07 /var/www/html/laravel/mbda-data-portal/storage/framework/sessions ubuntu@ip-10-0-11-34:/var/www/html/laravel/mbda-data-portal$ sudo chmod -R 775 /var/www/html/laravel/mbda-data-portal/storage /var/www/html/laravel/mbda-data-portal/bootstrap/cache ubuntu@ip-10-0-11-34:/var/www/html/laravel/mbda-data-portal$ sudo chown -R www-data:www-data /var/www/html/laravel/mbda-data-portal/storage /var/www/html/laravel/mbda-data-portal/bootstrap/cache ubuntu@ip-10-0-11-34:/var/www/html/laravel/mbda-data-portal$ php artisan cache:clear php artisan config:clear php artisan route:clear php artisan view:clear ubuntu@ip-10-0-11-34:/var/www/html/laravel/mbda-data-portal$ php artisan route:cache    INFO  Routes cached successfully.   ubuntu@ip-10-0-11-34:/var/www/html/laravel/mbda-data-portal$ ...

Gitlab Docker troubleshoot

some other command top, htop  Limit Docker Container Resources Since GitLab is using almost 60% of available memory, you can consider further limiting memory allocation to prevent it from using too much. You could set a hard limit slightly below 7.745 GiB: bash Copy code docker update --memory=6g --memory-swap=6g gitlab-web-1 top -o %MEM sudo docker stats gitlab-web-1 Sync the file system to ensure all data is written to disk (optional but recommended before clearing cache): bash Copy code sudo sync Clear PageCache only: bash Copy code sudo sysctl -w vm.drop_caches=1

BACKUP AND RESTORE DATA PORTAL DATABASE MYSQL

Backup the SQL file docker exec -i 41e9179d4edc mysqldump -u mbda_data_user -p mbda_data_portal > mbda_data_portal_backup.sql Copy the SQL file into the Container (if not already inside) docker cp /path/to/mbda_data_portal.sql <container_name_or_id>:/tmp/mbda_data_portal.sql This will copy the SQL file to the /tmp directory inside the container. Import the SQL File into MariaDB Once the file is in the container, you can import it by executing a mysql command inside the running container. Steps: Access the Docker container shell :             docker exec -it <container_name_or_id> /bin/bash Run the MySQL command to import the SQL file : Inside the container, run the following command to import the SQL file into the desired database: root@fc78ab3e56fc:/# mysql -u mbda_data_user -p mbda_data_portal < /mbda_data_portal_backup.sql How to get inside the databases docker exec -it mbda-data-portal-mbda_dataportal_database-1 mysql -u mbda_...

Data Portal backup and restore

  Create a Container to Access the Volume You can create a temporary container to mount the volume and back it up. docker run --rm -v mbda-data-portal_mbda_dataportal_database_data:/volume -v $(pwd):/backup busybox tar cvf /backup/volume_backup.tar /volume Restore the Backup To restore this backup to a volume, you can run the following command: docker run --rm -v mbda-data-portal_mbda_dataportal_database_data:/volume -v $(pwd):/backup busybox tar xvf /backup/volume_backup.tar -C /