Like Us Like Us Facebook Subscribe Subscribe us YouTube Whatsapp Share us Whatsapp Query Send your queries

KDE Plasma Desktop Commands

KDE Plasma Desktop Commands

In this post we are going to learn some KDE Plasma Desktop specific commands to get information like KDE Framework , Plasma Desktop version , OS information and tons more.

Operating System all release details :

If you want to know OS release details then Open Konsole and Run commands below (It will work for Other DE also)

Command 1 : 

cat /etc/os-release

Command 2 (only OS like “Ubuntu”) :

cat /etc/os-release | head -1 | tail -1 | awk -F"=" '{print $2}'

Command 3 (pretty name like “Ubuntu 20.04.2 LTS” ) :

cat /etc/os-release | head -5 | tail -1 | awk -F"=" '{print $2}'

Command 4 :

lsb_release -a

Command 5 :

hostnamectl

KDE Plasma Version
If you want to know Plasma Desktop Version and run commands below

Command 1 :

plasmashell --version 

Command 2 :

dpkg -l | awk -F"[:-]" '/plasma-desktop\s/{print $3}'

Command 3 :

dpkg -l | grep plasma-desktop\ | awk '{print $3}' | cut -d':' -f2 | cut -d'-' -f1

KDE Frameworks Version command :

kded5 --version

Kate Version command :

kate --version

Konsole Version command :

konsole -v

How to Use WordPress Customizer in your Theme

How to Use WordPress Customizer in your Theme

WordPress comes with a built-in theme customizer that allows to take your WordPress Theme to the next level. Using Customizer you can change your Site Title and Tagline, add Widgets to a Sidebar or Footer, create Custom Menus, change your Homepage Settings, and more with realtime view.

For example we are going to create a panel “Social Links” then can be accessible from Dashboard go Apearance->Customize. For thiswe have put the code given below in your theme’s functions.php

function theme_customize_function($wp_customize){

  $wp_customize->add_panel('sp_social_url',array(
    'title'=>'Social Icons',
    'description'=> 'Set Social Media Url here',
    'priority'=> 100,
  ));
  
  $wp_customize->add_section('sp_social_url',array(
     'title'=>'Social Url',
     'description'=>__('Set Social Media Url here'),
     'panel'=>'sp_social_url',
  ));
  
    $wp_customize->add_setting('sp_social_facebook',array(
        'default'=>_('Facebook Url'),
    ));
    
    $wp_customize->add_control('sp_social_facebook',array(
        'label'=>'Facebook Url',
        'section'=>__('sp_social_url'),
        'priority'=>1,
    ));
    
    $wp_customize->add_setting('sp_social_youtube',array(
        'default'=>_('Youtube Url'),
    ));
    
    $wp_customize->add_control('sp_social_youtube',array(
        'label'=>'Youtube Url',
        'section'=>__('sp_social_url'),
        'priority'=>1,
    ));
    
    $wp_customize->add_setting('sp_social_linkedin',array(
        'default'=>_('Linkdin Url'),
    ));
    
    $wp_customize->add_control('sp_social_linkedin',array(
        'label'=>'Linkedin Url',
        'section'=>__('sp_social_url'),
        'priority'=>1,
    ));

}
add_action('customize_register','theme_customize_function');

Now if you want show it in footer, just copy the code below and paste in footer.php.

<a target="_blank" class="soc_facebook" href="<?php echo get_theme_mod('sp_social_facebook');?>" rel="nofollow">Facebook</a>
<a target="_blank" class="soc_youtube" href="<?php echo get_theme_mod('sp_social_youtube');?>" rel="nofollow">YouTube</a>
<a target="_blank" class="soc_linkedin" href="<?php echo get_theme_mod('sp_social_linkedin');?>" rel="nofollow">Linkedin</a>

Linux Fix Laptop blinking issue using setting nomodeset

Linux Fix Laptop blinking issue using setting nomodeset

If your Laptop is running Linux OS and your screen is blinking  when boots  then we can fix this using “nomodeset” in /etc/default/grub.

What is nomodeset ?

The newest kernels have moved the video mode setting into the kernel. So all the programming of the hardware specific clock rates and registers on the video card happen in the kernel rather than in the X driver when the X server starts.. This makes it possible to have high resolution nice looking splash (boot) screens and flicker free transitions from boot splash to login screen. Unfortunately, on some cards this doesnt work properly and you end up with a black screen. Adding the nomodeset parameter instructs the kernel to not load video drivers and use BIOS modes instead until X is loaded.

You should add this option to /etc/default/grub, firstly:

sudo nano /etc/default/grub

and then add nomodeset to GRUB_CMDLINE_LINUX_DEFAULT like below:

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR='lsb_release -i -s 2> /dev/null || echo Debian'
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"
GRUB_CMDLINE_LINUX=""

and press CTRL+X and then press Enter Key.

Linux Directory Structure Tutorial

Linux Directory Structure Tutorial

In this tutorial we are going to explore Linux Root (/) directory structure , everything on your Linux system is located under the / directory, known as the root directory just like Windows’ C:\ directory. I am using “Kubuntu 20.04” root directory structure as reference.

DIRECTORY  CONTENT
 /bin  Essential command binaries
 /boot  Static files of the boot loader
 /dev  Device File
 /etc  Host-specific system configuration
 /home  User home directories
 /lib  Essential shared libraries and kernel modules
 /media  Contains mount points for replaceable media
 /mnt  Mount point for mounting a file system temporarily
 /proc  Virtual directory for system information
 /root  Home directory for the root user
 /run  Run-time variable data
 /sbin  Essential system binaries
 /sys  Virtual directory for system information
 /tmp  Temporary files
 /usr  Secondary hierarchy
 /var  Variable Data
 /srv  Data for services provided by the system
 /opt  Add-on application software packages

Woo Commerce Single Product Page customization

Woo Commerce Single Product Page customization

If you are running a Woo Commerce powered e commerce website and want to customize single product page then we can do it by editing functions.php file. Like I want to show product description below Title, Hide or remove Product Description Tab,  Hide or remove  related product.

Show product description below Title in woo commerce single product page

Just edit functions.php and add code given below and save

add_action( 'woocommerce_single_product_summary' , 'show_custom_text', 10 );
function show_custom_text() {
  global $product;
  echo $product->description;
	echo '<br/>';
}

Remove Product Description Data Tab in woo commerce single product page

Just edit functions.php and add code given below and save

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );

Remove Related product in woo commerce single product page

Just edit functions.php and add code given below and save

remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );

You can also remove default sorting drop down from Woo Commerce product Page, just click the link below

Woo Commerce How to Remove the Default Sorting Drop down

Woo Commerce How to Remove the Default Sorting Drop down

Woo Commerce How to Remove the Default Sorting Drop down

Are you trying to remove the Default Sorting Drop down on a Woo commerce Shop page, if you don’t need ‘Sort by’ drop down on a Woo commerce Shop page then you can do it simply editing your theme’s functions.php file.

Method 1 : Using PHP
Add the one line of code below to to functions.php file to hide Default Sorting Drop down

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );

Method 2 : Hide using css code

.woocommerce-ordering {
  display: none;
}

Woo Commerce Single Product Page customization

Linux How many packages are installed ?

Linux How many packages are installed ?

In this tutorial we are going to use Linux terminal to find how many packages are installed on your computer. In today’s world a systems are made up of hundreds, even thousands of packages. Generally these package are tracked and maintained by a package.

Here are the commands for checking the number of installed packages on various distro :

For Debian based distro (Ubuntu, Kubuntu, Xubuntu… , elementary os, Zorin, Linux Mint, Deepin, MX Linux ….)

Open Terminal and run command below

dpkg -l | grep "^ii" | wc -l

For Redhat based distro (CentOs, Fedora, clear os, OpenSuse …)

Open Terminal and run command below
rpm -qa | wc -l

For Arch based distro (Manjaro, Garuda Linux, EndeavourOS, RebornOS, Chakra Linux …)

Open Terminal and run command below

pacman -Q | wc -l

Output Screen shot for Linux How many packages are installed ?

Linux Packages

How to clear Whmcs template cache

How to clear Whmcs template cache

In this tutorial we are going to learn how to  Whmcs clean / clear template cache from WHMCS dashboard. This tutorial is Ideal for whmcs template / theme developer who just started creating theme or template for WHMCS.

whmcs-tutorialWHMCS : Right now WHMCS is the #1 Choice in Web Hosting Billing and  Automation.

How to clear WHMCS template cache

Step 1  :
Login to your WHMCS Dashboard
This tutorial tested on WHMCS Version is 7.8.3

Step 2 :
Navigate to
Utilities ->System->System cleanup
Look for Empty Template Cache
and click on Go button its very simple

 

How to clear WHMCS template cache Video Tutorial

PHP Final Keyword with Example

PHP Final Keyword with Example

 PHP Final KeywordIn this tutorial we are going to learn PHP Final Keyword with Example. If you are new to Object Oriented Programming then please learn it as PHP final keyword used with Classes and methods.

Use of PHP Final Keyword :

  • PHP Final Classes prevent inheritance
  • Final Methods prevent Method Overriding

Final Class Example :

If we declare a class as final class then subclass can’t its extend parent class.

<?php
final Class Parent
{
public function calculate($x,$y)
{
$multi=$x*$y;
echo "Multiplication of given no =".$multi;
}
}
class Child extends Parent
{
function calculate($x,$y)
{
$sum=$x+$y;
echo "Sum of given no =".$sum;
}
}
$obj= new Child();
$obj->calculate(10,5);
?>

If run above code then you will get error.

Final Method Example :

If we declared a method as final method in parent class then its subclass can’t override parent class method.

<?php
class Parent
{
final function calculate($x,$y)
{
$multi = $a*$b;
echo "Multiplication = ".$multi;
}
}
class Child extends Parent
{
public function calculate($a,$b)
{
$sum = $x+$y;
echo "Sum = ".$sum;
}
}
$obj= new Child();
$obj->calculate(10,5);
?>

If run above code then you will get error.

Download All Indian Pincode in csv and excel format

Download All Indian Pincode in csv and excel format

If you want to download all Indian pin code or postcode in csv or excel format then this post can help you. In case of custom application that depends on Indian pincode or any eCommerce website that offer pincode based delivery option then we need all Indian pincode in csv or excel format to upload in our website (Database).

Download Pin Code state wise in Excel Format

If you want to download pin code in excel format state wise then visit the link given below (Accuracy : Not Available)

Download State wise

Download All Pin code in .csv format

If you want to download all pin codes in csv format then visit the link given below (Accuracy : data.gov.in ), state wise data is not available

Download All Pin code

Download Directly

If you need any help to arrange data in your format then please contact me.

Do you have any Bugs, Errors, Issues or want to customize your Opencart or Woo commerce based Website ?
I am opencart, woocommerce expert with 5+ years of experience, also developed custom theme and plugin and extension. You can outsource you project to us on Fiverr just click the link below
https://www.fiverr.com/codentricks

Do you have any Query / Suggestion