Category: Tech Tips

A is for Aardvark: First Impressions of 17.10

My usual way to test the water with a new release of Ubuntu is to install it on a spare computer. I keep one old PC around the place for just that purpose. I was doubly cautious this time because there were big changes in the latest build. The Unity interface was gone. The return of Gnome was upon us.

I might be in a minority of one, but I liked Unity. I know opinion varies greatly, but for me it was neat to have my most often used apps and tools held in an auto-hiding dock at the side of the desktop. Right-clicking the icons in the dock gave access to a menu of related options. Right click the file browser icon, for example, and any folder favourites that you’d made in Nautilus were presented in a context menu. So to go to any of your frequent folders you just had to move the mouse over to the left hand edge of the display, right-click the file browser icon and choose the folder from the menu that appeared. Simple, and fast. It suited me, and it is now ingrained into my muscle memory.

So, I wasn’t looking forward to making the change to Gnome. There’s nothing wrong with Gnome. It’s a great desktop. In fact, it is what I used before Canonical swapped to Unity. My worry was I could foresee a lot of frustration as my hands moved on auto-pilot to access functionality that was no longer available.

Despite my misgivings, the transition from Unity to Gnome has been more or less painless. The interface is clean and sharp, and fast. Everything seems faster. There is a dock on the left hand side of the screen, much like its predecessor. It auto-hides, but only if it is going to be obscured. The Unity dock could be set to auto-hide once you’d finished with it. But, as long as the new one gets out of the way of the desktop when the real estate is required, I can live with that.

The first difficulty I ran into was due to Wayland, the new display graphics server. This replaces the venerable Xorg. Sometimes I could log in. I would enter my credentials at the log in screen and then be returned to the same log in prompt. A reboot sometimes did the trick and would let me back in, other times it wouldn’t. Luckily you can swap back to the Xorg system (there’s a cogged wheel on the log in screen that allows you to revert to Xorg). That sorted that issue out. I could log back in.

I made a note of that trick, so that I could repeat it when (and if) I put 17.10 on my main machine.

I installed my usual toolset (I have a script that installs all of the software I use) and checked that they still operated under 17.10 and that my workflow wouldn’t be broken if I put 17.10 on my main machine. All of the tools and packages I use worked just fine. I’d expected to have to make a few a few tweaks in order to get things running as I like them to, but no, the packages were happy. All my compile and build tests worked flawlessly.

I did have to adjust a few things within Ubuntu itself though. Some to provide fixes, some because of personal preferences.

I access a share on a NAS via Samba. I had to add Vers=1.0 to the options in the line in my fstab file that auto-mounted the share on the NAS. If I didn’t do this it didn’t mount. When I tried to access it I got an error message saying that only Root could mount the share. This little addition to my options list fixed that issue.


//ip_address/Backup path_to_NAS/NAS cifs credentials=/etc/samba/user,noexec,vers=1.0,sec=ntlm 0 0

That was the only big issue I hit, so I installed 17.10 on my main machine. I always do a backup, a complete new install, then restore my data and .folders. I bit the bullet and blitzed the laptop. Post install I reverted to Xorg, and sorted out the issue with Samba. After that there were a few little tweaks for my personal preferences.

Gnome has the window min, max and close buttons on the right of the menu bar. I am so used to them being on the left I had to change them over. Installing Gnome Tweaks allowed me to do that.

I used Settings to make the dock auto-hide, and made the icon size smaller.

Dock Settings in Settings
Dock Settings in Settings

I added a UK keyboard to the list of Input Sources in the Region and Language tab of the Settings tool. (My laptop keyboard is US layout, my Cherry Keyboard is UK layout. I need to switch between the two.)

Adding UK Keyboard Layout in Settings
Adding UK Keyboard Layout in Settings

I used the Tweaks tool to move the window buttons to the left.

Windows Buttons in Tweaks
Windows Buttons in Tweaks

I used the Additional Drivers tab in Software and Updates to select the NVidia binary driver.

Additional Drivers in Software and Updates
Additional Drivers in Software and Updates

So far so good. No major issues, and the desktop switch from Unity to Gnome has been painless. It’s early days, let’s see how we go.

Tags : , , ,

Teamviewer 12 and Ubuntu 16.10

I use TeamViewer to hop onto a couple of my friends and family member’s PCs to provide occaisional tech support. I couldn’t get TeamViewer 11 to run no matter what I tried, but the following sequence worked for me with TeamViewer 12.

On my 64bit box I had to tell it to add the files to allow it to run 32bit software.

sudo dpkg –add-architecture i386
sudo apt-get update

Then I created the following script. I named it deps.sh. Put the following text into a file and save it and name it what you want, then set it to be executable (right click and select properties and set the appropriate check box).

#!/bin/bash

sudo apt-get install libdbus-1-3:i386
sudo apt-get install libasound2:i386
sudo apt-get install libexpat1:i386
sudo apt-get install libfontconfig1:i386
sudo apt-get install libfreetype6:i386
sudo apt-get install libjpeg62:i386
sudo apt-get install libpng12-0:i386
sudo apt-get install libsm6:i386
sudo apt-get install libxdamage1:i386
sudo apt-get install libxext6:i386
sudo apt-get install libxfixes3:i386
sudo apt-get install libxinerama1:i386
sudo apt-get install libxrandr2:i386
sudo apt-get install libxrender1:i386
sudo apt-get install libxtst6:i386
sudo apt-get install zlib1g:i386
sudo apt-get install libc6:i386

In the folder where you saved your file, execute it. My file was called deps.sh so the command I used was

sudo ./deps.sh

Expect errors. To rectify the errors run the following command. It’s the -f (force) flag that does the magic in this case.

sudo apt-get -f install

Then in the folder you’ve downloaded the TeamViewer deb into run the following command (substitute the appropriate deb filename if it is different).

sudo dpkg -i teamviewer_12.0.71510_i386.deb

That worked for me, TeamViewer fired up and connected as expected. If you’re having difficulty with TeamViewer and Ubuntu 16.10, hopefully these steps might work for you too.

Tags : , ,

RaspberryPi and Pushbullet Notifications

I posted previously about using Twlio to get an RPi to send text message notifications to me using a Twilio trial account. These trial accounts used to keep going unless you stopped using them for a period of time, but now they time out like most trial accounts do.

I scouted around looking for another notification method. I didn’t want to use email. I’d previously used sSMTP with some success, but I wanted to try something different.

Pushbullet is working well for me. You can get a free account, and apps for Android and Apple. Once you’ve got your free API authentication key you can make web requests to the Pushbullet service and they’re delivered to your mobile.

I use the cUrl app to make the requests. If you need to install it, you can do so by entering this command in a terminal. (For other unrelated purposes, I also incorporate cUrl into some applications I develop, so I always install the libcurl3 development libraries as well. If you don’t need them you can leave them off the command. For completeness, this is the command I use to install all things cUrl on my boxes.)

sudo apt-get -y install curl libcurl3 libcurl3-dev

Then I create shell scripts similar to the following which can be called by other scripts or applications, or triggered by cron.

In the title= parameter, it is often convenient to use the name of the process you’re reporting on, or the name of the RPi or PC it is running on.

#!/bin/bash

API="enter your API key here"
MSG="This is where you would put your message text"

curl -u $API: https://api.pushbullet.com/v2/pushes -d type=note -d title="Message Title" -d body="$MSG"

Nice and simple, and free.

Tags : , ,

Nautilus Showing Hidden Files By Default

Out of nowhere, each time I opened Nautilus it was showing hidden files by default.

If I used Ctrl-H to hide them they went away. But next time I opened Nautilus, they were back. This was a global issue, not something goofy with a single folder. So the issue seemed to reside with Nautilus itself.

I found a way to correct it by using the dconf-editor application. Open dconf-editor (you may need to install it first, it isn’t a default part of Ubuntu 16.04) and navigate to org, gtk, file-chooser and then uncheck the show-hidden checkbox.

dconf-editor

Tags : ,

Reigning in the Dash

