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

Linux / Unix curl Command Download File Example

The curl command is a powerful tool for transferring data from or to a server over various protocols, including HTTP, HTTPS, FTP, and many others. To download a file from a remote server using curl, you can use the following syntax: curl [options] [URL] -o [filename] For example, to download a file named example.txt from … Read more

Cinelerra: MWindow::init_shm: /proc/sys/kernel/shmmax is 0x1000000 It should be at least 0x7ffffff

The error message “Cinelerra: MWindow::init_shm: /proc/sys/kernel/shmmax is 0x1000000 It should be at least 0x7ffffff” is related to the shared memory setting on your Linux system. Cinelerra, a video editing software, uses shared memory for inter-process communication and the error message indicates that the shared memory limit on your system is not sufficient for the software … Read more

FreeBSD Display Laptop Battery Charge Status

To display the laptop battery charge status on a FreeBSD system, you can use the acpiconf command. The acpiconf command is part of the acpi package, which provides information about the battery, AC adapter, and thermal status of a laptop. Here’s how to display the laptop battery charge status on a FreeBSD system: Install the … Read more