Saturday, September 23, 2017

OpenDNS IP Updater for Dynamic Networks - ddclient in Debian

I've been trying out OpenDNS's web content filtering. This computer is used (stress tested!) by two children, and I didn't want them straying onto any nasty sites.

The only problem is that my ISP gives me a dynamic IP address- which changes now and then, and when it does, content filtering stops.

Somebody suggested a Linux IP updater.

The updater uses ddclient, so the first thing to do is to install that from the Debian repository. The installer offers a lot of configuration options, but just click through those because you're going to add a custom configuration file from the link above, replacing the one that is written to the etc/ddclient.conf file.

These are the configuration settings I used:
##
## OpenDNS.com account-configuration
##
use=web, web=myip.dnsomatic.com
ssl=yes
server=updates.opendns.com
protocol=dyndns2
login=opendns_username
password=opendns_password
opendns_network_label
DNS-O-Matic is an OpenDNS service that detects your IP address- which is then fed to the OpenDNS server and updated if it has changed. (You change the checking interval by editing /etc/default/ddclient).

(In Debian at least the default setting seems to be for ddclient to run as a daemon, and there doesn't appear to be a need to add anything to start it.)

Login=the email address that serves as your OpenDNS login: joebloggs@gmail.com.

Password=your OpenDNS password, inside single quotes:'password$' (Apparently ddclient is written in Perl and special characters must be in quotes in Perl, and OpenDNS insists on at least one special character in password.) *see warning below.

opendns_network_label is the name you have given to your network on the OpenDNS settings page: for me it was Home. (NB If you have spaces in your network label, they must be replaced by underscores.)

So the final three lines were:
login=joebloggs@gmail.com
password='password$'
Home
You can test if the updater is working by running
# ddclient -verbose -file /etc/ddclient.conf
For me the updater didn't work at first- my IP address changed but OpenDNS wasn't updated.The above command gave the following error message:
updating: authorization failed Unauthorized FAILED
After an hour or two of Googling, I eventually stumbled upon a solution at DynDNS Community Forum: *apparently ddclient doesn't handle special characters well (even in quotes), and I had several in mine.

I changed my password for something with only one special character (a boring old $- they seem to be acceptable), and my IP address was updated in the OpenDNS settings, so everything seems to be working OK now.

Thursday, April 20, 2017

Can't reply to comments in Blogger?

You'll need to enable third party cookies.

Update:

In Google Chrome, you can add an exception for third party cookies in Privacy > Content settings, rather than allowing all.
In Firefox I found that it was Privacy Badger causing the problem by blocking the blogger.com cookies. Moving the slider to Allow fixed the problem.
I had already allowed third party cookies in Firefox, because blocking them caused a problem on a particular website (can't remember where), but it is also possible to block them and add exceptions in Preferences >Privacy > History > Use custom settings for history.

Update 2:

If you have blocked third party cookies in Firefox, add an exception for https://blogger.com:
Note: https

Stop code: NTFS file system

"Your PC ran into a problem and needs to restart."

Over and over again- the dreaded boot loop.

Here's how to fix it*. (The bad news is you'll need access to another Windows 10 computer, assuming you haven't already created a Windows 10 installation DVD or USB drive.)
  • Set the computer to boot from USB or DVD, depending on the media you created, either from the BIOS, or by tapping F8 while booting, which on this computer gave me boot medium options.
  • Boot from the Windows Media DVD or USB drive you created. 
  • Click on Repair your computer at the bottom left of the window. 
  • Click on Troubleshoot > Advanced Options > Command prompt
  • Type in "diskpart" and wait a few seconds. 
  • In Diskpart, enter "list vol". 
  • Look for the volume label of the main partition on the HD- it will be NTFS and many GB. On this computer it was E.
  • Type "exit" to get out of Diskpart. Run Chkdsk on the main partition. In this case it was "chkdsk e: /f"
Thanks to td512 at superuser for the info which helped me identify the correct drive letter to use.

* The root cause may be an interrupted power supply or a failing hard drive. In this case I suspect a faulty power cable. If disk errors are the result of a failing hard drive, the fix may be temporary.

Saturday, April 15, 2017

Low volume on YouTube in Firefox on Debian Stretch

I was watching a couple of videos on YouTube today, and noticed that the volume was very low, even with the volume controls in YouTube and Gnome turned up to full.

I found the solution was to go to Sound settings and click on the Application tab. Firefox output is via CubebUtils, the level of which was set much lower than the main output volume.
Raising the output level of CubebUtils until it matched the main output volume resulted in a much louder volume, with CubebUtils output rising and falling in sync with the main volume control up to 100%.
I don't know whether the low output setting for CubebUtils was the result of one of the less technically minded users of this computer meddling with the settings (one of the main users is only three!), or the result of an update to Firefox or Debian, but if you too are suffering from the same issue, maybe this post will help.




Tuesday, April 11, 2017

Battery critical settings in Gnome

There used to be a setting in Gnome Power Management Preferences which would change the action when the battery was critically low: suspend, hibernate, shutdown.

If you have looked for such a setting today in Gnome 3, because, for example, your laptop doesn't come out of suspend, you won't have found one.

You might have looked on the internet for how to change the setting, and found advice to use dconf-editor and browse to org > gnome > settings-daemon > plugins > power, only to find that there is no setting for critical battery action any more.

If you are lucky, you might have put the right search terms into the search engine of your choice and found that you now have to edit /etc/UPower/UPower.conf.

askubuntu


Sunday, March 19, 2017

Bluetooth in Debian Testing (Stretch)

I wrote previously about how Bluetooth file transfer from an Android mobile phone doesn't work in Debian Testing (Stretch), and gave a workaround I'd found.

The issue is a release critical bug, still open at the time of writing. However, there is a permanent fix available.

Obviously if you are installing Debian Stretch after this date, the bug may have been fixed, but here is the fix for anybody who needs it:

# systemctl --global enable obex

 Arch Linux forum was where I found it- thanks go to them.

For me, file transfer does not work unless I have the Bluetooth settings dialogue window open.
As the Gnome help for Bluetooth doesn't seem to have been updated since Gnome 2 (!), I have no idea whether this is a bug or a feature.

Monday, January 23, 2017

Debian stickers

I bought some Debian stickers a few years ago for my laptops, and wanted to get one for my new computer, but the company I purchased them from doesn't seem to exist any more.

I found another company selling them, but the minimum order was just under $10- too much to pay.

Then I found what I wanted on Ebay for just over a quid, including postage.

Lenovo C20 running Linux- A quick review

All-in-one computers don't need space for a tower (I don't have space for a tower), but the ones I've seen before have been quite expensive. Now there are all-in-one PCs available at the sub-£300 price. I bought a Lenovo C20 for £290 and installed Linux on it.

I installed Debian Stretch alpha because Debian Stable is getting a bit long in the tooth, this is not going to be a work machine and I much prefer Gnome 3.22 over 3.14. The usual warning applies: Stretch is still in Testing, so there may be bugs.

All I had to do to install was to disable Secure Boot after tapping F1: the computer was set to boot in EFI mode, and the Debian installer identified and used the EFI partition.

During installation I was warned about missing firmware, but enabling non-free repositories and installing the iwlwifi and realtek firmware got my hardware working.

I also installed firmware-linux and firmware-linux-nonfree, the latter giving me the microcode for my processor.

The only errors so far are these warnings, which seem to be a mismatch between kernel and firmware, and don't actually mean that Wifi dosn't work.
firmware: failed to load iwlwifi-7265D-24.ucode (-2)
Direct firmware load for iwlwifi-7265D-24.ucode failed with error -2
firmware: failed to load iwlwifi-7265D-23.ucode (-2)
Direct firmware load for iwlwifi-7265D-23.ucode failed with error -2
General comments: the screen on this version of the computer is excellent- full HD- but other versions with the same model number have a lower resolution screen. the processor used also seems to vary. Performance as a family computer- web browsing, word processing, watching videos- is fine. I haven't tried it with anything taxing. The onboard speakers are good too, so I could do away with the external speakers I had on the shelf above my old laptop. Printer/scanner setup was very easy. Even Suspend works.

All in all, an excellent all-in-one, if you are looking for a Linux friendly family computer.

I shall now abandon it to Peppa Pig, Horrid Henry and Barbie movies, for intensive testing by small children. At least I have my laptop to myself now.

Sunday, January 22, 2017

How often to clean a laptop fan?

I recently noticed the fan on my "new" laptop was making a slight noise. It's always been very quiet before, so I decided to take a look inside. Here's what I found:
Looking back, I realised that the laptop was almost two years old. So, to answer the question in the title to this post, every six months to a year, probably. Don't leave it till you hear excessive fan noise, because the fan in the picture above has obviously been working very inefficiently for a long time before I noticed the noise.

In case anybody needs to know how to clean the fan on a Toshiba Satellite C50D-B-120, here's how to do it:

  1. Put the machine on its lid and take out all the screws in the back (you'll need a magnetic screwdriver to lift them out).
  2. Pull out the battery and the dummy CD/DVD drive (or the real drive, if you have a more expensive model).
  3. Lift up the case back by putting your fingers inside the CD/DVD drive housing and pulling up. The case back will pop up. Continue to pull up as the case back clicks open towards the other side of the case.

I cleaned the fan with an air duster. Stop the fan from spinning while you dust it to avoid damage. I also used a paint brush to clean the fan vanes because they were still dirty even after blasting with air, and then gave them another air dusting. Don't forget to clean the accumulated dust off the inside of the case back too.

Refitting is the reverse of the instructions above. The case back will need pressing into place round its edge.

Which leads me to the question: why do laptop manufacturers make it so difficult to clean a laptop fan when it is something that needs doing regularly?



Saturday, January 21, 2017

EFI Vs BIOS

I have a new computer, which came with Windows 10, and I wanted to install Debian on it. With my previous laptop, I ended up wiping the disk, destroying the EFI partition, using BIOS emulation and a MBR, whether by my clumsiness or the installers (Jessie) I don't know.

Since then I've been wondering: is there any advantage to an EFI install? Should I at some point recreate an EFI partition on my laptop and reinstall Debian (it has been working well for- checks- almost two years)?

So now I was wondering, shall I do the same thing with the new computer? Or try an EFI install keeping the EFI partition?

Is there really any advantage to EFI, beyond handling 2TB disks that computers don't come with yet, at least in my price range?

I found this from Rod Smith at ask ubuntu:

There are several advantages to GPT:
  • Supports disks larger than 2TiB. 
  • Supports partitions larger than 2TiB. 
  • Supports more than four partitions, with no distinction between primary, extended, and logical partitions. 
  • Uses GUIDs as type codes, which means there's less risk of conflicting/duplicate codes. 
  • Uses LBA addressing exclusively, compared to MBR's dual use of LBA and CHS. (Even on MBR, CHS is useless on disks over about 8GB, though, so there's little risk of real conflict on modern hard disks, which are much bigger than this.) 
  • Provides duplicate partition table structures at the start and end of the disk, which makes recovery from some types of user errors, bugs, and disk damage possible. 
  • Provides checksums of important data structures, which enables detection of some types of partition table damage. 
  • Provides a UTF partition description field, so you can give your partitions names. Note that this is independent of the name of the filesystem contained in the partition. 
  • Is used natively by EFI/UEFI firmware.
"Most of these advantages are minor ones for most installations", as Rod says. So no reason to reinstall on the laptop I think, but worth trying an EFI install on the new computer.

In the end, the install was very easy: whether down to my expertise or the installers, this time I do know- the Debian Stretch (alpha) installer identified the EFI partition and used it.

So, it looks like EFI wins, by a hair, and if it doesn't work, and BIOS emulation is available, it's not that much of a big deal to use it, unless any of the above issues are of vital importance.