Linux / Unix: curl Command Pass Host Headers

The curl command can pass custom host headers using the -H option. For example, to pass a custom host header: curl -H “Host: customhost.com” https://example.com This is useful when testing or accessing websites that have multiple domain names pointing to the same IP address. The host header allows the server to determine which domain name … Read more

Linux View Process Address Space

You can view the address space of a process in Linux using the pmap command. pmap is a tool that shows the memory usage of each process and its shared libraries, mapping information and the stack. Here’s an example of how to use pmap: # pmap PID Replace PID with the process ID of the … Read more

Go Language for Loop Examples

Go provides several ways to perform looping, including the for loop. Here are some examples of using the for loop in Go: Classic for loop: for i := 0; i < 10; i++ { fmt.Println(i) } This loop will start from 0, continue until i is less than 10, and increment i by 1 on … Read more

WordPress Add Shortcodes To Excerpts

By default, WordPress does not allow shortcodes to be executed in excerpts. To enable shortcodes in WordPress excerpts, you need to add the following code to your theme’s functions.php file: add_filter(‘the_excerpt’, ‘do_shortcode’); This code adds a filter to the the_excerpt function, which runs the do_shortcode function on the excerpt before it is displayed. The do_shortcode … Read more

4 Linux Commands To View Page Faults Statistics

Here are four Linux commands to view page fault statistics: vmstat – This is a versatile command that provides information on system resource utilization, including page faults. The vmstat command reports the number of page faults in the “faults” column. vmstat procs ———–memory———- —swap– —–io—- -system– ——cpu—– r b swpd free buff cache si so … Read more