The Dash in Ubuntu 6.04 had decided to come up in full screen mode every time I opened it. This wasn’t what I wanted. After a period of Googling (during which I was surprised to discover that most questions on the Dash were asking how to make that the default behaviour) I found the command I was looking for:

gsettings set com.canonical.Unity form-factor Desktop

Entering this in a terminal forces the Dash to adopt my preferred fashion, taking up the top left of the screen only.

Dash

Tags : , ,

Google Earth and Ubuntu 16.04

After upgrading to 16.04 (for upgrade, read wipe and re-install) I needed to re-install all my applications. I have a shell script that runs through them and installs them in one quick batch, which is great.

There’s one package that requires manual intervention and I haven’t found a way round that, so I set that to be installed last. When I leave my shell script running and come back to it, it’ll be sat waiting for the few options to be selected in this particular package, and then I’m done. That package is the ttf-mscorefonts-installer package that installs some of the common Microsoft TrueType fonts.

From a backup, I drag back in the appropriate dot folders and files and pull back in my data and that’s it, we’re good to go.

Apart from Google Earth.

Desktop with Google Earth

To install Google Earth in Ubuntu always seems to require a special incantation, and that incantation changes (in my personal experience, your mileage might vary) for each new version of Ubuntu. It’s a pain, because it means it can’t be automated.

Anyway, after the usual period of research and frustration (do people even test the instructions they post online?) I whittled the required steps down to this sequence below.

To be specific, this loaded Google Earth onto Ubuntu 16.04 on an Asus R500V core i7 laptop with an nVidia Geforce 610m graphics card. It has been tested on two other lower-spec dekstop PCs.

You need to download these packages first:

http://ftp.us.debian.org/debian/pool/main/l/lsb/lsb-security_4.1+Debian13+nmu1_amd64.deb
http://ftp.us.debian.org/debian/pool/main/l/lsb/lsb-invalid-mta_4.1+Debian13+nmu1_all.deb
http://ftp.us.debian.org/debian/pool/main/l/lsb/lsb-core_4.1+Debian13+nmu1_amd64.deb

Then open a terminal and cd to the folder containing the downloaded files and install them one after the other.

sudo dpkg -i lsb-security_4.1+Debian13+nmu1_amd64.deb
sudo dpkg -i lsb-invalid-mta_4.1+Debian13+nmu1_all.deb
sudo dpkg -i lsb-core_4.1+Debian13+nmu1_amd64.deb

If you have any dependency issues this should fix them (although on my box it didn’t appear to do anything at all).

sudo apt-get install -f

Reboot, then go to the following page and download the Google Earth .deb. Note that although I have a 64bit machine and 64bit Ubuntu, I had to use the 32bit .deb package.

http://www.google.com/earth/download/ge/agree.html

Install the downloaded file. Substitute the name of the file you’ve downloaded, the 32bit .deb is shown in the example below.

sudo dpkg -i google-earth-stable_current_i386.deb

That should be it. Google Earth should now run. It is still a bit flaky trying to show the embedded Panorama photographs, but that is a feature I never use anyway. If I find a way to make that work I’ll post it here.

Tags : ,

Sending SMS Texts from a Raspberry Pi or Ubuntu Box

[Edit] It seems that Twilio trial accounts timeout after all. They used to keep going so long as you didn’t go 30 days or more without using it. So this was a short lived success. I’ll look for alternate solutions.

I wanted a simple and free way to send texts to myself from one of my Raspberry Pi’s. The Pi is running the Jessie release of Debian. Debian, as the universe and its dog knows, is the OS that Ubuntu is built on, so these instructions apply to Ubuntu as well. I have tested on Ubuntu 15.10 and 16.04.

I got my Pi to send texts to my mobile using a free account from Twilio. Twilio is a Platform as a Service (PaaS) company based in California. Their platform and API’s allow developers to build applications that can make telephone calls, send text messages and much, much more.

Of course, for all of this goodness there is a charge. This is a paid for service. But luckily for me, you can get a free trial account. And although it is a trial it seems to run forever, unless you stop using it for a thirty day period. There are restrictions, naturally. You can only send out to one mobile phone number, for one thing. I only wanted to send to one number (my own mobile phone) so that was perfect for me.

