Linux Programmer | RHCE | RHCSA

Search This Blog

Friday, 20 January 2017

refresh icons on pcmanfm desktop

sometimes new created icons are not showing on pcmanfm desktop

1. craete file /path/to/script/refresh.sh

#!/bin/sh
pcmanfm --desktop-off
pcmanfm --desktop --profile LXDE &

2. chmod +x /path/to/script/refresh.sh

Double click on script, the items on desktop is now displaying.

Thursday, 12 January 2017

system-config-printer !!

List only connected Printers on Local machine 

             The important part here is the "device-URI". This way you tell CUPS which backend it shall use with the printer "printername". The backends for most types of local printers are already part of the CUPS package. CUPS 1.1.x contains backends for parallel, serial, and USB printers, CUPS 1.2.x will also support FireWire (IEEE 1394) and SCSI printers.

            The backends do not only send data to the appropriate devices. They are also called when CUPS is started. They auto-detect which printer models are connected to which ports. So you should set up your BIOS for the parallel ports to allow bi-directional communication. Then your printer(s) can answer to the auto-detection requests.
To see which devices the CUPS backends auto-detect currently, execute them without command line options:

   $ /usr/lib/cups/backend/usb
   direct usb:/dev/usb/lp0 "HP PSC 950xi" "USB Printer #1"
   direct usb:/dev/usb/lp1 "EPSON USB Printer" "USB Printer #2"
   direct usb:/dev/usb/lp2 "EPSON USB Printer" "USB Printer #3"
   direct usb:/dev/usb/lp3 "Unknown" "USB Printer #4
 
 
List Installed Printers  
        this will list the printers which is installed in local machine.
lpstat -p | awk '{print $2}' | xargs -n1 lpq -P | grep -i "ready" 
 
 
================== Other Options ================
  • /usr/bin/lp - Used to submit print jobs
  • /usr/bin/lp.cups - Used to submit print jobs
  • /usr/bin/lpoptions - Gets and sets printer options for a single user when run by a user or for the system when used by root
  • /usr/bin/lppasswd - Changes printing passwords for an individual user or adds, deletes, and changes printer users and passwords when run by root
  • /usr/bin/lpq - Shows the status of a printer queue
  • /usr/bin/lpq.cups - Shows the status of a printer queue
  • /usr/bin/lpr - Used to submit print jobs
  • /usr/bin/lpr.cups - Used to submit print jobs, forcing use of CUPS
  • /usr/bin/lprm - Used to remove print jobs from a queue
  • /usr/bin/lprm.cups - Used to remove print jobs from a queue
  • /usr/bin/lpstat - Gives status of the CUPS system, such as queue lengths and printers
  • /usr/bin/lpstat.cups - Gives status of the CUPS system, such as queue lengths and printers
  • /usr/bin/cancel - Cancels a print job
  • /usr/bin/enable - Enables a print queue or class of printers, requires a management password
  • /usr/bin/disable - Disables a print queue or class of printers, requires a management password
  • /usr/sbin/lpadmin - Manages printers and classes, requires a management password
  • /usr/sbin/lpc - A compatibility program for Berkley style printers, limited to queue status in CUPS
  • /usr/sbin/lpc.cups - A compatibility program for Berkley style printers, limited to queue status in CUPS
  • /usr/sbin/lpdomatic - A filter script provided to be used in setting up printers
  • /usr/sbin/lpinfo - Shows available printer devices and drivers on the system
  • /usr/sbin/lpmove - Moves the jobs destined for a queue to another queue

These commands only work when you're logged in as root, either when you log in or after switching to root using the su command:
  • /usr/bin/lprsetup.sh - A shell script provided to help set up ghostscript printers
  • /usr/sbin/accept - Causes the print queue to accept requests
  • /usr/sbin/reject - Causes the print queue to reject requests
 

Monday, 9 January 2017

Disable right click on Lxpanel

Download Source code of LXpanel

cd /opt
https://drive.google.com/open?id=0BwPBGrPmbppATGw4X193OTdvUVk

Now, Extract downloaded .tar file

tar -xf lxpanel-0.9.2.tar.xz

cd lxpanel-0.9.2

open README file and Follow The instructions to Download dependency packages
                              OR
Download the dependency packages List from below link,
https://drive.google.com/open?id=0BwPBGrPmbppAQmJ3SUZ3T1lHY3c

cp lxpanel_dependency.tar /tmp

cd /tmp
tar -xf lxpanel_dependency.tar
( This .tar file contains the .deb files, install .deb files  )
dpkg -i *.deb


cd /opt/lxpanel-0.9.2/src

nano input-button.c

search for "on_button_press_event"

{
// comment code inside this function
}

nano plugin.c

search "lxpanel_plugin_button_press_event"
{
// comment code inside the function
}
 OR
Download the source files and replace it
input-button.c
https://drive.google.com/open?id=0BwPBGrPmbppAYW1pandEUHZac1k

plugin.c
https://drive.google.com/open?id=0BwPBGrPmbppAdmNsWC1UTWpqUUU



cd /opt/lxpanel-0.9.1/

(Configure the source code of lxpanel)
./configure --prefix=/usr

make 

make install
lxpanelctl restart



SSH not working with password after upgrade ubuntu 22.04 or above

In recent upgrade of ubuntu 22.04 and above we are not able to login server with SSH password. but when we try to login with key then it all...