Web, Software and Graphics

Install Virtual Machine Manager(libvirt) 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
Read More!

Rewrite Express Engine Urls

<IfModule mod_rewrite.c>

# Enable Rewrite Engine
# ------------------------------
RewriteEngine On
RewriteBase /

# Redirect index.php Requests
# ------------------------------
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{THE_REQUEST} !/system/.*
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]

# Standard ExpressionEngine Rewrite
# ------------------------------
RewriteCond $1 !\.(css|js|gif|jpe?g|png) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

</IfModule>
Read More!

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' );
Read More!

How to delete all unpublished commands on Drupal using sql

DELETE c, rcb, dcb
FROM
    comment AS c
JOIN field_revision_comment_body AS rcb ON (c.cid = rcb.entity_id)
JOIN field_data_comment_body AS dcb ON (rcb.entity_id = dcb.entity_id)
WHERE
    c. STATUS = 0

or

DELETE FROM field_data_comment_body USING field_data_comment_body JOIN comment ON comment.cid=field_data_comment_body.entity_id AND comment.status=0
DELETE FROM field_revision_comment_body USING field_revision_comment_body JOIN comment ON comment.cid=field_revision_comment_body.entity_id AND comment.status=0
DELETE FROM comment WHERE status=0
Read More!

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
Read More!

Install firmware Linux Debian Buster or Stretch

Go to link https://www.debian.org/releases/stable/armel/ch06s04.html.en

extract zip

open terminal in folder or cd into directory of firmware tar

sudo dpkg -i *.deb

basically, what this does is fills in the rest of the name in place of the * character. You may encounter an error saying dependencies not met, if you see this then you can run

sudo apt-get install -f
Read More!

Things to do after installing Linux Debian Buster or Stretch

Keep Debian up to date
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
su -
apt-get install sudo
adduser "USERNAME" sudo
apt-get update
apt-get upgrade
reboot
install dash to dock extension

Configure non-free repositories

Open /etc/apt/sources.list using Nano text editor:

sudo nano /etc/apt/sources.list

//Add contrib non-free after main
example 
deb http://deb.debian.org/debian/ buster-updates main non-free contrib


sudo apt update
sudo apt upgrade
sudo reboot
sudo nano /etc/default/grub
sudo update-grub

[display-posts id=”36″]

Read More!

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
Read More!

Need Help With Code?