Generated by Rank Math SEO, this is an llms.txt file designed to help LLMs better understand and index this website. # Senormedia: Web, Graphic, Apps and Linux Tutorials ## Sitemaps [XML Sitemap](https://senormedia.com/sitemap_index.xml): Includes all crawlable and indexable pages. ## Posts - [Add SenorMedia Backup to Kodi](https://senormedia.com/add-senormedia-backup-to-kodi/): Go To Settings - [Replace image src with php dom](https://senormedia.com/replace-image-src-with-php-dom/): $dom = new DOMDocument(); $dom->loadHTML($data); $images = $dom->getElementsByTagName('img'); foreach ($images as $image) { $old_src = $image->getAttribute('src'); $new_src = 'image/products/newimage.jpg'; $image->setAttribute('src', $new_src); $image->setAttribute('data-src', $old_src); } $data = $dom->saveHTML(); - [Add php 8 to ispconfig](https://senormedia.com/add-php-8-to-ispconfig/): if you dont have any additional php versions on your ispconfig follow this tutorial first. https://www.howtoforge.com/tutorial/how-to-install-php-7-for-ispconfig-3-from-debian-packages-on-debian-8-and-9/ - [Securing your ISPConfig 3 managed mailserver with a valid Let’s Encrypt SSL certificate (certbot)](https://senormedia.com/securing-your-ispconfig-3-managed-mailserver-with-a-valid-lets-encrypt-ssl-certificate-certbot/): You can normally just name your server something nice in the beginning of the install but i recommend to proceed this route as works better once you start scaling your servers and add multiple email servers. - [Access Ionic App App from Virtual Box Server Using Nat Adapter and Bridge](https://senormedia.com/access-ionic-app-app-from-virtual-box-server-using-nat-adapter-and-bridge/): replace 0.0.0.0 with your ip and the port number as well - [Apache Reverse Proxy for Docker Website or App in Ispconfig](https://senormedia.com/apache-reverse-proxy-for-docker-website-or-app-in-ispconfig/): Create a domain in ispconfig how your normally would with ssl - [Install LAMP (Linux Apache Mysql PHP) Web Server on Raspberry Pi](https://senormedia.com/install-lamp-linux-apache-mysql-php-web-server-on-raspberry-pi/): Go to your host name or ip for example mine is http://quepaso and apache - [Install skype manjaro or arch linux](https://senormedia.com/install-skype-manjaro-or-arch-linux/): cd ~/Downloads git clone https://aur.archlinux.org/skypeforlinux-stable-bin cd skypeforlinux-stable-bin makepkg -si - [Install slack manjaro or arch linux](https://senormedia.com/install-slack-manjaro-or-arch-linux/): cd ~/Downloads git clone https://aur.archlinux.org/slack-desktop.git cd slack-desktop makepkg -si - [Set Manjaro Time](https://senormedia.com/set-manjaro-time/): Step 1: Install NTP sudo pacman -S ntp Step 2: Turn on NTP sudo timedatectl set-ntp true - [WordPress Transfer MySql Queries](https://senormedia.com/wordpress-transfer-mysql-queries/): UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); Command Line mysql -u root -p databasename mysql> UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; mysql> UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); mysql> UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); mysql> UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); - [Deactivate all plugins mysql or wp cli](https://senormedia.com/deactivate-all-plugins-mysql-or-wp-cli/): For Cli - [Install Node and Npm Debian Buster 10 Ispconfig Jailkit](https://senormedia.com/install-node-and-npm-debian-buster-10-ispconfig-jailkit/): For Latest Release - [Drupal 8 Ispconfig Nginx directives](https://senormedia.com/drupal-8-ispconfig-nginx-directives/): location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ { deny all; } location / { try_files $uri $uri/ /index.php?$args; } location ~* \.(jpg|jpeg|png|gif|css|js|ico)$ { expires max; log_not_found off; } - [Convert Virtual Box OS to Virtual Machine Manager](https://senormedia.com/convert-virtual-box-os-to-virtual-machine-manager/): Go to the location of your vdi and convert it. Do not export your appliance - [Nextcloud ISPConfig3 Debian Buster Nginx](https://senormedia.com/nextcloud-ispconfig3-debian-buster-nginx/): In the PHP directives in ISPConfig3 upload_max_filesize=20g post_max_size=20g always_populate_raw_post_data=-1 max_execution_time = 3600 In ISPConfig3, insert the following in the nginx directives # Add headers to serve security related headers # Before enabling Strict-Transport-Security headers please read into this # topic first. #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; # # WARNING: Only add the preload option once you read about # the consequences in https://hstspreload.org/. This option # will add the domain to a hardcoded list that is shipped # in all major browsers and getting removed from this list # could take several months. add_header Referrer-Policy "no-referrer" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Download-Options "noopen" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Permitted-Cross-Domain-Policies "none" always; add_header X-Robots-Tag "none" always; add_header X-XSS-Protection "1; mode=block" always; # Remove X-Powered-By, which is an information leak fastcgi_hide_header X-Powered-By; # Path to the root of your installation root {DOCROOT}; location = /robots.txt { allow all; log_not_found off; access_log off; } # The following 2 rules are only needed for the user_webfinger app. # Uncomment it if you're planning to use this app. #rewrite ^/.well-known/host-meta /public.php?service=host-meta last; #rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last; # The following rule is only needed for the Social app. # Uncomment it if you're planning to use this app. #rewrite ^/.well-known/webfinger /public.php?service=webfinger last; location = /.well-known/carddav { return 301 $scheme://$host:$server_port/remote.php/dav; } location = /.well-known/caldav { return 301 $scheme://$host:$server_port/remote.php/dav; } # set max upload size client_max_body_size 20G; fastcgi_buffers 64 4K; # Enable gzip but do not remove ETag headers gzip on; gzip_vary on; gzip_comp_level 4; gzip_min_length 256; gzip_proxied expired no-cache no-store private no_last_modified no_etag auth; gzip_types application/atom+xml application/javascript application/json application/ld+json application/manifest+json application/rss+xml application/vnd.geo+json application/vnd.ms-fontobject application/x-font-ttf application/x-web-app-manifest+json application/xhtml+xml application/xml font/opentype image/bmp image/svg+xml image/x-icon text/cache-manifest text/css text/plain text/vcard text/vnd.rim.location.xloc text/vtt text/x-component text/x-cross-domain-policy; # Uncomment if your server is build with the ngx_pagespeed module # This module is currently not supported. #pagespeed off; location / { rewrite ^ /index.php; } #location ~ ^\/(?:build|tests|config|lib|3rdparty|templates|data)\/ { location ~ ^\/(?:build|tests|config|lib|3rdparty|templates)\/ { deny all; } location ~ ^\/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v|updater\/.+|oc-provider\/.+|.+\/richdocumentscode\/proxy)\.php(?:$|\/) { fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; fastcgi_param HTTPS on; # Avoid sending the security headers twice fastcgi_param modHeadersAvailable true; # Enable pretty urls fastcgi_param front_controller_active true; fastcgi_pass php-handler; fastcgi_intercept_errors on; fastcgi_request_buffering off; } location ~ ^\/(?:updater|oc-provider)(?:$|\/) { try_files $uri/ =404; index index.php; } # Adding the cache control header for js, css and map files # Make sure it is BELOW the PHP block location ~ \.(?:css|js|woff2?|svg|gif|map)$ { try_files $uri /index.php$request_uri; add_header Cache-Control "public, max-age=15778463"; # Add headers to serve security related headers (It is intended to # have those duplicated to the ones above) # Before enabling Strict-Transport-Security headers please read into # this topic first. #add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;" always; # # WARNING: Only add the preload option once you read about # the consequences in https://hstspreload.org/. This option # will add the domain to a hardcoded list that is shipped # in all major browsers and getting removed from this list # could take several months. add_header Referrer-Policy "no-referrer" always; add_header X-Content-Type-Options "nosniff" always; add_header X-Download-Options "noopen" always; add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Permitted-Cross-Domain-Policies "none" always; add_header X-Robots-Tag "none" always; add_header X-XSS-Protection "1; mode=block" always; # Optional: Don't log access to assets access_log off; } location ~ \.(?:png|html|ttf|ico|jpg|jpeg|bcmap|mp4|webm)$ { try_files $uri /index.php$request_uri; # Optional: Don't log access to other assets access_log off; } - [Configure WordPress phpmailer settings](https://senormedia.com/configure-wordpress-phpmailer-settings/): add_action( 'phpmailer_init', 'setup_phpmailer_init' ); function setup_phpmailer_init( PHPMailer $phpmailer ) { $phpmailer->Host = 'HOSTNAME'; // for example, smtp.mailtrap.io $phpmailer->Port = 587; // set the appropriate port: 465, 2525, etc. $phpmailer->Username = 'YOURUSERNAME'; // your SMTP username $phpmailer->Password = 'YOURPASSWORD'; // your SMTP password $phpmailer->SMTPAuth = true; $phpmailer->SMTPSecure = 'tls'; // preferable but optional $phpmailer->IsSMTP(); } - [Install Composer in Debian 10 Buster to Use with Ispconfig and Jailkit](https://senormedia.com/install-composer-in-debian-10-buster-to-use-with-ispconfig-and-jailkit/): You must have ispconfig installed and jailkit. - [Add WordPress Admin thru PHP Code](https://senormedia.com/add-wordpress-admin-thru-php-code/): Add code to functions or plugin - [Woocommerce Snippets](https://senormedia.com/woocommerce-snippets/): Add Product To Cart //Javascript addToCart(232); function addToCart(p_id) { $.get('/?post_type=product&add-to-cart=' + p_id, function() { // call back }); } //PHP $product_id = 232; $product_cart_id = WC()->cart->generate_cart_id($product_id); //WC()->cart->empty_cart(); if (! WC()->cart->find_product_in_cart($product_cart_id)) { // Yep, the product with ID 55 is NOT in the cart, let's add it then! WC()->cart->add_to_cart($product_id); } - [Install Composer in Debian 10 Buster](https://senormedia.com/install-composer-in-debian-10-buster/): If you need to install composer in debian this is quick an easy to use globally. Works with Digitalocean as well as ispconfig. - [Ispconfig Jailkit php, composer, mysql, drush, composer, node, ruby, compass](https://senormedia.com/ispconfig-jailkit-php-composer-mysql-drush-composer-node-ruby-compass/): Install components - [Install Virtual Machine Manager(libvirt) in Manjaro](https://senormedia.com/install-virtual-machine-managerlibvirt-in-manjaro/): STEP 1: Launch Terminal and enter the following command to install KVM and necessary dependencies. sudo pacman -S virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat STEP 2: The next two steps are very important and often ignored by many users. Make sure to complete it else, you will get error “adduser: The group `libvirtd’ does not exist” when you run the Virtual Machine Manager after installation is complete! Enable the service by entering the below command: sudo systemctl enable libvirtd.service STEP 3: Start the service using below command: sudo systemctl start libvirtd.service sudo groupadd --system libvirt sudo usermod -a -G libvirt $(whoami) newgrp libvirt //Verify that user is added to libvirt group. id $(whoami) Open the file /etc/libvirt/libvirtd.conf for editing. sudo vim /etc/libvirt/libvirtd.conf Set the UNIX domain socket group ownership to libvirt, (around line 100) unix_sock_group = "libvirt" Set the UNIX socket permissions for the R/W socket (around line 102) unix_sock_rw_perms = "0770" Restart libvirt daemon after making the change. sudo systemctl restart libvirtd.service - [Redirect domains without www to www with apache rewrite rules](https://senormedia.com/redirect-domains-without-www-to-www-with-apache-rewrite-rules/): RewriteEngine On RewriteCond %{HTTP_HOST} !^www RewriteRule (.*) http://www.%{HTTP_HOST}$1 - [Rewrite Express Engine Urls](https://senormedia.com/rewrite-express-engine-urls/): <IfModule mod_rewrite.c> # Enable Rewrite Engine # ------------------------------ RewriteEngine On RewriteBase / # Redirect index.php Requests # ------------------------------ RewriteCond %{THE_REQUEST} ^GET.*index\.php RewriteCond %{THE_REQUEST} !/system/.* RewriteRule (.*?)index\.php/*(.*) /$1$2 # Standard ExpressionEngine Rewrite # ------------------------------ RewriteCond $1 !\.(css|js|gif|jpe?g|png) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 </IfModule> - [Add Mysql Database Table Using WordPress Theme or Plugin (Works with multisite)](https://senormedia.com/add-mysql-database-table-using-wordpress-theme-or-plugin-works-with-multisite/): global $senormedia_jal_db_version; $senormedia_jal_db_version = '1.0'; function senormedia_jal_install() { global $wpdb; global $senormedia_jal_db_version; $table_name = $wpdb->prefix.'_subscriptions'; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE $table_name ( subscribe_id int(11) NOT NULL auto_increment, site_id varchar(500) NOT NULL, email varchar(500) NOT NULL, status varchar(256) NOT NULL, url varchar(256) NOT NULL, date timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (subscribe_id) ) $charset_collate;"; require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); $eeor = dbDelta( $sql ); add_option( 'senormedia_jal_db_version', $senormedia_jal_db_version ); } register_activation_hook( __FILE__, 'senormedia_jal_install' ); function myplugin_update_db_check_senormedia() { global $senormedia_jal_db_version; if ( get_site_option( 'senormedia_jal_db_version' ) != $senormedia_jal_db_version ) { senormedia_jal_install(); } } add_action( 'plugins_loaded', 'myplugin_update_db_check_senormedia' ); - [Ubuntu 18.04 Vestacp Linux move domain to another user](https://senormedia.com/ubuntu-18-04-vestacp-linux-move-domain-to-another-user/): v-change-domain-owner domain.com username v-change-database-owner databasename username - [Increase Virtualbox Disk Size Command Line](https://senormedia.com/increase-virtualbox-disk-size-command-line/): VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB - [How to delete all unpublished commands on Drupal using sql](https://senormedia.com/how-to-delete-all-unpublished-commands-on-drupal-using-sql/): or - [Execute bash script from URL on Linux command line](https://senormedia.com/execute-bash-script-from-url-on-linux-command-line/): source <(curl -s https://senormedia.com/bash.sh) bash <(curl -s https://senormedia.com/bash.sh) Install with curl as well pass arguments curl -s https://senormedia.com/bash.sh | bash -s arg1 arg2 Flag "-s" makes shell read from stdin. bash <(wget -qO- https://senormedia.com/bash.sh) wget -O - https://senormedia.com/bash.sh| bash - [Flush Linux Debian Cache](https://senormedia.com/flush-linux-debian-cache/): sudo systemd-resolve --flush-caches - [Install firmware Linux Debian Buster or Stretch](https://senormedia.com/install-firmware-linux-debian-buster-or-stretch/): Go to link https://www.debian.org/releases/stable/armel/ch06s04.html.en - [Installing Snapd and Snap Store Linux Debian Buster](https://senormedia.com/installing-snapd-and-snap-store-linux-debian/): sudo apt update sudo apt install snapd sudo snap install snap-store - [Install Tlp Battery Package Linux Debian Buster](https://senormedia.com/install-tlp-battery-package-linux-debian-buster/): sudo apt update && sudo apt install tlp && sudo tlp start - [Things to do after installing Linux Debian Buster or Stretch](https://senormedia.com/things-to-do-after-installing-linux-debian-stretch-or-buster/): Keep Debian up to date - [Things to do after installing Ubuntu](https://senormedia.com/things-to-do-after-installing-ubuntu/): sudo apt update && sudo apt upgrade && sudo apt full-upgrade sudo ufw enable sudo ufw status sudo apt install gufw -y sudo apt install gnome-tweak-tool -y sudo apt-get install synaptic -y Third-party Media Codecs & Extras By default, Ubuntu does not provide any media codec to play multimedia files. So to enjoy movies, music, and entertaining application, you need to install media codecs. Use the following code into Terminal. sudo apt install ubuntu-restricted-extras Here I recommend installing the free version of libavcodec also to avoid an issue while performing media task with video editors or transcoder. Use the following code. sudo apt install libavcodec-extra Moreover, to enable encrypted DVD playback, you have to install… “libdvd-pkg.” sudo apt install libdvd-pkg sudo add-apt-repository ppa:linrunner/tlp sudo apt update sudo apt install tlp tlp-rdw sudo apt install flatpak And then, install the Flatpak plugin for GNOME Software Center. sudo apt install gnome-software-plugin-flatpak flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo clean partial packages using a command sudo apt-get autoclean You can auto cleanup apt-cache sudo apt-get clean You can clean up of any unused dependencies sudo apt-get autoremove sudo apt purge ubuntu-web-launchers apt-get install libvirt-bin libvirt-doc kvm-ok Install The Packages sudo apt install qemu-kvm libvirt-clients libvirt-daemon-system bridge-utils virt-manager Add Your User To The Groups $ sudo adduser username libvirt $ sudo adduser username libvirt-qemu - [Disable IPv6 to make Debian or Ubuntu faster](https://senormedia.com/disable-ipv6-to-make-debian-or-ubuntu-faster/): sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 ## Pages - [Responsive](https://senormedia.com/responsive/) - [Contact](https://senormedia.com/contact/) - [About](https://senormedia.com/about/): Hello, my name is senormedia. I am from El Paso, Tx. You can find me at modifiedarts.com as well. - [Home](https://senormedia.com/) ## Categories - [.htaccess](https://senormedia.com/category/htaccess/) - [Angular](https://senormedia.com/category/angular/) - [Apache](https://senormedia.com/category/apache/) - [CMS](https://senormedia.com/category/cms/) - [Content Management System](https://senormedia.com/category/content-management-system/) - [Drupal](https://senormedia.com/category/drupal/) - [Hosting Control Panel](https://senormedia.com/category/hosting-control-panel/) - [Ionic](https://senormedia.com/category/ionic/) - [Ispconfig](https://senormedia.com/category/ispconfig/) - [Linux](https://senormedia.com/category/linux/) - [Nginx](https://senormedia.com/category/nginx/) - [Node Js](https://senormedia.com/category/node-js/) - [Npm](https://senormedia.com/category/npm/) - [PHP](https://senormedia.com/category/php/) - [Server](https://senormedia.com/category/server/) - [Sql](https://senormedia.com/category/sql/) - [Uncategorized](https://senormedia.com/category/uncategorized/) - [Virtualization](https://senormedia.com/category/virtualization/) - [Wordpress](https://senormedia.com/category/wordpress/) ## Tags - [Arch Linux](https://senormedia.com/tag/arch-linux/) - [Coding](https://senormedia.com/tag/coding/) - [Command Line](https://senormedia.com/tag/command-line/) - [Debian](https://senormedia.com/tag/debian/) - [Drupal 7](https://senormedia.com/tag/drupal-7/) - [Jailkit](https://senormedia.com/tag/jailkit/) - [Manjaro](https://senormedia.com/tag/manjaro/) - [MYSQL](https://senormedia.com/tag/mysql/) - [Node](https://senormedia.com/tag/node/) - [PHP](https://senormedia.com/tag/php/) - [Raspberry Pi](https://senormedia.com/tag/raspberry-pi/) - [Ruby](https://senormedia.com/tag/ruby/) - [Shell](https://senormedia.com/tag/shell/) - [Skype](https://senormedia.com/tag/skype/) - [Ubuntu](https://senormedia.com/tag/ubuntu/) - [Vbox](https://senormedia.com/tag/vbox/) - [Vestacp](https://senormedia.com/tag/vestacp/) - [Virtual Box](https://senormedia.com/tag/virtual-box/) - [Virtualbox](https://senormedia.com/tag/virtualbox/)