Long Term Storage of Gmail/Email using Mozilla’s Thunderbird (on Linux)

I have email going back to 2003. There have been times when I have actually benefited from my email archive. Several times, I have gone back 5 or more years to look for a specific email and my archive has saved me. However, my current approach to backing up my email is, let’s say, a borderline violation of Google’s Terms of Service. Basically, I created a second email account that I use almost exclusively (not exclusively – I use it for a couple of other things) for storing the email from my primary Gmail account. However, Google has recently changed its storage policies for their email accounts, which has made me a little nervous. And, of course, I’m always wary about storing my data with Google or other large software companies.

Since I have already worked out a storage solution for old files that is quite reliable, moving my old email to that storage solution makes sense. (FYI, my storage solution is to run a local file server in my house with a RAID array so I have plenty of space and local backups. Certain folders on the file server are backed up in real-time to an online service so I also have a real-time offsite backup of all my important files. In other words, I have local and offsite redundancy for all my important files.)

I’m also a fan of Open Source Software (OSS) and would prefer an OSS solution to any software needs I have. Enter Mozilla’s Thunderbird email client. I have used Thunderbird for various tasks in the past and like its interface. I was wondering if there was a way to have Mozilla archive my email in a way that I can easily retrieve the email should I need to. Easily might be a bit of a stretch here, but it is retrievable using this solution. And, it’s free, doesn’t violate any terms of service, and works with my existing data backup approach.

So, how does it work? And how did I set it up?

First, install Thunderbird and set up whatever online email account you want to backup. I’m not going to go through those steps as there are plenty of tutorials for both of them. I’m using a Gmail account for this.

Once you have your email account set up in Thunderbird, click on the All Mail folder (assuming it’s a Gmail account) and let Thunderbird take the time it needs to synchronize all of your email locally. With the over one hundred thousand emails I had in my online archive, it took the better part of a day to do all the synchronizing.

I had over 167,000 emails in my online archive account.

Once you’ve got your email synchronized, right-click on “Local Folders” and select “New Folder.” I called my new folder “Archive.”

Technically, you could store whatever emails you want to store in that folder. However, you’ll probably want to create a subfolder in that folder with a memorable name (e.g., “2015 Work”). Trust me, it will be beneficial later. I like to organize things by year. So, I created subfolders under the Archive folder for each year of emails I wanted to back up. You can see that I have a folder in the above image for the year 2003, which is the oldest email I have (that was back when I had a Hotmail address… I feel so dirty admitting that!).

The next step is weird, but it’s the only way I’ve been able to get Thunderbird to play “nice” with Gmail. Open a browser, log in to the Gmail account you’re using, and empty your trash. Trust me, you’ll want to have the trash empty for this next step.

Now, returning to Thunderbird, select the emails you want to transfer to your local folder and drag them over the “Trash” folder in your Gmail account in Thunderbird. This won’t delete them but it will assign them the “Trash” tag in Gmail. Once they have all been moved into the Trash, select them again (CTRL+A) and drag them into the folder you created to store your archived emails. In the screenshot below, I’m moving just a few emails from 2003 to the Trash to test this process:

Once the transfer is complete, click on the Local Folder where you transferred the emails to make sure they are there:

And there are the emails. Just where I want them. This also means that you have a local copy of all your emails in a folder exactly where you want them. At this point, you have technically made a backup of all the email you wanted to backup.

To remove them from your Gmail account, you need to do one additional thing. Go back to the browser where you have your Gmail account open, click on the Trash, and empty the Trash. When you do, the emails will no longer be on Gmail’s server. The only copy is on your local computer.

Now, the next tricky part to this (I didn’t say this was perfectly easy, but it’s pretty easy). Thunderbird doesn’t really store the Local Folder emails in an obvious location. But you can find the location easy enough. Right-click your Local Folder where you are archiving the emails and select “Properties.”

You’ll get this window:

Basically, in the Location box you’ll see the folder’s location. This is telling you where to find your Local Folder where your email is stored. On Linux, make sure that you have “view hidden files” turned on in your file manager (I’m using Dolphin), the location is your home folder, followed by your user folder, then it’s inside the hidden “.thunderbird” folder followed by a randomly generated folder that Thunderbird creates. Inside that folder, look for the “Mail/Local Folders” folder. Or, simply:

