• Linux
  • June 2018
    M T W T F S S
    « May   Jul »
  • Meta

  • Follow me on Twitter

  • Advertisements

Conky & Broadcom WiFi


Not too long ago, I came across an HP EliteBook 2560p and thought it would be a nice little laptop to carry around because it was small and lightweight. It’s a bit bigger than the HP 110-Mini Netbook and more powerful with a second generation i5 processor, 8GB of RAM and a 320GB hard drive.

Naturally, I installed Linux Mint 18.3 with the Cinnamon desktop environment. It runs quite well. I had to install a driver for the Broadcom wireless adapter and I took the one that Mint recommended, it works just fine. The only problem I noticed was that my Conky script wasn’t displaying the wireless signal strength. I checked the script to make sure I had the interface name correct and it was. Tonight I searched Google for the problem and learned that sometimes Broadcom wireless adapters block Conky’s requests to get the information from the adapter.

The fix is to run the following command to give Conky the needed permissions:

sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/conky

To see what permissions Conky has:

getcap /usr/bin/conky

And to remove the permissions:

setcap -r /usr/bin/conky

Restart Conky, log out and log back in, or restart the computer and you should see the WiFi signal strength.


Transferring data to a new laptop

Probook6570bYesterday afternoon I decided to move my data from one HP Probook 6570 to a different one. I used Joe Collins‘ XBT backup script to back up my home directory to an external drive. After installing Linux Mint 18.3 on the “new” laptop, I used rsync to copy my home directory to the new installation. Then I did some post-installation tweaks and ran a script to install software and do a few other system tweaks. That done, it was time for me to go to work so I shut the system down.

This morning I fired it up and logged in. To my delight my conky script ran and Firefox popped up to the Dropbox site, asking me to sign in to my account. Then I connected to my main PC via SSH and was glad to see that my SSH key and other settings had carried over. I then installed the Chromium browser and the installation was complete.

The script to install the software I like to have on my Mint installations worked rather well, but I saw the need to add additional checks to see if certain packages had been installed or if certain directories already been created. I also added Chromium to the install script.

Encouraged by the success of that install and data transfer, I’m looking forward to reinstalling Linux on my Dell E6500. I’m changing my partitioning on that laptop so the process may be a little different or maybe not.

These installs are practice for when I reinstall Mint on my Lenovo M91p. I plan to change the partitioning and get rid of the unused 500GB Windows 10 partition since I no longer have any intention to dual boot this PC. Working daily with Windows 10 at work has convinced me that I really want no part of it on my own network.

Tweaking scripts

Linux-works-for-youI fiddled around with a couple of my scripts yesterday. I made a couple of minor tweaks to my Getinfo script. I changed the variable that holds the filename that the information gets written too so that the file gets written to the logged in user’s home directory. Originally it was written to the current working directory. Rather than build the path and the filename using the += operator, I assigned it all to the variable at one go: infofile=”/home/$USER/$HOSTNAME.info”.

I also tried to write a more elegant version of my randpic.sh script which randomly selects a sub-directory in my Pictures directory and then picks a random file from that directory. I do have a few image files (wallpapers) in the root of the Pictures directory so now and then one of them will get selected as a directory and when the next part of the script tries to grab a file from this “directory” I get an “invalid file” message and the script runs through the loop and tries again. It really doesn’t bother me since these particular files are wallpaper images that can be disregarded for my purposes.

I thought about ways to test whether or not the selected directory was, indeed, a directory and if it wasn’t, to either process the file or to disregard the selection and try again. I tried nesting either a while or an until loop but I either ended up with an infinite loop or it kept selecting files from the same directory. In the second case, I saw that with each iteration of the outer while loop, it would add another “/” between the path and the filename when it displayed the selected file. I don’t think it actually affected the actual operations on the file, only how it displayed in the terminal.

I finally gave up on the idea although I would like to eventually figure it out. But I did make a couple of tweaks to the original script. In the case statement, I added a choice to quit the script and break out of the loop. Now “Y/y” accepts the selected file and breaks out of the loop while “Q/q” rejects the file and breaks out of the loop. Any other key rejects the file and continues the loop to select another directory and file.


Non-interactive script messages

I’ve got a couple computers that are running most of the time but I don’t actually get on them regularly so I placed a script to run updates  in /etc/cron.weekly. The script creates a log file in my home folder so I can look and see if there were any errors. I noticed the following lines in the log files:

z-update log #1
debconf: unable to initialize frontend: Dialog
debconf: (TERM is not set, so the dialog frontend is not usable.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:

z-update log #2
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
debconf: unable to initialize frontend: Readline
debconf: (This frontend requires a controlling tty.)
debconf: falling back to frontend: Teletype
dpkg-preconfigure: unable to re-open stdin:

The messages appeared following the execution of apt-get dist-upgrade. The updates seemed to have completed without error but these messages merited further investigation. I also noticed the same sort of messages when I watched the progress of updates done with Mint’s Update Manager.

It appears that the command was expecting some king of user interaction even though I’d include the -y and -q flags. My research indicated that setting the DEBIAN_FRONTEND environment variable to “noninteractive” might solve the problem so I changed that line in the script to read:

DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -yq 2>> $LOGFILE >> $LOGFILE

I checked the log file on one of the computers after the script’s scheduled run this morning and saw that the messages did not appear. Apparently, the fix worked. I can’t say this would work for others. The computers on which the messages appeared are both running Linux Mint 18.3.

%d bloggers like this: