Linux Programmer | RHCE | RHCSA

Search This Blog

Thursday, 26 July 2018

Windows shared network printer issue in ubuntu 18.04

Windows shared network printing issue in ubuntu 18.04.

- printers are installed in windows 8 machine and shared.
- when try to find the network printer from ubuntu 18.04 using the ip of windows machine then it is showing an error 
"no network printer found"

- even, when we found the shared folders using smbclient command then it will showing an error


smbclient -L 192.168.1.20
output:
syslog option deprecated,
Enter WORKGROUP\root's password:

    Sharename       Type      Comment
    ---------       ----      -------

    ADMIN$          Disk      Remote Admin
    Backup          Disk     
    bk              Disk     
    bkp             Disk     
    C$              Disk      Default share
    Canon UFR II Color Class Driver Printer   Canon UFR II Color Class Driver
    Canon-LBP2900-toc64 Printer   Canon LBP2900
    Canon2900       Printer   \\MUIN-KHAN\Canon-LBP2900
    D$              Disk      Default share
    Data            Disk     
    HP-LaserJet-M1005 Printer   \\KESHA\Hewlett-Packard-HP-LaserJet-M1005
    IPC$            IPC       Remote IPC
    libjack         Disk     
    print$          Disk      Printer Drivers
    raj             Disk     
    Users           Disk     
Reconnecting with SMB1 for workgroup listing.
Connection to 192.168.1.20 failed (Error NT_STATUS_RESOURCE_NAME_NOT_FOUND)
Failed to connect with SMB1 -- no workgroup available


it is showing an error as showing in bold letter.

even if are checking the syslog then it will be like,

Jul 26 10:01:03 localhost dbus-daemon[712]: [system] Successfully activated service 'org.freedesktop.hostname1'
Jul 26 10:01:03 localhost systemd[1]: Started Hostname Service.
Jul 26 10:01:20 localhost python: io/hpmud/jd.c 93: unable to read device-id
Jul 26 10:01:20 localhost python: io/hpmud/jd.c 745: invalid ip 192.168.1.20
Jul 26 10:01:20 localhost hp-makeuri: hp-makeuri[13665]: error: Device not found



Solution:

First: Ubuntu does not install a smb.conf in 18.04 so I suggest you install the samba client package:

Code:
sudo apt install smbclient
Second: Then edit /etc/samba/smb.conf and right unser the workgroup = WORKGROUP line add this line to change the default:
Code:
client max protocol = NT1
Third: Install samba packages.
Code:
apt-get install samba
and reboot.... Yes reboot..
fourth: Install CUPS:
Code:
apt-get install cups; apt-get install cups-bsd 

fifth: Install python3-smbc:
Code:
apt-get install python3-smbc
 Now try to find network printer from system-config-printer 

it works !!!

Wednesday, 18 July 2018

X11Forwarding with SSH not working when connect user through Ncomputing device ?

X11Forwarding with SSH not working when connect user through N-computing device ?
Issue Description:

Install N-computing Server in one linux machine.
Trying to connect another user through Ncomputing client using Vspace.

User logged in successfully but when the connected user tried to connect another machine through ssh using X11forwading then it is not working .

For e.g.

$ ssh purval@192.168.1.76 -CX

then it take some time to login and after 1 or 2 minute it will logged in successfully.

but when we try to open some GUI application then it wont open.

Solution:

1. Logout the SSH session
2. run below command with normal user
      $ xhost +
3. Login user using SSH with -CX and try to open application.

it works !!


if you enter $xhost command it will show output like,

access control disabled, clients can connect from any host

$xhost - will remove the xhost access control which you have set.

About Xhost

xhost is a server access control program for X. It is used to add and delete host names or user names to the list allowed to make connections to the X server. In the case of hosts, this provides a rudimentary form of privacy control and security. It is only sufficient for a workstation (single user) environment, although it does limit the worst abuses in other cases. Environments which require more sophisticated measures should implement the user-based mechanism or use the hooks in the protocol for passing other authentication data to the server.


Thank you,



Wednesday, 27 June 2018

Display System information on desktop

Do you want to display system information on desktop without disturbing regular work ?

here is the package which is help to do that.

conky

1. install conky
apt-get install conky-all

2. install conky-manager to make changes from GUI.
  • Add the necessary repository with the command sudo add-apt-repository ppa:teejee2008/ppa
  • Update apt with the command sudo apt-get update
  • Install Conky Manager by issuing the command sudo apt-get install conky-manager
3. open conky-manager 
     Open terminal and type
     $ conky-manager

4. Select any option which you want to add on desktop

5. To add information like ipaddress and macid 

The configuration files are located into .conky folder into the users home directory

 

~/.conky/Green Apple Desktop/conky_seamod

# IP information
${if_existing /proc/net/route wlan0}
${addr wlan0}
${else}${if_existing /proc/net/route eth1}IP ADDRESS
${addr eth1}
${else}
Network disconnected
${endif}${endif}

Mac ID
# Mac ID information
${exec ifconfig eth1 | grep -i addr | grep -i HWaddr | awk '{print$5}'}

 
This will responsible to display IP and macid information in theme

You can also remove the existing not used information from screen by removing it from the file.

6. Another configuration files are located at, 
  ~/.config/conky-manager.json

7. To add it on startup
 
~/.config/autostart/conky.desktop

[Desktop Entry]
Type=Application
Exec=sh "/home/purval/.conky/conky-startup.sh"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name[en_IN]=Conky
Name=Conky
Comment[en_IN]=
Comment=


 
You can also do this from conky-manager GUI
 




Friday, 22 June 2018

Set default image viewer in wine.

Set picassa photo viewer as default app for image

You can use the command mimeopen, in a terminal go to the folder where you have some pictures with extensions, you should do it for every extension. Suppose for picture named image.jpg. Run the command:
mimeopen -d image.jpg 
You will get a popup menu, where you can see some options, here is sample of my apps:
If mimeopen package not exists then you can install:
libfile-mimeinfo-perl

$ mimeopen -d e.jpg 
Please choose a default application for files of type image/jpeg

    1) Wine Internet Explorer  (wine-extension-jpe)
    2) Wine Internet Explorer  (wine-extension-jfif)
    3) gThumb  (gthumb)
    4) Pinta  (pinta)
    5) Image Viewer  (gpicview)
    6) Shutter  (shutter)
    7) Firefox Web Browser  (firefox)
    8) Shotwell Viewer  (shotwell-viewer)
    9) GIMP Image Editor  (gimp)
    10) Other...
AS you can notice you could see some wine apps so if you find picasa choose it, else choose other(10) and type the command that runs your picasa. It looks like
WINEPREFIX=~/.purval WINE=/opt/wine-staging/bin/wine /opt/wine-staging/bin/wine ~/.wine/drive_c/myapps/foo.exe
This Configuration files are located at: /usr/share/mime/image 

 

M3 Button not working in Wayland

Mouse M3 button not working in wayland - ubuntu 26.04 1. Check your desktop Run: echo $XDG_SESSION_TYPE echo $XDG_CURRENT_DESKTOP 2. If...