/home/ryan/.thunderbird/R$ND0M.default-release/Mail/Local Folders/
I have opened all the relevant folders on my computer in Dolphin see you can see the file structure.

Since I created an additional folder, there are two files in my Archive.sbd folder that contain all the emails I have put into that folder: “2003” and “2003.msf.” You can learn more about the contents of those files here, but, basically, the file with no file extension stores the actual contents of the emails. The .msf file is basically an index of the emails (I was able to open them both in Kate, a text editor, and read them fine). In short, you won’t have a bunch of files in your archive. You’ll have two files – one with the contents of the emails and one that serves as an index of the emails that Thunderbird can read. These are the two files that you’ll want to backup.

I’ll admit, this was the part that scared me. I needed to know that I could just take those two files, move them to wherever I wanted to ultimately store them and then, when needed, move them back into my Thunderbird profile and read them just fine. So, I tested it repeatedly.

Here’s what I did. First, I clicked on my backup folder in Thunderbird to make sure all of the emails were there:

I then went into the Local Folders directory and moved the files to where I want to back them up.

I then clicked on a different folder in Thunderbird and then hit F5 to make Thunderbird refresh the Local Folders. It took a couple of minutes for Thunderbird to refresh the folder, but eventually, it did. Then, I selected the 2003 Archive folder again and the emails were gone:

This is what I expected. The emails are in the “2003.msf” and “2003” files on my backup server. Now for the real test. I copied the two backed up files back to the Archive.sbd folder in my Thunderbird profile, selected the parent folder in Thunderbird, and hit F5 to refresh the folders again. It took a minute for the folder to refresh, but eventually, when I clicked on the 2003 folder and…

The emails are back!

It worked!!!

What this means is that you can put all of the email you want to back up into a folder; that folder is stored in your Thunderbird profile. You can then find the relevant .msf file and its corresponding data file, move them wherever you want for storage and, if needed, move them back to your Thunderbird profile (or, technically, any Thunderbird profile using the same folder structure) and you’ll still have all of your email.

This may not be the most elegant method for backing up your email but it’s free, it’s relatively simple and straightforward, and works reliably. Your email is not in a proprietary format but rather in an open source format that can actually be ready in a simple text editor. Of course, it’s easiest to read it in Thunderbird, but you have the files in a format that is open and secure.

BONUS:

If you don’t think you’re going to need to access your email on a regular basis, you can always compress the files before storing them. Given that most of email is text, you’ll likely realize a savings of close to 50% if space is at a premium (once I moved all of my 2003 email to storage, I compressed it and saw a savings of 60%). This will add a small amount of time to accessing the email as you’ll have to extract it from the compressed format, but it could mean pretty substantial space savings depending on how many emails you’re archiving.

EXTRA BONUS:

This is also a way to move emails between computers. I ended up using this approach to move my email archives to my laptop so I could go through my old email while I’m watching TV at night and delete all the emails I’ll never want in the future (you could of course do that with the email online before you archive it). I’m pretty good about deleting useless emails as I go, but I don’t catch them all. With the .msf file and its accompanying data file, I was able to transport my email archives to whichever computer I wanted and modify the file, then return it to my file server for long term storage.

 2,799 total views,  4 views today

Unethical Amazon Review Modifications

I don’t always review products on Amazon. I don’t have the time. But there have been two instances over the past year when I have been contacted by someone because of a review I wrote on Amazon. Both times, these individuals have tried to bribe me to remove my negative review of the product. Here’s the latest email exchange over a backup cellphone charger that was a piece of garbage:

First Email:

taylor jack taylor.jack0528@outlook.com Tue, Dec 17, 2019 at 10:30 PM
To: “ryantcragun@gmail.com” ryantcragun@gmail.com

Hello,rcragun.
I’m Anna.I am a real person.Since everybody’s time is very precious,I just go directly to the topic.
Here is your review.
https://www.amazon.com/gp/customer-reviews/R1T2C38HIJ7JJQ/ref=cm_cr_getr_d_rvw_ttl?ie=UTF8&ASIN=B07SWTGDVW
I am very sorry to hear about the issues you’ve had with your item.Are you willing to help me to delete your review? If you have deleted your review, please tell me,We will give you an Amazon gift card.
Looking forward to your good news and reply !

My response:

From: Ryan Cragun ryantcragun@gmail.com
To: taylor jack taylor.jack0528@outlook.com
Subject: Re: Amazon compensation

I consider your proposal completely unethical.
You should be ashamed of yourself.
Best,
Ryan T. Cragun

I stopped responding after this, but have since received three more emails:

Email Two:

From: “taylor.jack0528” taylor.jack0528@outlook.com Using MailMasterPC/4.13.2.1001 (Windows 7)
To: “ryantcragun@gmail.com” ryantcragun@gmail.com
Subject: Re: Amazon compensation

From my perspective, we are very eager to compensate those customers who trust us but are hurt by us.
So please give us a chance. We will offer a $ 30 Amazon Gift Card.
Hope you understand us, our life and work are not easy.

Email Three:

From: “taylor.jack0528” taylor.jack0528@outlook.com Using MailMasterPC/4.13.2.1001 (Windows 7)
To: “ryantcragun@gmail.com” ryantcragun@gmail.com
Subject: Re: Amazon compensation

Time is limited and tight!!
How is thing going?
If you have deleted your review ,please tell me, I will give you $30 right away.
This is your review.
https://www.amazon.com/gp/customer-reviews/R1T2C38HIJ7JJQ/ref=cm_cr_getr_d_rvw_ttl?ie=UTF8&ASIN=B07SWTGDVW
Thank you.

Email Four:

From: Bessierh5 Nielsenqvl99 trisnatudd3cx@gmail.com
To: ryantcragun@gmail.com
Subject: $30 Amazon gift card

Hello rcragun.This is the final mail to you.
This is your review.
https://www.amazon.com/gp/customer-reviews/R1T2C38HIJ7JJQ/ref=cm_cr_getr_d_rvw_ttl?ie=UTF8&ASIN=B07SWTGDVW
If you are willing to delete your review ,I will offer an Amazon gift card worth $30.
If you have deleted it ,please tell me, I will give you $30 right away.
We will thank you profusely and even find a homeless kitten to hug on your behalf. We will waiting for you.
Again, this is the last email you will receive from us so we really do hope you are enjoying your purchase.My most sincere regards, I hope that you can reply to me as soon as possible.
Thank you and please have a fantastically glorious day.
Sincerely
Anna

With the previous company, I told them I wouldn’t delete my review. They were okay with that. They said that they would send me a new pair of headphones (the other ones died within a year) to make things right and hoped I would update my review to reflect that. That seemed fair to me and that’s what I did. They were okay with me leaving my review but wanted me to note that they tried to make things right.

That’s very different from what this person is doing. They are basically trying to bribe me to remove negative information from Amazon’s website so people will be misled about the quality of their product.

The product is NEXGADGET’s Solar Charger Power Bank. As I noted in my review, it was basically a useless brick during a 5-day hike in Wyoming. It didn’t keep its charge for a single day and wouldn’t charge in sunlight. Maybe I got a bad item. But that still speaks to the production quality and my review should stay on the website. NEXGADGET shouldn’t be trying to hide negative reviews but rather trying to make a better quality product.

Update 1/8/20:

I sent a response to their last email hoping to get more information.

My 2nd Response:

Created at: Tue, Jan 7, 2020 at 9:02 AM (Delivered after 0 seconds)
From: Ryan Cragun ryantcragun@gmail.com
To: Bessierh5 Nielsenqvl99 trisnatudd3cx@gmail.com
Subject: Re: $30 Amazon gift card

Hi Anna,
I’d like to know your real name and who you work for. Please provide that information and maybe I’ll consider your request.
Best,
Ryan

Here’s their response:

Email Five:

Created at: Wed, Jan 8, 2020 at 3:32 AM (Delivered after -325 seconds)
From: Bessierh5 Nielsenqvl99 trisnatudd3cx@gmail.com
To: Ryan Cragun ryantcragun@gmail.com
Subject: Re: $30 Amazon gift card

I understand your mood,but
On the one hand , this is not a bribe,this is just a compensation,we just hope that you are satisfied with this transaction.
On the other hand , this is not a violation ,because this shopping platform has this option after all,and the choices are in your hand.I just need you to delete it ,not a good review.
So what do you think of it ?
please give me a chance.
If you have deleted it ,please let me know, thank you!

And my final response:

3rd Response

Wed, Jan 8, 2020 at 6:41 AM (Delivered after 0 seconds)
From: Ryan Cragun ryantcragun@gmail.com
To: Bessierh5 Nielsenqvl99 trisnatudd3cx@gmail.com

Definition of BRIBE: “persuade (someone) to act in one’s favor, typically illegally or dishonestly, by a gift of money or other inducement.” You are trying to persuade me to act dishonestly with a gift of money. It is literally the definition of a bribe. Please stop emailing me or I will report you to Amazon.com directly.

To be fair, this is probably some underpaid individual in China who sees this as an opportunity to make enough money to survive. It’s just a job to someone. And my ethical pleadings will never persuade them to stop doing what they are doing because they need to eat. I get that. But it’s still a bribe.

 1,377 total views,  3 views today

Change Doorbell Sound on Ring App and Amazon Echo

I’ve had a Ring doorbell (and security system) for quite a while. I never bought the chime that goes with the doorbell because it has always worked through my Amazon Echo devices. However, I only recently learned that you can change the notification sounds you get when someone rings your doorbell. However, how you do this requires clicking through almost a dozen screens in the Ring app and I can never remember it. So, here’s how to do it.

Change Doorbell Sound on Ring App

I’ll start with the notification sound you get on your phone through the Ring app when someone pushes the doorbell. First, open the Ring app and you’ll be on the Dashboard or Home screen:

The dashboard or home screen.

Click the three lines in the upper left corner to open that menu:

Menu options.

Select “Devices”:

The list of devices.

Now select your Video Doorbell (mine is called “Front Door”):

Options for your Video Doorbell.

You’ll have to scroll down (at least, I did), to see the settings icon (the gear). Click on that:

These are the settings for your video doorbell.

The settings you want are the Alert Settings. So, click on that:

The alert settings for your video doorbell.

The second option down in the screenshot above is for the chimes that you can use if you have a separate chime for your device. I don’t. So, what I want to change are the “App Alert Tones.” Click on that option and you’ll get this screen:

App Alert Tones screen

We’re almost there (I know, right!?!). Now click on “Ring Alerts” and you’ll get this screen:

Here’s where you can adjust all of the alerts for your phone (through the Ring app) when someone pushes your doorbell. You can silence it. You can turn on or off the notifications. You can set it to Pop on screen. What we want is at the very bottom in the “Advanced” section. Click on that and you’ll get more options:

This is the same screen, just after I scrolled down to the see the advanced options.

Now, finally, we can change the sound. Click on “Sound” (it will indicate which sound you are currently using below “Sound”) and you’ll get this screen:

These are your options for doorbell notifications on your phone through the Ring App.

You can pick any of the sounds or music available there. If you want to set it to a song or something like that, you can put that into a folder on your phone called “Ringtones” and they will show up there.

Change Doorbell Sound on Amazone Echo Devices for Ring

In addition to changing the sound on your phone, you can also change the sound on your Amazon Echo if you have it connected to the Ring app. I’m not going to go through how to connect it to the Ring app as that is pretty straightforward (download the Ring skill for your Echo), but here is how to change your doorbell sound on your Amazon Echo.

First, open the Amazon Echo app:

Amazon Echo home screen.

In the bottom right, click on “Devices”:

A list of my devices.

I have a lot of devices set up with my Amazon Echo, so I actually have to scroll over to see all the devices (just swipe the list at the top to the left – Tinder style!) to see the option for All Devices:

I swiped left!

Click on “All Devices” and you’ll get a list of all the devices you have set up on Amazon’s Echo/Alexa app. You need to find the app that has a camera icon and is whatever you named your Ring video doorbell. Mine is called “Front Door”:

You’re looking for your Ring video doorbell in the list of devices.

Click on that and you’ll see the settings screen for your video doorbell:

The selected sound is under “Doorbell Sound.”

As you can see in the screenshot above, I had set up a “Howl” for Halloween. I want to switch it to something different. Click on the Doorbell Sound option and you’ll see a list of additional sounds:

The list of doorbell sounds.

The list includes seasonal options. I went with Xmas Elves. Select it and click back and that will be the new sound that is played through your Amazon Echo devices when the Ring video doorbell is pressed:

It worked!

Now, the next time I want to change this option, I won’t have to click on 50 different options in the various apps. Hooray for me (and you)!

 78,667 total views,  42 views today

Linux – Failing to Read Encrypted DVDs

Thanks to the fine folks at VLC and Ubuntu, watching DVDs on Linux is generally pretty straightforward. Install “libdvd-pkg” and follow the prompts and you’re generally good to go. That works for me almost all of the time.

