Showing posts with label Google Drive. Show all posts
Showing posts with label Google Drive. Show all posts

Saturday, July 22, 2017

Upgraded PCLINUXOS and a new mouse

A few things that I had to do for the Linux box.  For the last couple of weeks I have noticed at times I would get a double click on the mouse when I pressed only once.  I am not surprised there as the machine is used for a MMORPG (Runescape)for at least one hour a day.  Reading online forums it is somewhat common and if you are brave you can disassemble the mouse and fix the issue.  I am not willing to do that so I checked out the stores and the Logitech mouse was on sale and I picked up a new one.  The old one still works and I will take the batteries out and store it as an emergency mouse.

The other thing is PCLINUXOS has stopped upgrading KDE 4 and a couple of packages I use are not being upgraded.  This is not a huge deal as it has been a few years so I am overdue for a system upgrade.  I used the backup software to create a TAR, but, I didn't notice I clicked the option to compress every file.  I made two copies, one to a USB hard drive and a second to a USB stick.  I then verified that the files were readable on another system before I started to reformat and rebuild this machine.  Like before it didn't take very long to install and reboot.  That is when I noticed that all the files I backed up were compressed with the BZ2 extension.

I did a lot of online reading and found a number of forums with fancy scripts that could do the work, but, rather than me taking a few hours of setting up a script and then run I would do it all manual.  It isn't as bad as you might think.  The major directory was all of my files on Google and I just reinstalled GRIVE2 and re-synced in about 30 minutes.  The other files I used midnight commander, navigated to each directory and manually typed 'bzip2 -d *.bz2'.  Midnight commander has a nice feature, if you press [ALT]-P it will bring up the prior command(s).  I used that for the Thunderbird, Firefox, documents and photo folders and in about 1 hour I was done.  I had to do each folder and sub-folder as bzip2 didn't have an option I could see that would allow me to automatically unpack recursively the folders.

KDE5 does look somewhat similar to KDE4 so the change isn't that jarring.  The theme that was the default I wasn't thrilled with, but, that is also easy to change.  So far it seems to be running smoothly and it feels faster (I haven't done any timings there).

There are still a few more things like configuring my network printer, reinstall the XSANE scanner software, but, just about everything else is there by default.  I also have to get accustomed to the new mouse as it is a bit smaller and I am accidentally right-clicking the mouse.

Sunday, January 01, 2017

Software and Tools - Backups

One of the most important things you can do after you secure your device is to make regular backups and just as important is to test your backups.

Why backup?

  • Hard drives fail.  It doesn't matter how new the drive is or even if it is a SSD they will fail sooner or later;
  • You lose your device or it is stolen;
  • You drop your device and now it does not work;
  • When you patch or update your operating system it fails.  It doesn't matter the O/S you are using, I have had failed Linux updates and it required me to rebuild the machine;
  • You migrate to a new device and want all the files on the old machine moved to the new machine;
  • You finger slips and you accidentally delete an important file/directory; 
  • There is a disaster (ie. fire or flood);
  • Your device(s) infected with a virus or a trojan.  Again, it doesn't matter the O/S you are using, there are nasty programs out there that works in Windows, Linux and OS/X.
If one or more of the above happens you will need a backup so that your important documents are available to you when you rebuild the device or copy to a new device.  I have had people come to me with dead and dying devices asking if I can pull off their data and they have not made any backups.  Too often I cannot recover all of their files and important documents, images, videos are lost and they don't have any backups.

Things to think about

How often do you backup? 

  • That all depends on your personal preferences and how many documents you are adding to your device;
  • If you don't create very many then it may be safe to backup infrequently (monthly); 
  • If you create a lot of files (like scanning family photos), then frequent backups (daily) may be a good thing;
  • Once you set a schedule stick to it.  I put up a recurring reminder in Google calendar to remind me of when backups should be run.  Also you can set up a recurring task in Windows and Linux (cron) to run your backup scripts on a set schedule.

How many copies do you want to keep?  

  • Again this is a personal preference, but, multiple full backups is a good thing just in case one fails for some reason; 
  • An option here is a monthly full backup and then weekly backups of new/changed (differential backups) files;
  • Another reason as backups may fail and if you have only one copy then you have nothing to go back to.  I know this happens as decades ago when at work we were doing a DRP (Disaster Recovery Plan) exercise at work and one of the corporate backup tapes failed.  It wasn't a major problem as we did keep multiple backups and restored from an older image;

Off-site location for your backups?  

  • It doesn't matter if you have a good set of backups if you cannot get access to your site;
  • How secure is the off-site.  If you have sensitive information you don't want anyone getting access to the backup;
  • You should also figure out who should have access to your backups and let them know where it is and how they can get access to the backups if required;

Media for backups.  

  • Decades ago floppies were the media, then CDs followed by USB drives;
  • When you backup make sure that the tools, hardware and software is there to allow you to read the backups.  An example of this is some time ago I had to pull off backups from my father-in-law 3.5" floppy drives as he didn't have a floppy drive in his machine.  We were lucky in that I have an external 3.5" USB floppy drive for this and it was set up in Linux.  I also have an external CD drive and a blu-ray drive (call me paranoid) so I can pull files from backups in that format;
  • To the cloud.  Don't depend on that as your main backup as it may not be there when you need it.  I like Google drive for a secondary backup myself and the bonus is that the files I put there are available anywhere I have a web browser (and the firewall allows access).  With the various sites getting hacked I also don't keep files there that are sensitive and when I do put up a file of that nature I use encryption on the file/directory.  I also have a small script using GRIVE in Linux to pull a backup from GOOGLE drive to my machine.

Software and file format for backups.  

  • Over time operating systems do change and the software that did the original backup may not run on your new device and the new devices may not even be able to read your backups;
  • I tend to work with the lowest common denominator for backups that does work across platforms.  I prefer to use "ZIP" files as I know Windows and Linux both can work with that file format.  I assume OS/X will be able to read them too, but, I don't use that operating system so I am not 100% sure;
  • On my Linux machine I am partial to KBACKUP.  It is fairly easy to set up and use and it stores the files in a format that I can open in an Linux distro and Windows;
  • On my Windows box I use a simple XCOPY routine.  It isn't pretty, but, it works and the files are in a format that my Linux machines can read;
  • For my Android devices they get backed up to Google drive;
  • Several times a year I take one of my backups and plug it into a different machine to see if it is readable and I can pull one or more files off the backup.  Make sure what is backed up can be restored!  It is also a quick and easy test to see if your restore steps work and if there is anything else you should be doing when restoring from a backup;

When you restore.

  • If the restore is due to a virus or a trojan I strongly recommend that you don't ever use your backups until you have a clean and patched machine.  If the machine is still infected and the media you are using can be written to you don't want those backup files corrupted;
  • Make a checklist of what you need to do the restore and the steps performed when doing a restore.  This includes steps on how to verify that the restore worked;

My KBACKUP routine

Here are screen shots of my starting KBACKUP, running the backup and when it finishes.
Shortcut in my toolbox

Loading my backup profile

Directory & file list for backup

Backup running

Backup done with filename

Saturday, December 03, 2016

Software and Tools - Office suite

This is the fifth blog on software.  This time I am focusing on 'office' suite software that I am using on my Linux machine.  The Office suite you use is a personal preference, or, it is imposed on you by the company you work for.  My personal preference is the Libre Office suite.  It is free, works very well in Linux for what I need it for and so far it handles all of my files from the office when I have to make changes and I don't have access to my work laptop.  My company supplied laptop has the Microsoft Office Suite as that is the corporate standard.

Android devices

The Android phone uses only the Google docs tools installed by default due to it being a low end phone, but, that is fine for me and what I need it for.  The Android tablet also uses the Google docs tools as I don't need or use a lot of high end functions.  The times I use the Google docs tools is when I need to make a quick edit to a document or spreadsheet I have on Google Drive.

Linux

This is where I do most of my serious work when doing documents.  I am not going to go into how each package works, just a quick intro to the two main tools I use and what it looks like.  So far I have not had any problems using documents from work in the suite.  It does look a bit different when rendering the documents, but, the basics are there and I can quickly do what I have to do and get it back to work.

Libre Office came pre-installed for me so that was a bonus.  If it isn't, you can use your package manager to install the software.  The main functions are Writer, Calc, Base, Draw, Impress and Math.  I normally use Writer and Calc and I have only used Impress once. 
Office suite menu

If you launch Libre Office the package will present you a number of options and the last set of files you were working on.  From there you can pick the file you were working on, open a file or create a new file.  Clean and simple screen that allows you to quickly do what you want to do.
Libre Office, what do you want to do
An alternative is when you are working in a document is to click on the file button at the top and then select new.  It will show you a list of items you can create.  The program presents you a short and simple list of things you can do.
What type of document to create
The look and feel of the suite is very similar and is similar to the Office suite in a way.  If you are not sure what to do you can hover the mouse over the icons at the top and a quick description is shown.  I have not modified what this looks like as right now the default works very well for me.
Writer blank document screen

Other office tools

At this time I don't use much else.  The only other two tools is a character select KCharSelect that came as part of KDE and a PDF viewer Okular.  I use Okular when I export out a spreadsheet from Calc for viewing on the phone.  I do this so that I can quickly see my DVD library on the phone to see if I have already bought that video and not having to open up the spreadsheet and accidentally make a change.
KCharSelect

Okular

Saturday, November 19, 2016

Software and Tools - Browsers

This is the second in a group of blogs on software, tools and repositories.  One of the main tools I use and I suspect the majority of people is a web browser.  There are a number of great browsers out there and the one you use and like depends on your personal preferences (and biases).  For me since I run a Windows laptop (gaming), Android (tablets and phones) and Linux (laptops and netbook) I prefer Firefox and Chrome.  They run equally well on a cell phone right up to the laptop I am composing this blog on.  The Windows laptop (Windows 10) has Edge on, but I don't run it.  I may be biased, but, I don't trust the security on it and how much it is reporting back to MS about my searches and browsing habits.  I know Chrome and Firefox does do some reporting, but, so far they haven't abused my trust there.

This won't be all inclusive, but, a quick tour of my basic setup and hopefully will give you an idea of what they look like and a couple of things I added to assist me and secure my browsing.

If you use Windows click on Firefox if you want to go to the Mozilla site,  click on Chrome if you want to go to the Chrome site.  If you are using Android it is in the Play store and for just about every distribution of Linux it is part of the repositories that you can install (for me that is Synaptic).

For the rest of this blog the screen shots are from my Linux machine, but, Android and Windows have a similar layout and look-and-feel.  For all of the screenshots I used KSnapshotGwenview is used for quick-and-dirty edits (like rotate, resize and rename).  Google Drive is used to store all of my blog images and the GRIVE tool syncs that up for me (with my writing a BASH script front-end, my previous BLOG on that).

Firefox

Once you install Firefox and launch it you will get a screen something like below.

It is a rather plain and simple screen.  This is my personal preference as I don't like or want a lot of clutter.  I have turned off the menu bar, bookmark toolbar and the status bar.

I did add a few extensions (from the Mozilla site) for the status bar and for shutting down those annoying ads.



My Plugins are default to my Linux distro.  When there are bug fixes I use Synaptic to update when they are available.  I still have Flash installed, as much as I hate it for the security holes I still need it for accessing corporate materials when I log into the company site.



To see preferences click on the icon at the top right (looks like a hamburger) and click on the preferences icon (looks like a cog).  You will see a number of options that you can click on and are presented with a variety of settings.  On content I turned off the option to play DRM protected content and to block pop-up windows.  I also changed the font to Arial as I find that easier on my eyes.




For privacy I turned it up to as high as I can go.  I know sites can still snoop, but, I want them to know if they want my information they should ask me first.

For security I also have that set to maximum.




For good measure I use  uBlock Origin to shut down as much of the annoying ads and tracking when I do surf.  I turn it off for sites that respect me and don't flood me with annoying ads.  To see what the dashboard looks like you will need to keep on reading as it is in the Chrome section.

To summarize my settings:


  • Check to see if Firefox is my default browser;
  • Show blank page at start;
  • Search right now defaults to Google, I did disable Bing and Yahoo;
  • Disable play DRM;
  • Enable pop-up protection;
  • Privacy tracking on for private windows;
  • Never remember history;
  • Security, Warn & block all turned on!
  • Sync bookmarks, I have that turned on so it is easy to keep phone, tablet and laptops synced to the same set of bookmarks;
  • Downloads, ask me where to save; 
  • uBlock Origin, set up to hide as much crap as possible.  Good sites I open up;
  • Advanced I left at their defaults. 

Chrome

My other browser is Chrome.  There are times that sites have problems with Firefox and I use that.  It is also set up to link to my personal Google calendar and to use Google Docs.  Part of the time I run it for Facebook to chat with family and post various updates and use Firefox for general web browsing and gaming (Runescape).   Like Firefox I have a minimal screen display, I really don't like clutter.

To go to your settings click the vertical ... on the top right side, then click on settings.


By default the advanced settings are not displayed, scroll down to the bottom and click on +Show advanced settings.  You can see your browsing history, Extensions and Settings.  For privacy you can click on content settings and it pops up a privacy setting screen.

For extensions it will show what you have installed.  At the bottom it has Get more extensions that takes you the Chrome Web Store.  I really suggest you use just that site as you know that Google has done some checks on the quality and security of the extensions.  I know nasty extensions can slip in, but, when found they get yanked PDQ.

Like in Firefox I use uBlock origin.  It is small, light and very configurable.  I used to use Ad-Block, but, when they went to white listing ad sites I dumped it.  I pick what ads are presented to me and I will retain full control of that.

To summarize my settings:

  • Show blank page on startup;
  • Google is the default search page;
  • No 'Guest' browsing;
  • Cookies, clears when I shut down Chrome and 3rd party is blocked;
  • Let me choose when to run plug-in;
  • Do not allow tracking;
  • All other content settings at default;
  • Downloads, ask me where to save;
  • Cloud print is on, I use this only for stuff that isn't sensitive;
  • uBlock Origin, set up to hide as much crap as possible.  Good sites I open up;


Summary

Hopefully this is of use and a good starting point for your using either Firefox or Chrome as your main browsers.

Sunday, September 18, 2016

A new tool for my wife

Yesterday I picked up a new tool for my wife.  She does have a laptop and it is in our office.  The problem is that she has had a stroke a year ago and it is much too large and heavy for her to carry it downstairs and use it while sitting on her lap.  Factory Direct up the street had refurbished models of the Acer Chromebook for $129 (Canadian) that looked like it could do what she wanted and is light enough she can carry it around with one hand.  Her needs were simple, web browsing (news, weather and a few other sites), email and Facebook.  She has a tablet for her gaming and Facebook that she uses daily.

The Chromebook did it all right from the start without issues.  I made a minor tweak to turn off the touch-pad as I installed a wireless mouse.  It took only a minute to find how to do that on the web (I bookmarked that for future reference on the Chromebook).  The only minor quibble I have is that 16 gigs isn't enough (and I am not spending more money to install a new larger SSD).  It appears that the O/S takes up a fair bit of space and leaves 1 gig for the user.  I can live with that as she is using it only for light weight web work and does not need a huge amount of drive space.  I did format in Linux a SD card (16 gigs) and inserted it in the slot and pointed the downloads to that so we don't use valuable drive space for when she downloads files.  I don't see how to change the directory for the cache (yet) to point it there.  I did try to install our wireless printer, but, we have an older model and isn't supported by Cloud Print.

I did set up links at the bottom of the screen to email, browser, Facebook, Google drive so most of her normal tasks are one click away.  Next up is to see how the battery life is for her without it being plugged in.  If you are looking for a lightweight machine for simple tasks that don't depend on local storage the Chromebooks are an option to look at.

Saturday, May 14, 2016

Adding Google Drive to my Linux Box

GRIVE Installation and scripting

I have been digging around to see if there is a Google Drive service available for my Linux box.  I preferred to have something like what I have on the high end laptop (windows 10) in that it looks like a drive and I can manipulate the files in any way I want and updates GDRIVE immediately.  So far there is nothing like that in LINUX, but, there is a package called GRIVE.  I read up the documentation on the package and saw that it was something that I could use for now.  I installed the package, followed the instructions to link the app to my GMAIL account and then did a synchronize.  The first run took several minutes while it downloaded all of the files and folders, but, when I run again the synchronize took only a few seconds.  While this isn't perfect it does allow me to access my GDRIVE files, make updates and then sync the changes.

I always like to automate my tasks if I have to run it more than once.  For jobs scheduled on a regular basis I prefer CRONTAB, for things not on a regular schedule I prefer a folder with scripts or links to do the job.  For GRIVE I wrote two very simple BASH scripts to automate my synchronizing my GDRIVE files.  The first one displays to the user what will be done and give them the option to continue or quit.  The second calls the first from an XTERM window where I set up the font to a readable size.  I dropped a link to the second script to my desktop and ran it.  The script is very simple, possibly over-kill, but, I like to automate things so one click does the work for me.  I ran the script this morning as I had two new images (for this blog entry) and it synchronized my files in several seconds.  There is a lot more to the script that what you see, but, it is just setting up the color variables and getting the system time.  I don't need to use the time yet, but, it is part of my normal BASH skeleton script.

Screen shots

BASH script to sync to Google Drive using GRIVE

What the BASH script presents to me when run

Full BASH script to run GRIVE

#! /bin/sh
# ANSI Colors
#
#  Version:
#    - Version 1.0.0 2016/05/15
#    - Copyright 2016 Thomas Traynor.
#    - Program is distributed under the terms of the GNU General Public License
#    - http://www.gnu.org/licenses/gpl.txt       
#    - Release Notes:
#
#
#  Notes:
#
# ------------------------------------------------------------


zSetANSI() {

# Foreground colors:
    uFGBK="\033[30m";   #Black
    uFGLRD="\033[31m";  #Low  Red
    uFGHRD="\033[91m";  #High Red
    uFGLGR="\033[32m";  #Low  Green
    uFGHGR="\033[92m";  #High Green
    uFGLYW="\033[33m";  #Low  Yellow
    uFGHYW="\033[93m";  #High Yellow
    uFGLBU="\033[34m";  #Low  Blue
    uFGHBU="\033[94m";  #High Blue
    uFGLMG="\033[35m";  #Low  Magenta
    uFGHMG="\033[95m";  #High Magenta
    uFGLCY="\033[36m";  #Low  Cyan
    uFGHCY="\033[96m";  #High Cyan
    uFGHGY="\033[37m";  #High Gray
    uFGLGY="\033[90m";  #Low  Gray
    uFGWT="\033[97m";   #White

# Background colors:  
    uBGBK="\033[40m";   #Black
    uBGLRD="\033[41m";  #Low  Red
    uBGHRD="\033[101m"; #High Red
    uBGLGR="\033[42m";  #Low  Green
    uBGHGR="\033[102m"; #High Green
    uBGLYW="\033[43m";  #Low  Yellow
    uBGHYW="\033[103m"; #High Yellow
    uBGLBU="\033[44m";  #Low  Blue
    uBGHBU="\033[104m"; #High Blue
    uBGLMG="\033[45m";  #Low  Magenta
    uBGHMG="\033[105m"; #High Magenta
    uBGLCY="\033[46m";  #Low  Cyan
    uBGHCY="\033[106m"; #High Cyan
    uBGLGY="\033[47m";  #Low  Gray
    uBGHGY="\033[107m"; #High Gray

# Underline:
    uFGULINE="\033[4m";
  
# Blink:
    uFGBLINK="\033[5m";
  
# Reset all:  
    uFGRESET="\033[0m"
}


#
#  Get the system clock and set to a variable.
#

zGetDATE() {

# System date.  For all date options type date --h on command line.

    uSYSYY=$(date +%Y);
    uSYSMM=$(date +%m);
    uSYSDY=$(date +%d);
    uSYSDT=$uSYSYY$uSYSMM$uSYSDY;
  
    uSYSHH=$(date +%H);
    uSYSMIN=$(date +%M);
    uSYSSEC=$(date +%S);
    uSYSTM=$uSYSHH$uSYSMIN$uSYSSEC;
  
    uSYSJDT=$(date +%j);
    uSYSWK=$(date +%W);
    uSYSDOW=$(date +%w);
    uSYSDAY=$(date +%A)  
    uSYSMTH=$(date +%B)
}

# ============================================================
# END OF ALL SUBROUTINES FOR THIS SCRIPT.
# ============================================================

zSetANSI;
zGetDATE;

# Define the working variable for return codes:
uRC=0;

# Get current directory name
uDir=$( cd "$( dirname "$0" )" && pwd);

#"

# Get process ID
uProcID=$$


#  Now echo out the stuff to the console:

clear;
echo ;
echo -e "${uFGHRD}Syncronize with Google Drive${uFGRESET}";
echo ;

cd ~/GoogleDrive

echo -e "${uFGLGR}This could take a while syncronizing the files."
echo -e "If you want to continue press ${uBGLGR}${uFGBLINK}${uFGBK}[ENTER]${uFGRESET}"
echo -e "${uFGLGR}otherwise ${uBGLGR}${uFGBLINK}${uFGBK}[CTRL-C]${uFGRESET}${uFGLGR}."
echo -e "${UFGRESET}"
read uLINE
grive

echo ;
echo -e "${uFGHRD}Syncronize Finished${uFGRESET}";
echo -e "${uFGLGR}press ${uBGLGR}${uFGBLINK}${uFGBK}[ENTER]${uFGRESET}${uFGLGR} to finish update"
read uLINE