WordPress Change Preview Post Link Button URL Via preview_post_link Filter

The preview_post_link filter in WordPress can be used to change the URL of the Preview Post button on the post editor screen. You can use the following code to change the URL of the Preview Post button:   function custom_preview_post_link( $preview_link, $post ) { $preview_link = home_url( ‘/my-custom-preview-url/?p=’ . $post->ID ); return $preview_link; } add_filter( … Read more

Linux / Unix rsync: Delete Source File After Transfer

To delete the source file after a successful transfer using rsync, you can use the –remove-source-files option. For example:   rsync –remove-source-files source_file destination This will transfer the file source_file to the destination and remove it from the source location after the transfer is complete. Note that the –remove-source-files option is only applied if the … Read more

How to install htop on OpenBSD

To install htop on OpenBSD, you can use the pkg_add command, which is the package manager for OpenBSD. First, make sure your package list is up-to-date by running the following command:   sudo pkg_add -u Next, you can install htop by running the following command:   sudo pkg_add htop This will download and install the … Read more

Default robots.txt File For Web-Server

A robots.txt file is a file used by web servers to communicate with web robots (also known as “bots” or “crawlers”) about which pages or sections of a website should or should not be crawled and indexed. The default content of a robots.txt file can vary depending on the web server and the specific configuration, … Read more

Unix Command To Change Password

In Unix and Linux systems, the passwd command is used to change a user’s password. The basic syntax is as follows:   passwd [options] [username] If you’re changing your own password, you can simply run the command without specifying a username:   passwd The system will prompt you for your current password and then for … Read more