October 11, 2016

Quick and Dirty Install SyncThing in Debian with a Systemd Service

Sync
I really like BTSync (aka “bittorrent sync” aka “Resillio”). It was a god-send considering a wanted to sync files between multiple computers and NAS, but did not want to store them in the cloud (read as: These are not he DropBoxes you are looking for.) I first tried AeroFS for a short stint, but the vendor soon shifted focus from individual to team/business oriented support. BTSync was released during this time.

I’ve been using BTSync for 2 years now. I stayed at v1.x all this time. BTSync is exactly what i want and has been working great.

When I recently had my work notebook replaced, I decided to “upgrade” BTSync to v2. I seem to likeed it more – the interface worked a little better, so i decided to upgrade BTSync on my Synology Diskstation to v2 also, but it failed to run at all . I seem to be stuck with v1.4.11. Let me be clear, v1 is not bad; It does work. But sometimes, i just can’t live with older, obsolete, and unsupported software. Also, I don’t believe the bittorrent team are freedom-hating, but it is certainly closed-source.

I’ve researched the file-syncing subject many, many, times. On several occasions, I was super close to trying open-source (freedom-loving) Syncthing, but at various times it was not quite ready. Well this time, after looking at it again, it was ready. And so was I.

So here is the quick and dirty install for debian/ubuntu with a systemd service:
(Note: If you are not using systemd, or are using an alternate OS, then there are other service options. )
# install syncthing as per http://apt.syncthing.net/ instructions
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
echo "deb http://apt.syncthing.net/ syncthing release" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt-get update
sudo apt-get install syncthing

# create new service file via syncthing's systemd "system" file:
sudo curl -o /etc/systemd/system/syncthing@.service https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-systemd/system/syncthing%40.service
sudo curl -o /etc/systemd/system/syncthing-resume.service https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-systemd/system/syncthing-resume.service
# enable and start the syncthing per-user service user=$(whoami) sudo systemctl daemon-reload sudo systemctl enable syncthing@${user} sudo systemctl start syncthing@${user} systemctl status syncthing@${user} #launch web-UI xdg-open http:127.0.0.1:8384

To install on Synology DiskStations, use the SynoCommunity package repository.

I won’t go into the setup, but some key things are the following:

First, be sure to set a “GUI Authentication User” and “GUI Authentication Password” via the Actions>Setting menu, then restart the service.

Next, it is important to understand that a Syncthing relationship is different than BTSync. Rather than a single key that enables syncing as with BTSync, in Syncthing you will add “devices” to each system and specific share folders. You are required to add these “both-ways“. For example for two systems to sync, you will add device A to your device B, and vice-versa. If you wish to sync between three devices, device A will need both device B and C added; device B will need both device A and C added; and finally device C will need both device A and B added. During this, you may need to create the folders before-hand, and pay special attention to the folder ID (key) provided by Syncthing, as it must be the same on each end-point.

Also, I was certainly having some sync/connection issues, and after much troubleshooting, it seemed IPv6 was stopping IPv4 from being the preferred connection method. There is no documentation stating a defacto way to disable IPv6, but after reading https://docs.syncthing.net/users/config.html, i tried setting my “Sync Protocol Listen Addresses” to simply tcp://0.0.0.0, which seems to be the equivalent of saying “use IPv4 on all interfaces.” I am still uncertain if this is necessary or even proper, so use with caution. In fact, I'd recommend do not do this yourself.

With both BTSync and Syncthing, the software repeatedly scans files for hashes, and if changed, will sync updates.  These computations are a heavy burden on an ARM based NAS such as the Synology. Syncthing's default scan interval is 60 seconds.  Every 60 seconds it will scan a sync-folder for changes -- this caused my Synology to continuously thrash the disks.  In an effort to reduce this heavy activity, i went to the advanced settings, chose my folder(s) and set rescanIntervalS to 900 seconds (15 minutes). Since my Synology is more of a backup device and I do not edit these files directly, this is a much better sync-interval.

You should certainly visit the Syncthing Documentation for your needs. Also, You may or may not need to open or port-forward TCP 22000 and UDP 21027 depending on your network environment.

As always, Good Luck!

- - -


Please consider crypto tipping:
  

October 07, 2016

OpenShot 2.1 crashing on export in Debian 8 Jessie | ShotCut 16.10 for the Win

film-icon

edit: OpenShot 2.4.x works now, but i'm still a ShotCut fan using v18.x

EPIC FAIL | Story time…
 
OpenShot v2.1 is an opensource video editor that everyone is raving about. It was super easy to get a project going and i really liked the ease of use. But I’ll be damned if i could export any video without a crash.

All my research suggested i needed newer version of ffmpeg and mlt. However, every time i tried installing newer packages from jessie-backports, it just did not work with any useful explanation.
 
$ sudo aptitude -t jessie-backports install ffmpeg libmlt6
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

It turns out there are commands that could help. Essentially you need to find package dependencies. Enter aptitude why <package-name> or alternatively apt-cache --installed rdepends <package-name> .

aptitude why ffmpeg ; aptitude why libmlt6 reported their dependencies. After a few runs and a few un-installs (sudo aptitude remove flowblade openshot kdelive) I was able to install newer ffmpeg and libmlt6 from jessie-backports. Afterward I was able to re-install the above-mentioned removed packages.

It was s good learning session, but as it turned out OpenShot still crashed for exports – each and every time. I’ve also installed every possible codec to no avail.

So I was back to re-testing alternatives:
- Lightworks was too confusing; I really wanted this to work, but i don’t have that kind of time for the learning-curve right now, although I hope to graduate to it.
- Blender was far beyond overkill. This is primarily for animation, but also does simpler video edits. I want something normal people can use. (Not that I’m claiming to be normal)
- I didn’t get very far with Kdenlive either. I think I didnt give it a real good go, but none-the-less I moved on.
- Avidemux was way too simple for this project, but is super good for quick chops.
- FlowBlade v1.8 almost did it, so close, but i never had enough frames for successful crossfades (disolves).
- ShotCut v16.10 won! It just worked, every time! – Crossfade and export worked for my first project without complaints nor crashes. Thank you ShotCut Team!

Please consider crypto tipping:
  

October 03, 2016

Google Earth 7 Search function crashes in Debian

GoogleEarth
It pissed me off countless times, and searching for a solution was a needle in a endless mega-haystack until I found the damned sliver of pointy doom.

Everytime I searched in Google Earth 7.x in Debian, it crashed with something similar to the following:

[1003/095907:WARNING:backend_impl.cc(1875)] Destroying invalid entry.
*** Error in `./googleearth-bin': free(): invalid next size (fast): 0x0000000009398d30 ***
*** Error in `./googleearth-bin': realloc(): invalid next size: 0x0000000009398e70 ***

http://www.webupd8.org/2016/09/google-earth-for-linux-update-brings.html has the solution.

No more Google Earth Search crashes! Thank you webupd8 team!!!



Please consider crypto tipping: