PHP: GeSHi Syntax Highlighter Enable / Disable Line Numbers

To enable or disable line numbers in GeSHi Syntax Highlighter, you can use the line_numbers property in the GeSHi object. Here’s an example of how to enable line numbers in PHP: <?php include ‘geshi.php’; $source = <<<‘CODE’ // Your code here CODE; $geshi = new GeSHi($source, ‘php’); $geshi->set_header_type(GESHI_HEADER_PRE_VALID); $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); echo $geshi->parse_code(); ?> And here’s an … Read more

RHEL / Centos Linux Disable Firewall Command

To disable the firewall in Red Hat Enterprise Linux (RHEL) or CentOS, you can use the systemctl command. Here’s the basic syntax: systemctl disable firewalld This will disable the firewall service, so it won’t start when the system reboots. If you also want to stop the firewall service immediately, you can run the following command: … Read more

Nginx proxy_redirect: Change response-header Location and Refresh in the response of the server

In Nginx, you can use the proxy_redirect directive to change the Location and Refresh headers in the response from a server. Here is an example configuration: server { listen 80; server_name example.com; location / { proxy_pass http://backend_server; proxy_redirect default; proxy_redirect https://backend_server https://example.com; } } In this example, the proxy_redirect default; directive sets the default behavior … Read more