Thursday, 29 August 2024

Use domain instead of IP for Prestashop

Fixed mine at least, with a little help I found that if you scroll far enough down on the SEO & URL's Page within the Backend>Preferences Section there is a URL's bit where you can punch in the domain name you want to use instead of the IP Address.

Install docker-compose on RHEL 9

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o docker-compose
sudo mv docker-compose /usr/local/bin && sudo chmod +x /usr/local/bin/docker-compose
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

Install Docker on RHEL9.4

Source:https://gopesh3652.medium.com/installing-docker-in-rhel-9-locally-by-configuring-yum-42bdfea103f0 Introduction Docker is a popular containerization platform that simplifies the process of building, distributing, and running applications inside containers. Red Hat Enterprise Linux (RHEL) 9 is a stable and reliable operating system widely used in production environments. In this guide, we’ll walk you through the step-by-step process of installing Docker on RHEL 9 by configuring the YUM package manager. Prerequisites Before proceeding with the installation, ensure you have the following: A machine running Red Hat Enterprise Linux 9. Administrative access to the system. An active internet connection. Step 1: Update the System The first step is to ensure your system is up-to-date. Open a terminal and execute the following command: sudo yum update Step 2: Add Docker Repository to YUM To install Docker on RHEL 9, you’ll need to add the Docker repository to the YUM configuration. Create a new file named “docker.repo” in the “/etc/yum.repos.d/” directory using a text editor like vi or nano: sudo vi /etc/yum.repos.d/docker.repo Add the following lines to the file: [docker-ce-stable] name=Docker CE Stable - $basearch baseurl=https://download.docker.com/linux/rhel/9/$basearch/stable enabled=1 gpgcheck=1 gpgkey=https://download.docker.com/linux/rhel/gpg Save the file and exit the text editor. Step 3: Install Docker Now that you’ve added the Docker repository, you can install Docker using the YUM package manager: sudo yum install docker-ce --nobest Step 4: Start and Enable Docker After the installation is complete, start the Docker service and enable it to start on boot: sudo systemctl start docker sudo systemctl enable docker Step 5: Verify Docker Installation To verify that Docker is installed correctly, run the following command: docker --version This command will display the installed Docker version, confirming that the installation was successful. Step 6: Test Docker with a Simple Container To ensure Docker is functioning properly, test it with a simple container: sudo docker run hello-world Docker will download the “hello-world” image and run a container from it. If everything is set up correctly, you’ll see a message indicating a successful installation Remember that Docker requires root privileges to run, so use the “sudo” command when interacting with Docker unless you’ve granted your user non-root access to Docker.

RHEL 9.4 goes to emergency mode

This was my life saver: https://kb.synology.com/en-me/DSM/tutorial/My_virtual_machine_running_RHEL_9_enters_emergency_mode Diagnosis In RHEL 9.0, the use_devicesfile option in Logical Volume Manager (LVM) is enabled by default, checking whether the Physical Volume Identifier (PVID) of the LVM volume is identical to the last time the virtual machine was running. When it is not identical, the virtual machine may enter emergency mode. However, the following operations will result in different PVIDs: Change the virtual disk controller from VirtIO SCSI to IDE or SATA. Clone a virtual machine with VirtIO SCSI controller. Import a virtual machine with VirtIO SCSI controller which was exported previously. Therefore, after the operations above, your virtual machine may enter emergency mode. Resolution Recover the virtual machine from the emergency mode In emergency mode, enter the root password of the virtual machine. Enter the command below to delete the original device file. [root@localhost ~]# rm /etc/lvm/devices/system.devices Enter the command below to create a new device file. [root@localhost ~]# vgimportdevices -a Enter the command below to reboot the virtual machine. [root@localhost ~]# reboot Prevent the virtual machine from entering emergency mode Open the configuration file /etc/lvm/lvm.conf. Locate the use_devicesfile option. # use_devicesfile = 0 Uncomment the option and make sure it is set to 0. use_devicesfile = 0

Wednesday, 28 August 2024

How to setup Telegram BOT for notifications

Assume the bot name is my_bot. 1- Add the bot to the group. Go to the group, click on group name, click on Add members, in the searchbox search for your bot like this: @my_bot, select your bot and click add. 2- Send a dummy message to the bot. You can use this example: /my_id @my_bot (I tried a few messages, not all the messages work. The example above works fine. Maybe the message should start with /) 3- Go to following url: https://api.telegram.org/botXXX:YYYY/getUpdates replace XXX:YYYY with your bot token 4- Look for "chat":{"id":-zzzzzzzzzz, -zzzzzzzzzz is your chat id (with the negative sign). 5- Testing: You can test sending a message to the group with a curl: curl -X POST "https://api.telegram.org/botXXX:YYYY/sendMessage" -d "chat_id=-zzzzzzzzzz&text=my sample text" If you miss step 2, there would be no update for the group you are looking for. Also if there are multiple groups, you can look for the group name in the response ("title":"group_name").



You can get a token from https://t.me/BotFather. In order to get the group chat id, do as follows: Add the Telegram BOT to the group. Get the list of updates for your BOT: https://api.telegram.org/bot/getUpdates Ex: https://api.telegram.org/bot123456789:jbd78sadvbdy63d37gda37bd8/getUpdates Look for the "chat" object: { "update_id": 8393, "message": { "message_id": 3, "from": { "id": 7474, "first_name": "AAA" }, "chat": { "id": , "title": "" }, "date": 25497, "new_chat_participant": { "id": 71, "first_name": "NAME", "username": "YOUR_BOT_NAME" } } } This is a sample of the response when you add your BOT into a group. Use the "id" of the "chat" object to send your messages. (If you created the new group with the bot and you only get {"ok":true,"result":[]}, remove and add the bot again to the group) Private chart only works in image argoprojlabs/argocd-notifications:v1.1.0 or above.

How to install Dockers and UptimeKuma on Debian

Follow this for the docker: https://gcore.com/learning/how-to-install-docker-engine-debian/ And just the UptimeKuma section: https://xtom.com/blog/how-to-setup-uptime-kuma/

Tuesday, 27 August 2024

ssh keys with redhat

How to use ssh keys with putty and Red Hat Enterprise Linux ? Solution Verified - Updated August 6 2024 at 5:40 AM - English Environment Red Hat Enterprise Linux (RHEL) 6.3 Issue SSH Keys generated by Putty do not work with openssh in Red Hat Enterprise Linux Resolution To make it working convert the keys generated by Open-ssh to putty's format: First generate keys on RHEL: Raw # ssh-keygen -t rsa Then put public key into authorized_keys file: Raw # cat public_key >> ~/.ssh/authorized_keys Set proper permissions: Raw # chmod 700 ~/.ssh # chmod 600 ~/.ssh/authorized_keys Copy (for example with Winscp) private key into Windows machine. Start the program called "puttygen", select "conversion" --> "Import keys" --> "your_private_key". Save it somewhere in putty format. Note: In order to use the converted key please create new putty session and fill the following fields: "auto-login username" (username you wish to use as login) . "connection" --> "ssh" --> "auth" --> "browse" (here please point to your newly generated putty key)--> "session" --> "save". Root Cause

Sunday, 25 August 2024

Cannot access services through WAN IP from internal network

See this post: https://forum.netgate.com/topic/114507/cannot-access-services-through-wan-ip-from-internal-network/8 Basically need to turn on NAT Reflection on PFSENSE. In the NAT Rule, "NAT reflection" set to: "Enable (NAT+Proxy)" If you put Pure NAT, local LAN will (same IP segment) will not be able to access.

Wednesday, 7 August 2024

Generate AWS Key for ACME Cert

Use CLI command shell option

https://www.youtube.com/watch?v=cB6oKJjr4Ls

Tuesday, 6 August 2024

Wordpress Dockers on TrueNAS

If you used hostPath, you should make sure the user and group id 33 have r/w access to the host paths you defined. (www-data) https://github.com/truenas/charts/issues/2665

HAProxy with SSL

See this post:https://www.reddit.com/r/selfhosted/comments/16sq2fa/anyone_get_firefly3_to_work_behind_pfsense_haproxy/ This probably isn't the most helpful, but I was successfully able to get Firefly 3 working behind the reverse proxy caddy. I didn't have to rewrite any headers. I only had to set TRUSTED_PROXIES=** as you said you did. (for firefly) Solved. I was able to find a solution in this article: https://discourse.haproxy.org/t/mixed-content-warning-when-using-https/981/9 Specifically, I added "http-response set-header Content-Security-Policy upgrade-insecure-requests" to the "backend pass thru" section for the HAProxy backend server. I believe, if I understand this correctly, it forces HAProxy to scan all page content and replace insecure link references that the page may contain