However, I recently tried to watch a DVD and had no luck. I would insert the DVD and then wait. With most other DVDs, after about 30 seconds, I’d get a prompt that my Kubuntu 19.04 system had read the DVD and I had several options to proceed (view the files, watch it in VLC, etc.). But with this one, my OS couldn’t even detect that there was a disk in the drive. I tried multiple approaches.

Here’s what K3b indicated:

When I tried loading it in VLC:

And from the command line in VLC:

The problem is not my drive. I regularly load disks in the drive and they work fine, including many disks that have CSS encryption that the libdvd-pkg addresses. But, try as I might, I could not get my computer to even recognize that there was a disk in the drive.

I have a blu-ray player connected to my home entertainment center. Worried that the disk may just be bad, I put it in the blu-ray player and it opened fine. That convinced me that the disk was using some form of encryption that is still not addressed in the libdvd-pkg. I did one final check. I inserted the disk into an old laptop I keep around that has Windows installed on it just to see if this really is a Windows vs. Linux thing. Sure enough, Windows immediately detected it and opened it right up.

After spending a good 5 hours or so trying to find a solution (including installing lots of packages and reading through dozens of threads in Linux forums), I didn’t find a solution. I wrote this post basically just to inform other Linux users that there are some DVDs out there that have encryption that prevent them from being opened in Linux. I’m running the latest version of Kubuntu as of this writing (19.04 beta) with all the suggested packages installed to examine a DVD. But, regardless of what I tried, my OS could not read this disk.

Update 2/3/2020:

A friendly reader (Fabian Echevarria) sent the following:

Last week I came across a DVD similar to that described in your article.

I was able to read the data, first using ddrescue to read to ISO. The resulting ISO also failed but now with a common Title 3 IFO error, which usually isn’t a deal breaker, but in this case continued to prevent play. So I read the raw directory (I normally use 7z/isoinfo) and then pulled each individual chapter from streams that seemed viable, in this case 59 through 72. Running md5sum on the resulting files determined that only two chapters differed between all those stream. A manual review of those two determined which were the correct chapters, which I combined into the final file. The combined file plays fine.

For more information on Fabian’s workarounds, see here.

 1,162 total views,  1 views today

Linux – tinyMediaManager on Kubuntu 18.04

I run a network attached storage (NAS) device at home to manage all my media (e.g., music, videos, photos, etc.). I have used various programs over the years to manage the naming and organizing of my music files but just recently discovered tinyMediaManager for managing video files. Since it’s written in Java, it works on any OS, including Linux.

Given my large collection of movies, I have been looking for software that would properly name and organize all of them. tinyMediaManager seemed like the perfect solution, but I immediately hit a snag once I tried to get it running on Kubuntu 18.04 (my current distribution of choice). I couldn’t get the GUI to launch. It took some doing, but I eventually figured out how to make this work on Kubuntu 18.04.

First, download the tar.gz file here. (Note: I couldn’t download it using Chrome, as the tinyMediaManager site only lets you download it using a browser that allows Java and, as of Chrome 45, Chrome doesn’t. I used Firefox, which worked fine.).

Untar that file and move the resulting folder wherever you want it to reside (obviously, somewhere you have access to it, but, otherwise, it doesn’t matter).

Now, the tricky part. According to the tinyMediaManager website, all you need to do to launch the program is use a terminal to navigate to the folder you just untarred and use the command:

cd /home/ryan/tinyMediaManager
./tinyMediaManager.sh

When I tried this, it didn’t work. It seemed like it was trying to do something, but then the GUI wouldn’t open and… nothing. Disappointed, I started looking for answers. I eventually found the “launcher.log” file in the tinyMediaManager folder and that gave me the clue I needed to solve the problem. As it was trying to launch, it was running into a problem with a specific thread and library in the version of Java I had installed by default. Here was the error:

Exception in thread "Getdown" java.awt.AWTError: Assistive Technology not found:

It turns out, tinyMediaManager has not been updated to work with newer versions of Java. So, here’s what you can do.

First, install the Open Java Development Kit version 8 which is the latest version it works with:

sudo apt-get install openjdk-8-jdk

It turns out, you can have multiple openjdk’s installed at the same time. I was running as my default openjdk 11. Now, in order to switch to the openjdk 8 environment, type in the following command at the terminal:

sudo update-alternatives --config java

