SOLVED: Garmin etrex Vista shows wrong date

I recently picked up an old Garmin etrex Vista handheld GPS at a swap meet for a dollar.

I took it home, put some batteries in it, and fired it up.

It took some time to synch up with the satellites. (No surprise.)

The time of day was correct. The date was incorrect.

I remembered the GPS week rollover that happened in 2019 - https://en.wikipedia.org/wiki/GPS_week_number_rollover

After doing some research, I thought I would use gpsbabel to reset the time using:

gpsbabel -i garmin -f /dev/ttyUSB0 -o garmin,resettime -F /dev/ttyUSB0

I dug out the USB-to-RS232 adapter I used to use to capture bike rides and hikes to upload to Strava in the days before GPSes were integrated into phones.

The hard part was getting gpsbabel to successfully open /dev/ttyUSB0.

I followed all kinds of instruction to try to get it to work. You probably will at least need to do the following:

sudo chmod 666 /dev/ttyUSB0
ls -l /dev/ttyUSB0
sudo usermod -a -G dialout $USER

Not 100% sure about this, but odds are you need this too (it matches the Garmin standard);

stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb -echo ixon ixoff -crtscts

I doubt this was necessary (module wasn't running):

sudo rmmod garmin_gps

But no matter what I tried, I kept getting this:

$ sudo gpsbabel -i garmin -f /dev/ttyUSB0 -o gpx -F /tmp/test.gpx
[ERROR] XSERIAL: Cannot open serial port '/dev/ttyUSB0': Permission denied
[ERROR] Cannot open serial port '/dev/ttyUSB0'
garmin: Can't init /dev/ttyUSB0

I put the Garmin aside, and set about diagnosing the serial connection. I installed minicom. minicom had no such trouble. I happened to have two USB-to-RS232 adapters, a null modem cable, and a spare laptop. After installing minicom on the laptop, I was able to verify serial data transfer between the two computers.

At this point, I just couldn't understand why gpsbabel couldn't open the serial port. Neither with nor without sudo.

I decided to have a look at the dmesg output. I noticed some messages which reported my connecting/disconnecting/reconnecting the USB-to-RS232 adapter. And then, ... I saw messages containing apparmor="DENIED" every time I ran gpsbabel:

$ sudo gpsbabel -i garmin -f /dev/ttyUSB0 -o gpx -F /tmp/test.gpx
[ERROR] XSERIAL: Cannot open serial port '/dev/ttyUSB0': Permission denied
[ERROR] Cannot open serial port '/dev/ttyUSB0'
garmin: Can't init /dev/ttyUSB0
gerard@karkand:~$ sudo dmesg | tail -200
.
.
.
[1902124.279578] usb 1-4: USB disconnect, device number 10
[1902124.279996] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[1902124.280054] pl2303 1-4:1.0: device disconnected
[1902126.348088] usb 1-4: new full-speed USB device number 11 using xhci_hcd
[1902126.472073] usb 1-4: New USB device found, idVendor=067b, idProduct=2303, bcdDevice= 4.00
[1902126.472092] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[1902126.472098] usb 1-4: Product: USB-Serial Controller D
[1902126.472102] usb 1-4: Manufacturer: Prolific Technology Inc.
[1902126.475394] pl2303 1-4:1.0: pl2303 converter detected
[1902126.476893] usb 1-4: pl2303 converter now attached to ttyUSB0
[1902258.415523] kauditd_printk_skb: 2 callbacks suppressed
[1902258.415529] audit: type=1400 audit(1780259665.620:715): apparmor="DENIED" operation="open" class="file" profile="snap.gpsbabel.gpsbabel" name="/dev/ttyUSB0" pid=256590 comm="gpsbabel" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0

I researched that and found that this is a symptom of running the gpsbabel Snap - it is a security restriction. So I removed the gpsbabel Snap and installed with apt install instead:

snap remove gpsbabel
sudo apt update
sudo apt install gpsbabel

With the Garmin still disconnected, I attempted a simple gpsbabel command and got this:

$ sudo gpsbabel -i garmin -f /dev/ttyUSB0 -o gpx -F /tmp/test.gpx
[ERROR] GPS_Packet_Read: Timeout. No data received.
garmin: Can't init /dev/ttyUSB0

This was very promising; it shows that gpsbabelcan now open the serial port.

I reconnected the Garmin to the interface cable, powered it on, and ran the full gpsbabelcommand to reset the time:

gpsbabel -i garmin -f /dev/ttyUSB0 -o garmin,resettime -F /dev/ttyUSB0

This succeeded. I brought the Garmin outside and left it there for about 30 minutes. I looked at the Main Menu page and now the date was showing correctly. (I did have to adjust the Time->Time Zone to US - Pacific to correctly reflect my location.) Now the time and date are correct!


Use Audacity To Convert Multiple Files To MP3

 In Audacity, select Tools->Macros.  That brings up the Manage Macros window.

In the list of macros, select MP3 Conversion.  

Down at the bottom, where it says "Apply macro to:", click the "Files..." button.


In the "Select files for batch processing..." window, select the files you wish to convert, and click the Open button.


Emacs is adding BOM 0xFEFF to your XML file

When you open an XML file in Emacs, it tries to detect the encoding and may display Chinese characters.   If you look at it hexl-mode, you will also see that Emacs has secretly added 0xFEFF to the beginning of your file.  Nasty!

The solution (or workaround) is to use file-find-literally when you open the file.

(Ref: https://unix.stackexchange.com/questions/189061/emacs-automatically-adding-bom-to-xml-file/516465#516465)

Black Screen When Using Mac OS X Screen Sharing

Sometimes you can get stuck at a black screen when remotely sharing a screen via Mac OS X Screen Sharing.

To get unstuck, SSH into the remote machine and kill the loginwindow process.

See this article: Fix "Black Screen" on VNC

Add Border To Ubuntu Terminal Window

Create ~/.config/gtk-3.0/gtk.css

to contain

/* Decorations */
UnityDecoration {
    -UnityDecoration-extents: 28px 1px 1px 1px;
}

Ref:
https://askubuntu.com/questions/448204/how-do-i-add-a-border-around-windows-but-keep-the-current-theme

Mac OS X Finder Shows Unknown Shared Computers

Sometimes the Mac OS X Finder will show unknown computers in the Shared section of the sidebar.

These are the result of having SMB file sharing enabled.

To remedy this, go into System Preferences, Sharing, File Sharing, Options.  Uncheck "Share files and folders using SMB", and click Done.


ref: https://www.cnet.com/news/unknown-shared-resources-showing-in-the-finder/

How to subscribe to a YouTube channel as an RSS feed

1. Go to the YouTube page for the channel.

2. View the source for the page.


3. Search for 'channel-external-id'.  Copy the string for that attribute, e.g. UC5nVgiv6elz5GnS6MTr1tVA


4. Create a URL with the channel_id, like this:


https://www.youtube.com/feeds/videos.xml?channel_id=UC5nVgiv6elz5GnS6MTr1tVA


5. Use that URL to subscribe in your favorite RSS news reader.




From: How to Get an RSS Feed for a YouTube Channel

How to Disable iCloud Photo Syncing in OS X Photos


Go into System Preferences, iCloud, and un-check Photos.  Also go into Photos options and uncheck all that too.

http://www.howtogeek.com/214782/how-to-disable-icloud-photo-syncing-in-os-x-photos/

Make Emacs use bash shell path on Mac OS X

By default Emacs ignores your .bash_profile on Mac OS X.

Here's how to tell Emacs to go do a login so that your PATH customization is available to you when you M-x shell (and other shell-y things like M-x compile and M-x grep).

https://raw.githubusercontent.com/purcell/exec-path-from-shell/master/exec-path-from-shell.el

Found at :

http://stackoverflow.com/questions/6411121/how-to-make-emacs-use-my-bashrc-file


wc - pure Python implementation of classic Unix word count utility.

As part of my ongoing Python Power Tools project (a pale imitation of Perl Power Tools), I have implemented a pure Python wc.


This supports a -files0 option, so you can pipe wc.py the output of any program that produces filenames separated by null characters.  For example, find and ack, when using the -print0 output option.

Mac OS X Finder - How To Set Column Width(s)


"Right- or Control-click any grabber handle for a pop-up menu with three options: Right Size This Column, Right Size All Columns Individually, and Right Size All Columns Equally." (found here)

AT&T UVerse DNS Lookups Slow

AT&T UVerse DNS lookups were ridiculously slow.

On Mac OS X, use command line command "dig <hostname>" to test.  ("dig -h" for options.)

Solution:  Configure router to use Google DNS servers - 8.8.8.8 and 8.8.4.4.

See this Reddit.

[SOLVED] Python difflib - POSIX default format or Gnu normal format?


It seems that difflib (and its example program) do not output differences in the POSIX default format (see http://www.unix.com/man-page/POSIX/1posix/diff/) or the Gnu diff normal format (see http://www.gnu.org/software/diffutils/manual/diffutils.html#Normal).

I wrote a pure Python implementation of the classic Unix "diff" program to produce output in the classic POSIX default format:

https://github.com/glanois/code/blob/master/python/ppt/diff.py


Use ack inside Emacs

Paste this into your .emacs, reload it, and M-x ack:

;; https://code.google.com/p/emacs-nav/issues/detail?id=91
(defvar ack-command "ack --nogroup --nocolor ")
(defvar ack-history nil)
(defvar ack-host-defaults-alist nil)
(defun ack ()
  "Like grep, but using ack-command as the default"
  (interactive)
  ; Make sure grep has been initialized
  (if (>= emacs-major-version 22)
      (require 'grep)
    (require 'compile))
  ; Close STDIN to keep ack from going into filter mode
  (let ((null-device (format "< %s" null-device))
        (grep-command ack-command)
        (grep-history ack-history)
        (grep-host-defaults-alist ack-host-defaults-alist))
    (call-interactively 'grep)
    (setq ack-history             grep-history
          ack-host-defaults-alist grep-host-defaults-alist)))
 

Microsoft Word - Find Next/Previous


In Microsoft Word you can easily find the next/previous occurrence of a search string with Ctrl-PageDown and Ctrl-PageUp.

You are using the Select Browse Object controls to do this.

Details here:
http://office.microsoft.com/en-us/word-help/getting-from-here-to-there-in-word-documents-HA001042963.aspx

Outlook 2007 - Make flagged emails from a .PST show up on the To-Do Bar

Go into the .PST properties and enable "Display reminders and tasks from this folder in the To-Do Bar".  Then restart Outlook.

From this article:  Make that PST show up on the To-Do Bar

Erase Free Space on Mac OS X

In order to erase all free space on Mac OS X, use Disk Utility.

Secure Empty Trash on Mac OS X

Right-click on the Trash icon in the dock, hold down the command key, and then select "Secure Empty Trash". If you want to always securely delete files, you can enable this setting by going to Finder > Preferences and then selecting "Empty Trash Securely" under the Advanced tab.

Fujitsu ScanSnap S510 drivers for Mac

You can now use your Fujitsu ScanSnap S510 on a Macintosh.  Someone figured out that the S1500M drivers for Mac OSX will work with an S510:

https://discussions.apple.com/thread/4391068?tstart=0

Saving your eBay search as an RSS feed

eBay used to give you an orange RSS button on your search results.  That has disappeared recently.

The remedy is to add &_rss=1 to the end of your search URL.

From this article:  How to restore RSS functionality to your eBay searches

How to add an AppleTV radio station to favorites

While listening to the station, hold down the Select button on the remote.  It will ask you if you want to "Add Station to Favorites".

To remove from favorites, do the same thing again (hold down the Select button).


Outlook 2007 Remove Attachment From Email

Open the email.

On the ribbon, go to the Message tab. 

In the Actions section, select Other Actions->Edit Message.

In the body of the email (which is now editable) select the attachment. 

Press the Delete key.

From the Office menu, select Save.