- Create the file in /etc/cron.weekly/certbot-renewal using the following command
sudo vi /etc/cron.weekly/certbot-renewal
- Place in the following in the file and save it:
#!/bin/sh /usr/sbin/certbot-auto renew --no-bootstrap --no-self-upgrade --post-hook "service nginx restart"
- Change the mode of file to 755 using the following command:
sudo chmod 755 /etc/cron.weekly/certbot-renewal
Page 24 of 33
- Change the directory to /usr/sbin
- Download certbot-auto using the following command:
sudo wget https://dl.eff.org/certbot-auto -O /usr/sbin/certbot-auto
- Change the mode of certbot-auto to 755 using the following command:
sudo chmod 755 /usb/sbin/certbot-auto
Use the following command:
sudo fail2ban-client set <JAIL_NAME> unbanip <IP_ADDRESS>
Where:
JAIL_NAME | The name of the jail.
Use the following command to find-out what jail names you have: sudo fail2ban-client status |
IP_ADDRESS | The IP address that was banned. |
- Update the /etc/ssh/sshd_config file to have the following added:
PermitRootLogin no
- Install fail2ban using the following command:
sudo apt-get install fail2ban
- Create the file /etc/fail2ban/jail.d/jail-debian.local file to have the following:
[sshd] enabled = true port = ssh filter = sshd logpath = /var/log/auth.log maxretry = 6 bantime = -1
- Restart the service using the following command:
sudo service fail2ban restart
See Unbanning an IP
Reading a text file using java.util.Scanner in Java.
StringBuilder text = new StringBuilder(); try(Scanner scanner = new Scanner(new BufferedReader(new FileReader("<FILENAME>")))) { while(scanner.hasNext()) { text.append(scanner.nextLine()).append("\n"); } } catch (FileNotFoundException e) { e.printStackTrace(); } System.out.println(text.toString());
Where:
FILENAME | The text file to read. |
Isolate logic using functional interface and execute it with Funxion utility class which can be found from the following link:
Use the template found in the following link:
https://github.com/rcw3bb/azure-application-insight-custom-telemetry
Login to azure using the following command:
az login
Show the currently signed in account using the following command:
az account show
Logout to azure using the following command:
az logout
Use the following command to deploy a(some) locally developed function(s) to azure function app.
func azure functionapp publish <AZURE_FUNCTION_APP>
Note: This command will only work if your terminal session was signed in to azure. The login using the command found here.
Where:
AZURE_FUNCTION_APP | The name of the function app found in azure portal. |
Execute the following command to set the proxy for HTTP:
npm config set proxy <HOST>:<PORT>
Execute the following command to set the proxy for HTTPS:
npm config set https-proxy <HOST>:<PORT>
Where:
HOST | The host that is running the proxy server |
PORT | The port the proxy server is listening. |
Recent Comments