To get your Ubuntu box or Raspberry Pi to send texts you need to register with Twilio and sign up for a free account. You will have to nominate the mobile number you’re going to text out to. Twilio verify this number by sending a code to it that you need to enter back into the website during the registration process. Once you have completed the registration you will get three things. One is a virtual phone number that the texts will be sent from. The other two are an account Id and an API authentication token. You’ll need all three of these to make the API call that will send the text.

You also need to have Pyhton, pip and Twilio installed on your system. Most systems will have Python and some will have pip (my Pi did, my Ubuntu did not). You will need to install Twilio as well. If any of these are missing from your system, you can install them with:

sudo apt-get install python
sudo apt-get install python-pip
sudo pip install twilio

The minimum Python script that you need to send a text is shown below (with my details obscured). Of course, you need to replace the account=, token= and from= and to= values with your own account ID, authentication token, virtual telephone number and the number that you want to have the text sent to. This last one must be the mobile number you verified during the Twilio registration process.

import os

from twilio.rest import TwilioRestClient

client = TwilioRestClient(account=’AC79******************************’, token=’d2b*****************************’)

client.messages.create(to=’+4478********’, from_=’+4412********’, body=”Hello, World!”)

In a worthwhile script you’d probably want to include logic in it that queried the system parameters that were of interest to you. It would then compose the content of the text body into something valuable. But even a simple script like this with a single, unchanging message could be used as a sort of system heartbeat check if it was inserted into a scheduled Cron job.

So, to recap. Register with Twilio. Get your account details. Install Twilio. Enter your details into the above script, and save it as (say) send_text.py.

invoke it as follows

python send_text.py

And you should receive a text on your mobile.

Tags : , ,

Stop Google Chrome From Asking to Make it the Default Browser

I had a strange problem show up out of the blue on Ubuntu 15.10 with Google Chrome Version 46.0.2490.80 (64-bit). It kept saying it wasn’t the default browse. It opened the ‘Set as default / Don’t ask again’ dialog each time it started.

In the Ubuntu Default Applications dialog Chrome was the default browser, but it still prompted every time it started. It got old real fast.

I did a bit of digging and found a workaround. Edit

~/.config/google-chrome/Default/Preferences

..and change the following:

“check_default_browser”: true

to be:

“check_default_browser”: false

Save the file and reboot.

Until a bug fix comes round that’ll have to do. The same thing is currently happening with Chromium too.

Tags :

The Case of the Vanishing Cursor in 15.04

I’d been having an issue in 15.04 with Nvidia graphics where the cursor vanished when it was pushed right to the top of the screen. Using menus or closing maximised windows was tough. I eventually found a solution in this bug listing.

Near the bottom there is an entry by Heath Jones (hjones014) from the 2015-05-18.

He says:

“I finally remedied the problem, using the xorg-edgers ppa. This is what I did –

1. sudo apt-add-repository ppa:xorg-edgers/ppa
2. sudo apt-get update
3. goto additional drivers and select driver 349.16
4. reboot
5. goto software/updates and goto the “Other Software” tab and UNCHECK the xorg-edgers ppa. I DID NOT PURGE THIS PPA.

The reason why I nixed this ppa is because after selecting driver 349, the software updater would try to pull in other updates from the xorg-edgers ppa which kept crashing my system. This allowed me to keep the driver 349 and not pull in any other updates. If you do a ppa-purge, it will also nix the driver, hence why i just unchecked it in the sources tab.”

I followed those instructions and it worked for me. Hopefully it’ll help someone else.

Tags : , ,

Restarting the Printing Daemon

I’ve got a recurring issue with my laptop, that even a recent re-install didn’t cure. Periodically, but thankfully not too frequently, when I attempt to print from within an application such as LibreOffice, none of my printers are listed. I haven’t got to the bottom of it yet, but I have a recovery step that doesn’t take much to perform, so it hasn’t become too much of a pain yet.

The quick remedy (but alas not the cure) is to execute the following in a terminal window:

sudo /etc/init.d/cups restart

Straight away my printers are back. I’ll dig deeper into it once I get a spare hour or two.

Tags : , , ,