You’ll then be given the chance to choose which openjdk you want to use, like in this screenshot:

Choose openjdk 8 as your default. Then try running tinyMediaManager again. If the software gods are smiling upon you, the GUI will launch:

 1,681 total views

Linux – Fixing the Epson (V33 Perfection) Scanner Issue in Kubuntu 18.04

[NOTE: As of Ubuntu/Kubuntu 20.04, the drivers from Epson work fine without this workaround. Download the driver, then follow the directions to install it.]

As of Kubuntu 17.10, my Epson V33 Perfection scanner stopped working with Linux. I bought this scanner specifically because it did work with Linux. That it stopped working was a serious disappointment as I have been using the same scanner for years and regularly need it for a variety of things.

I tried installing older versions of the software (I’ve kept the downloads from Epson for years) but that didn’t work. I tried it on a different computer with the same OS and that didn’t work. I tried a lot of troubleshooting and came up empty. After hours of trying various solutions, I gave up (that was a few months ago).

However, when my CPU died on my desktop computer forcing me to reformat it again about a month after I had previously tried, I figured it was time to try to solve this again. This time, however, I quickly came across the answer online (see here). It turns out, this is a bug in the latest version of the scanning software that ships with Linux, which confirmed that it wasn’t a problem with my scanner or with Epson’s software. Here’s what I did to fix the problem.

First, go ahead and install the latest version of Epson’s software from their website (start here – or just here – lots of clicks to get to where you need to go).

Untar the file you download and read the directions for how to install the software. (Basically, navigate to the directory you just untarred in a terminal then run ./install.sh).

Before this bug, that was all you needed to do and the scanner would work. Now, there are two more steps.

The second step, also at the terminal, is to type in:

sudo ln -sfr /usr/lib/sane/libsane-epkowa* /usr/lib/x86_64-linux-gnu/sane

I’m not exactly sure what this command does but the “ln” command creates symbolic links, so I’m guessing it’s linking two files or commands that help correct the bug in the latest iteration of the software.

Then, open a text editing program and create a new, blank file. In that file, you’re going to add the following content:

# chmod device EPSON group
ATTRS{manufacturer}=="EPSON", DRIVERS=="usb", SUBSYSTEMS=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="*", MODE="0777"

The first line of this file is just a comment. The second adds information about Epson scanners.

Save the file as “79-udev-epson.rules”.

Now, move that file from wherever you created it to the following directory:

“/etc/udev/rules.d/”

Like this:

Now, restart your computer. This worked for me. Hopefully, it will work for you too.

 3,113 total views,  2 views today

R (Linux) – basic installation

To install the R programming environment on Linux is pretty straightforward, but it does require a little bit of know how in order to find the correct packages. As is typically the case with Linux, there are multiple ways to get things done. I like to use Synaptic for installing and removing software, but you can also use the software manager that comes with your Linux distribution (in Linux Mint it’s called Software Manager) or the command line (in KDE based distributions, Konsole).

For the most up-to-date installation of R, it’s actually best to install directly from the R repository. A list of Linux repositories for the R environment is located here. In order to install from the repository, you need to update your list of repositories in Synaptic. To access your repository list in Synaptic, click on Settings -> Repositories.

In the new Software Sources window, click on “Additional repositories” and you’ll get this window:

Click on Add a new repository. You’ll get this window:

The exact information you put into that window will vary based on which mirror you chose. Here is what I added in mine:

deb xenial/

In order to ensure you have the right files and to follow best security practices, you should install the signing key as well. Directions for installing the signing key are found here, but it can be done with a simple command from a terminal:

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys E084DAB9

Once you have done all of that, you can install R from Synaptic.

First, open Synaptic, which will require your password. You’ll get the basic Synaptic Package Manager window:

Next, in the search box, search for “r-base”. Right-click it and select “Mark for installation” to install “r-base”:

In the above screenshot, I have already installed r-base, so the option “Mark for installation” is greyed out. But, obviously, that’s what I already did. When you select this, Synaptic will automatically select all the other necessary packages (there are about 10 to 15 additional packages necessary for R to run: r-cran-class, r-cran-lattice, r-cran-spatial, r-cran-survival, r-cran-codetools, r-cran-nnet, r-cran-mass, r-cran-boot, r-cran-nlme, r-cran-rpart, r-cran-cluster, r-cran-kernsmooth, r-cran-foreign, r-cran-mgcv, r-cran-matrix, r-recommended, r-base-core).

If you plan on installing any other R packages, it’s not a bad idea to also install “r-base-dev,” as it helps fill in dependencies for other packages.

Once you’ve selected r-base, hit Apply in Synaptic and all the software will be installed.

You now have the base software for R installed.

To open the R environment in a terminal, launch a terminal and simply type “R” at the prompt, like this:

Here’s where things can get a little complicated. To do different things in R requires various libraries or packages. Some of these can be installed using the R terminal while others need to be installed from your Linux distribution’s repositories. To install a library or package using the R terminal, you use the following command once you have opened the R environment:

install.packages(“PACKAGENAME”)

The first time you run this, the R environment will ask you to select a mirror.

Choose one close to your location. R will then install the package, assuming you type everything correctly.

NOTES:

Before you start trying to install additional R packages, it’s a very good idea to install the following Linux packages:

r-base-dev build-essential

If you run into an error message, there are several possibilities. First, check to make sure you typed everything correctly. R is not forgiving on spelling mistakes. Second, if the error is something like:

installation of package ‘PACKAGENAME’ had non-zero exit status

Or

dependency ‘PACKAGENAME’ is not available

There is a good chance that you need to install a package or library using Synaptic (or from a terminal using apt). For instance, to install the “tm” package, there is an unsatisfied dependency (meaning, a library or package that needs to be installed but cannot be installed using the R installer). The dependency is the ‘slam’ package. This can be installed using Synaptic (or, from a terminal, using the command “sudo apt-get install r-cran-slam”). Once you’ve installed the dependency, try re-installing the package and the error messages should go away.

 

NOTES:

I also have found that I like RStudio as an IDE for working with R. It’s a little bit friendlier to use than a straight command line interface as it keeps track of variables and loaded libraries. The personal version for your desktop can be downloaded here.

And a note on RStudio on Linux. I regularly get an offset from the cursor location and where the cursor actually is in the command window. It turns out this is a font issue. If you go up to Tools -> Global Options -> Appearance and change the font to anything else, this problem will go away.

 861 total views,  1 views today

Android: Wink Hub and Sprint’s Data Optimizer

I reformatted my Android phone (LG G3 with Android 5.0.1, software version LS990ZVG) the other day to address a problem I was having.  After reformatting, I reinstalled all of my apps and everything seemed to be working fine until I tried to log into the Wink Hub app to adjust the settings for some of the lights in my house.  When I tried to log in, I got the following error:

looks like we encountered an error on the server; please try again later

I figured that Wink’s servers might be down, so I gave it a little bit of time and tried again.  An hour later, I got the same message.  Thinking it might be a real outage, I googled to see if Wink was reporting anything and didn’t see anything, though it did happen to coincide with Amazon’s AWS service going down, so I thought it might be related.  The light situation wasn’t that urgent, so I didn’t think much of it until the next day when I had the same light issue and wanted to adjust the settings of the Wink Hub on my phone again.  I tried to log in and got the same error, again.  This time I figured something must be wrong.  I tried a few things before I found out the real problem.

First, I tried clicking on “I forgot my password” to have my password reset, but I got the same error.  That meant I couldn’t reset my password and there was definitely something wrong.

I tried uninstalling and reinstalling the Wink Hub app, but got the same error after reinstalling the app.

Then I started googling.  In one forum buried deep in the recesses of the internet, I found a hint at what might be the problem.  And, not surprisingly, it’s the same piece of software that has plagued me for years: Sprint’s stupid Data Optimizer app.  I’ve had issues with this app in the past as it slowed and killed my data connection.  I routinely turn it off immediately after I reformat my phone because it is so worthless.  As it turns out, it was the culprit with this problem as well since I had forgotten to turn it off.

You can find the app in your list of apps under Optimize & Protect (see the screenshot):

Sprint Data Optimizer

When you open the app, you’ll see the following two options:

Sprint Data Optimizer

Click on Data Optimizer and you’ll see this screen:

Sprint Data Optimizer

Turn the Data Optimizer off and you can now log into the Wink Hub app.

I don’t know exactly what the problem is, but I’m guessing it has to do with how the Sprint Data Optimizer manages data.  It likely is compressing it and the Wink Hub app may not allow login credentials to be sent that way to the server.  Regardless of the problem, as soon as I turned this terrible piece of software off, I was able to log into the Wink Hub app and adjust my lighting settings.

 638 total views,  1 views today

Linux: Installing Redshift

There is a growing body of research suggesting that blue light before bedtime can be associated with sleep problems.  I’ve known about this for a while, but have just recently started having sleep problems.  I decided to try some of the programs that make changes to the color of your monitors to see if it helps.  On Android, I installed Twilight.  On Linux, I went with Redshift.  There was a minor complication in installing Redshift, so I figured I’d detail how to install the software and get it working on here for anyone else who wants to give it a try.

First, there are two software packages you need to install: redshift and geoclue-2.0.  If you don’t install geoclue-2.0, redshift won’t know your location and won’t be able to adjust your screen relative to the amount of light outside and to sunrise and sunset.  I originally tried launching Redshift without geoclue-2.0 installed and it gave me an error.  Make sure you install it.  If you want to have redshift as a widget in KDE, you can also install: plasma-widget-redshift and plasma-applet-redshift-control.  And for a GUI: redshift-gtk.

From the commandline:

sudo apt-get install redshift geoclue-2.0 plasma-widget-redshift plasma-applet-redshift-control redshift gtk

Or in Synaptic:

Screenshots for Redshift Tutorial

Screenshots for Redshift Tutorial

Once you’ve installed these packages, you can launch Redshift from the application launcher.

Screenshots for Redshift Tutorial

With the GTK option, you’ll get this little icon in your System Tray:

Screenshots for Redshift Tutorial

The System Tray icon allows you to turn Redshift on and off (right-click).  It also provides some information about current settings.

Once it’s installed, Redshift gets right to work, adjusting the color of your monitor and slowly shifting the color throughout the day.

If you’d like Redshift to start automatically when you boot the computer, make sure that you enable it in the Autostart options in System Settings:

Redshift autostart

If you need to adjust any settings, you can do so by using the command line and a configuration file, detailed here.

 1,254 total views,  1 views today

Kubuntu: How to Map Windows Network Share

My workplace is largely a Windows based institution.  Due to a collaborative project, I was recently asked to access some documents on a Windows Network Drive.  I was sent directions for how to add that drive in Windows.  Those directions were not that helpful as I, of course, run Linux.  As perhaps the only Linux user on my campus, this meant that I had to figure out how to map the Windows Network share to my computer on my own.  No problem.  I got this.

After a little googling, I figured out I needed to do the following:

(1) Install the packages “samba” and “cifs-util.”  You can do this using synaptic or from the command line (sudo apt-get install samba cifs-util).

(Installing the software from synaptic.)
(Installing the software from synaptic.)

(2) Once those packages are installed, it’s a good idea to restart your computer.

(3) Now, create a directory where you want to mount the mapped network drive.  I put the network drive on my desktop just to test this.  I may change that later.

(4) Open a command prompt (e.g., Konsole) and now it’s time to mount the drive to the newly created folder.  Here’s the command:

sudo mount -t cifs -o username=[your.username] //[name.of.network.drive]/[name.of.specific.folder] /home/[your.username]/Desktop/[folder.where.you.want.the.drive.mounted]

networkdrive2

(5) After you hit enter, you’ll be asked for your password for the network drive.  Assuming you didn’t have any typos, you should now have the Windows Network Drive mounted to the folder you created and should have access to all the files inside.

networkdrive3

(6) NOTE: This is a temporary mapping of the Windows Network Share.  Since I only need to access this Windows Network Share Drive occasionally, I don’t want to set up my computer to map it every time I boot it up.  There is a different process for mapping the drive permanently.

(I found the most helpful directions for this here.)

(NOTE: On LinuxMint 18.0, I was unable to get this to work.  Every time I tried to map the drive using the command above I would get the error: “mount error: could not resolve address for [network.drive.name]: Unknown error”.  It turns out, for some reason Linux doesn’t play well with Windows share names.  However, when I swapped out the name of the drive for the IP address, everything worked great.  Try using the IP address instead of the name of the Windows share if you get this error.)

(SECOND NOTE: A way around the above error (kind of) is to associate the Windows share name with the IP address in your /etc/hosts file.  Using a console, type: sudo nano /etc/hosts.  When the file comes up, add the IP address followed by the share name (e.g., 192.168.1.1   [share_name]).  That will associate the IP address with the share name and you’ll then be able to mount the Windows share with the name and not the IP address.)

 3,519 total views,  7 views today