Author: Gareth Eaton
Enable /etc/rc.local with Systemd
If you are running a Linux distro that uses Systemd, then you may find that your command in /etc/rc.local file would not run at system boot time. This guide explains how to enable /etc/rc.local script to run on system startup.
As root user
- systemctl status rc-local
if it says – Active: inactive (dead)
then you need to enable
- systemctl enable rc-local
if you get – The unit files have no installation config
The unit file have no Install section. As such Systemd can not enable it. First we need to create a file:
- nano /etc/systemd/system/rc-local.service
Add the following
[Unit] Description=/etc/rc.local Compatibility ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target
To exit the file, Press Ctrl+X.
- chmod +x /etc/rc.local
Make a rc-local file
- printf ‘%s\n’ ‘#!/bin/bash’ ‘exit 0’ | tee -a /etc/rc.local
add execute permission to /etc/rc.local file.
- chmod +x /etc/rc.local
enable the service on system boot:
- systemctl enable rc-local
Output should be – Created symlink /etc/systemd/system/multi-user.target.wants/rc-local.service -> /etc/systemd/system/rc-local.service.
Start the service and check its status
- systemctl start rc-local.service
- systemctl status rc-local.service
The output should be – Active: active (exited) since Fri 2022-07-15 15:57:31 UTC; 7s ago
Now you can – nano /etc/rc.local – edit as needed
Build your own PRIVATE search engine – Using SearXNG
Setup a server running Ubuntu 20.04 or Debian 11
We was using Debian 11 in a Container hosted in Proxmox
Login as root and update.
- apt install && sudo apt upgrade -y
Install Docker
- curl -fsSL https://get.docker.com -o get-docker.sh
- sudo sh get-docker.sh
Install docker-compose
- apt install docker-compose -y
Now we can move to the directory where we want to install Searx and using git
NOTE: if you don’t have git installed install it – apt install git
- cd /usr/local
- git clone https://github.com/searxng/searxng-docker.git
Verify that it copied correctly in to your current directory
- ls
Now change in to the new directory
- cd searxng-docker
adjust the content of the .env file
- nano .env
Add you host name to SEARXING_HOSTNAME= your_host_name_here
If you want to use a SSL remove the # on the LETSENCRYPT= <email> and add you email address
exit the file using Ctrl+X hit “Y” and then “Enter”
Run this command to generate a key
sed -i “s|ultrasecretkey|$(openssl rand -hex 32) |g” searxng/settings.yml
Now to start SearX run this command
sudo docker-compose up -d
If you want to auto restart your on a reboot you will need to edit the docker-compose.yaml file
- nano docker-compose.yaml
add restart: always after the followsing
environment:
– SEARXNG_HOSTNAME=${SEARXNG_HOSTNAME:-http://localhost:80}
– SEARXNG_TLS=${LETSENCRYPT_EMAIL:-internal}
…….
tmpfs:
– /var/lib/redis
……..
environment:
– SEARXNG_BASE_URL=https://${SEARXNG_HOSTNAME:-localhost}/
now restart SearX
- sudo docker-compose up -d
OBS to ZOOM
Install web-server on Ubuntu 20.04 server
Installing Ubuntu 20.04 server on VirtualBox
Certbot Commands
List All Certificats
- certbot certificates
Delete a Certbot SSL Certificate
- certbot delete –apache -d
This command will offer an index from which you can select the domain name
- sudo certbot delete
- To delete a Certbot certificate by including the domain name in the command like this:
- certbot delete –cert-name example.com
Issue or Renew an SSL certificate
The –force-renewal, –duplicate, and –expand options control Certbot’s behavior when re-creating a certificate with the same name as an existing certificate. If you don’t specify a requested behavior, Certbot may ask you what you intended.
–force-renewal tells Certbot to request a new certificate with the same domains as an existing certificate. Each domain must be explicitly specified via -d. If successful, this certificate is saved alongside the earlier one and symbolic links (the “live” reference) will be updated to point to the new certificate. This is a valid method of renewing a specific individual certificate.
–duplicate tells Certbot to create a separate, unrelated certificate with the same domains as an existing certificate. This certificate is saved completely separately from the prior one. Most users will not need to issue this command in normal circumstances.
–expand tells Certbot to update an existing certificate with a new certificate that contains all of the old domains and one or more additional new domains. With the –expand option, use the -d option to specify all existing domains and one or more new domains.
- certbot –expand -d existing.com,example.com,newdomain.com
- certbot –apache -d example.com
Revoking certificates
If your account key has been compromised or you otherwise need to revoke a certificate, use the revoke command to do so. Note that the revoke command takes the certificate path (ending in cert.pem), not a certificate name or domain.
- certbot revoke –cert-path /etc/letsencrypt/live/CERTNAME/cert.pem
You can also specify the reason for revoking your certificate by using the reason flag. Reasons include unspecified which is the default, as well as keycompromise, affiliationchanged, superseded, and cessationofoperation:
- ertbot revoke –cert-path /etc/letsencrypt/live/CERTNAME/cert.pem –reason keycompromise
Additionally, if a certificate is a test certificate obtained via the –staging or –test-cert flag, that flag must be passed to the revoke subcommand. Once a certificate is revoked (or for other certificate management tasks), all of a certificate’s relevant files can be removed from the system with the delete subcommand.
Note
If you don’t use delete
to remove the certificate completely, it will be renewed automatically at the next renewal event.