This script automates the installation of CloudPanel on a fresh Ubuntu 22.04 VPS. It configures system basics, security (UFW + Fail2Ban), and installs CloudPanel in minutes.
Once installed, access the CloudPanel admin panel via:
This script automates the installation of CloudPanel on a fresh Ubuntu 22.04 VPS. It configures system basics, security (UFW + Fail2Ban), and installs CloudPanel in minutes.
Once installed, access the CloudPanel admin panel via:
| version: "3.4" | |
| services: | |
| deluge: | |
| container_name: deluge | |
| image: linuxserver/deluge:latest | |
| restart: unless-stopped | |
| environment: | |
| - PUID=${PUID} # default user id, defined in .env | |
| - PGID=${PGID} # default group id, defined in .env | |
| - TZ=${TZ} # timezone, defined in .env |
| #!/bin/bash | |
| # Wait for LAN to be available | |
| while ! ping -c 1 192.168.0.1 >/dev/null; do | |
| sleep 1 | |
| done | |
| # Change directory | |
| cd Desktop/docker_radarr/ |
| function validateNif(nif){ | |
| // validation reference: | |
| // http://pt.wikipedia.org/wiki/N%C3%BAmero_de_identifica%C3%A7%C3%A3o_fiscal | |
| var error=0; | |
| if ( | |
| nif.substr(0,1) != '1' && // pessoa singular | |
| nif.substr(0,1) != '2' && // pessoa singular | |
| nif.substr(0,1) != '3' && // pessoa singular | |
| nif.substr(0,2) != '45' && // pessoa singular não residente |
| function formatBytes(bytes) { | |
| var marker = 1024; // Change to 1000 if required | |
| var decimal = 3; // Change as required | |
| var kiloBytes = marker; // One Kilobyte is 1024 bytes | |
| var megaBytes = marker * marker; // One MB is 1024 KB | |
| var gigaBytes = marker * marker * marker; // One GB is 1024 MB | |
| var teraBytes = marker * marker * marker * marker; // One TB is 1024 GB | |
| // return bytes if less than a KB | |
| if(bytes < kiloBytes) return bytes + " Bytes"; |
| /* | |
| * sanitize HTML with jQuery based on whitelist | |
| * example: | |
| * sanitizer.sanitize('<a href="foo" class="bar">aaa</a><script>alert("...")</script>', {'a': ['href'], 'strong': []}) | |
| * returns '<a href="foo">aaa</a>' | |
| */ | |
| var sanitizer = {}; | |
| (function($) { | |
| function trimAttributes(node, allowedAttrs) { |
| public class PropertiesToConstantsGenerator { | |
| public static void main(String[] args) throws IOException { | |
| Properties properties = new Properties(); | |
| InputStream inputStream =PropertiesToInterfaceGenerator.class.getClassLoader().getResourceAsStream("saf_en.properties"); | |
| if(null != inputStream ){ | |
| properties.load(inputStream); | |
| } | |
| generate(properties); | |
| } |
| String nome= userDao.getNomeCompleto(2L); | |
| String nomeFiltered=""; | |
| for (int i=0;i<str.length();i++) { | |
| //only allows letters from ASCII value | |
| if (str.charAt(i)>64 && str.charAt(i)<=122) { | |
| nomeFiltered=nomeFiltered+str.charAt(i); | |
| } | |
| } |
| // validação email com mais segurança | |
| $.validator.addMethod("completeemail", | |
| function(value, element) { | |
| return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(value); | |
| }, | |
| "O endereço e-mail não é válido" | |
| ); |
| #!/bin/bash | |
| # | |
| # matrix: matrix-ish display for Bash terminal | |
| # Author: Brett Terpstra 2012 <http://brettterpstra.com> | |
| # Contributors: Lauri Ranta and Carl <http://blog.carlsensei.com/> | |
| # | |
| # A morning project. Could have been better, but I'm learning when to stop. | |
| ### Customization: | |
| blue="\033[0;34m" |