Using Google Service Accounts instead of End-User Accounts on a Server

If you are receiving the following message from a Google API or software tool, you are being warned for using your personal/business google account to run server-based applications.

UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK. We recommend that most server applications use service accounts instead. If your application continues to use end user credentials from Cloud SDK, you might receive a “quota exceeded” or “API not enabled” error. For more information about service accounts, see https://cloud.google.com/docs/authentication/.

This operation can be dangerous as your personal account is privileged and may be used to access all of your Google account functionality. You will need to log in on the server with a “Google Service Account” to mitigate this warning and the dangers that come with it.

Create a Google Service Account Here.

iPhone XS / Max / XR Dual Sim Setup

The iPhone XS, Max, and XR are the first Apple phones to include Dual Sim technology. For the iPhone XS and XR, this involves having an eSim as well as a physical sim card slot. This is not unlike the current generations of Google Pixel (Pixel 1 and 2), but the iPhone can have both the eSim and physical sim active at the same time. With the iPhone XS Max, the sim card slot is essentially double-sided, enabling support for 2 physical sim cards.

Now that I have this shiny new Dual-SIM-eSIM phone in my hands, I wanted to test out support for Verizon combined with Google Fi (the ultimate service combo!)… Apple, however, will not support the eSIM technology until November 2018 when they will release an app (or settings feature) which will enable setup of the eSIM.

iPhone XS on Project Fi

I’ve tested Google Project Fi on my new iPhone XS.
Data services work great, voice service is functional (sans-WiFi / Data Calling).

SMS and MMS messaging seemed even more finicky than my iPhone 6 on project fi. At first, it appeared there was no SMS functionality at all iMessage wasn’t setting-up with the number and I couldn’t send or receive SMS messages. After restarting the phone, however, iMessage did register which indicates the phone was able to successfully send a background SMS message to Apple’s servers to confirm service. The SMS functionality remained, however, severely limited. SMS messages appear to send, however, they are never delivered to the recipient. MMS message functionality (as with any iPhone on FI) is completely gone.

The extra limited SMS functionality is quite odd as I am able to send/receive SMS messages on my iPhone 6 using Google Fi. I have attempted to troubleshoot this by adjusting the APN settings to h2g2 from the default of alpha as well as resetting the network settings. Unfortunately, this being an iPhone there just aren’t that many paths to troubleshooting an issue like this. As a side note, my Fi SIM card is pretty old so I will be ordering a replacement SIM just in case the newer SIM cards have better compatibility.

My original plan with this new phone was to use Verizon as the primary sim with Google Fi as a backup. Unfortunately, Apple does not yet support dual sim functionality, but it is anticipated it will be enabled with an update in November 2018. Upon availability, I will be using the built-in eSim for my Verizon service and I will use a pre-activated Project Fi SIM in the physical sim slot.

Update 2018-11-08: iOS 12.1 brought the availability of the eSIM to the iPhone XS & XS Max. Unfortunately, there is still no support for the eSIM tech by Verizon, AT&T, T-Mobile, or Google Fi (via QR Code, Fi Supports eSIM with the app). As soon as I catch word the major US carriers have QR code eSIM availability, I will be testing it out on my XS and reporting back here.

VIM Stuck! E388: Couldn’t find definition

Simply hit escape and enter the following command to fix:

:!reset

If this doesn’t get you back to normal, you’ll have to exit your current SSH session and re-open the session in a new window.

This error happened to me after I mistakenly hit [command] + R when trying to redo instead of [control] + R.

While it was occurring, I was unable to move the cursor with the arrow keys. I could insert and add characters at the cursor spot, but nothing else really.

svgcleaner flags / usage

USAGE:
    svgcleaner   --apply-transform-to-gradients  --apply-transform-to-paths  --apply-transform-to-shapes  --convert-segments  --convert-shapes  --coordinates-precision  --group-by-style  --indent  --join-arcto-flags  --join-style-attributes  --list-separator  --merge-gradients  --paths-coordinates-precision  --paths-to-relative  --properties-precision  --regroup-gradient-stops  --remove-comments  --remove-declarations  --remove-default-attributes  --remove-desc  --remove-dupl-cmd-in-paths  --remove-dupl-fegaussianblur  --remove-dupl-lineargradient  --remove-dupl-radialgradient  --remove-gradient-attributes  --remove-invalid-stops  --remove-invisible-elements  --remove-metadata  --remove-needless-attributes  --remove-nonsvg-attributes  --remove-nonsvg-elements  --remove-text-attributes  --remove-title  --remove-unreferenced-ids  --remove-unresolved-classes  --remove-unused-coordinates  --remove-unused-defs  --remove-unused-segments  --remove-version  --remove-xmlns-xlink-attribute  --resolve-use  --simplify-transforms  --transforms-precision  --trim-colors  --trim-ids  --trim-paths  --ungroup-defs  --ungroup-groups  --use-implicit-cmds 

For more information try --help
svgcleaner --help
svgcleaner could help you to clean up your SVG files from the unnecessary data.

A complete documentation can be found here: https://github.com/RazrFalcon/svgcleaner/blob/master/docs/svgcleaner.adoc

USAGE:
    svgcleaner [FLAGS] [OPTIONS]  

     can contain values: true, false, yes, no, y, n

EXAMPLES:
    clean a file with default options:
    svgcleaner in.svg out.svg

    clean a file with custom options:
    svgcleaner --indent=2 --paths-coordinates-precision=5 --join-arcto-flags=yes in.svg out.svg

    clean a file without default options:
    svgcleaner --no-defaults --remove-comments=yes in.svg out.svg

    clean a stream using UNIX pipes:
    cat in.svg | svgcleaner -c - > out.svg

FLAGS:
    -h, --help                              Print help information
    -V, --version                           Print version information
    -c, --stdout                            Print result to the standard output
        --no-defaults                       Reset default flags to 'no'
        --multipass                         Clean a file multiple times
        --allow-bigger-file                 Allow bigger file
        --copy-on-error                     Copy an original file to the destination on error
        --quiet                             Show only warnings and errors

OPTIONS:
Elements:
    --remove-comments                 Remove XML comments [default: yes]
    --remove-declarations             Remove XML declarations [default: yes]
    --remove-nonsvg-elements          Remove non-SVG elements [default: yes]
    --remove-unused-defs              Remove unused referenced elements [default: yes]
    --convert-shapes                  Convert basic shapes into paths [default: yes]
    --remove-title                    Remove 'title' element [default: yes]
    --remove-desc                     Remove 'desc' element [default: yes]
    --remove-metadata                 Remove 'metadata' element [default: yes]
    --remove-dupl-lineargradient      Remove duplicated 'linearGradient' elements [default: yes]
    --remove-dupl-radialgradient      Remove duplicated 'radialGradient' elements [default: yes]
    --remove-dupl-fegaussianblur      Remove duplicated 'feGaussianBlur' elements [default: yes]
    --ungroup-groups                  Ungroup groups [default: yes]
    --ungroup-defs                    Ungroup 'defs' element [default: yes]
    --group-by-style                  Group elements by equal styles [default: yes]
    --merge-gradients                 Merge gradients [default: yes]
    --regroup-gradient-stops          Regroup gradient 'stop' elements [default: yes]
    --remove-invalid-stops            Remove invalid 'stop' elements [default: yes]
    --remove-invisible-elements       Remove invisible elements [default: yes]
    --resolve-use                     Resolve 'use' elements [default: yes]

Attributes:
    --remove-version                  Remove 'version' and 'baseProfile' attributes [default: yes]
    --remove-nonsvg-attributes        Remove non-SVG attributes [default: yes]
    --remove-unreferenced-ids         Remove unreferenced 'id' attributes [default: yes]
    --trim-ids                        Trim 'id' attributes [default: yes]
    --remove-text-attributes          Remove text-related attributes if there is no text [default: yes]
    --remove-unused-coordinates       Remove unused coordinate attributes [default: yes]
    --remove-default-attributes       Remove attributes with default values [default: yes]
    --remove-xmlns-xlink-attribute    Remove an unused 'xmlns:xlink' attribute [default: yes]
    --remove-needless-attributes      Remove attributes that doesn't belong to this element [default: yes]
    --remove-gradient-attributes      Remove inheritable gradient attributes [default: no]
    --join-style-attributes          Join presentational attributes [values: no, some, all] [default: some]
    --apply-transform-to-gradients    Apply transformations to gradients [default: yes]
    --apply-transform-to-shapes       Apply transformations to shapes [default: yes]
    --remove-unresolved-classes       Remove unresolved classes from 'class' attributes [default: yes]

Paths:
    --paths-to-relative               Convert path segments into relative ones [default: yes]
    --remove-unused-segments          Remove unused path segments [default: yes]
    --convert-segments                Convert path segments into shorter ones [default: yes]
    --apply-transform-to-paths        Apply transformations to paths [default: no]
    --trim-paths                      Use compact notation for paths [default: yes]
    --join-arcto-flags                Join ArcTo flags [default: no]
    --remove-dupl-cmd-in-paths        Remove subsequent segments command from paths [default: yes]
    --use-implicit-cmds               Use implicit LineTo commands [default: yes]

Output:
    --trim-colors                     Use #RGB notation [default: yes]
    --simplify-transforms             Simplify transform matrices [default: yes]
    --coordinates-precision            Set coordinates numeric precision (1..12) [default: 6]
    --properties-precision             Set properties numeric precision (1..12) [default: 6]
    --transforms-precision             Set transform values numeric precision (1..12) [default: 8]
    --paths-coordinates-precision      Set path's coordinates numeric precision (1..12) [default: 8]
    --list-separator             Set number list separator [values: space, comma, comma-space] [default: space]
    --indent                        Set XML nodes indent [values: none, 0, 1, 2, 3, 4, tabs] [default: none]

ARGS:
                                   Input file
                                  Output file

Installing Tesseract Languages

For ocrmypdf or just general tesseract work, you may need to install language packages, depending on the languages you are working in.

 

ERROR – The installed version of tesseract does not have language data for the following requested languages:

run the command

tesseract --list-langs

Error opening data file /usr/local/share/tessdata/eng.traineddata
Please make sure the TESSDATA_PREFIX environment variable is set to your “tessdata” directory.
Failed loading language ‘eng’
Tesseract couldn’t load any languages!
List of available languages (0):

 
Download the proper language data into the folder folder listed in the “Error opening data file”

svgo help / command flags [svg optimizer]

vgo --help
Nodejs-based tool for optimizing SVG vector graphics files

Usage:
  svgo [OPTIONS] [ARGS]


Options:
  -h, --help : Help
  -v, --version : Version
  -i INPUT, --input=INPUT : Input file, "-" for STDIN
  -s STRING, --string=STRING : Input SVG data string
  -f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files
  -o OUTPUT, --output=OUTPUT : Output file or folder (by default the same as the input), "-" for STDOUT
  -p PRECISION, --precision=PRECISION : Set number of digits in the fractional part, overrides plugins params
  --config=CONFIG : Config file or JSON string to extend or replace default
  --disable=DISABLE : Disable plugin by name
  --enable=ENABLE : Enable plugin by name
  --datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded)
  --multipass : Enable multipass
  --pretty : Make SVG pretty printed
  --indent=INDENT : Indent number when pretty printing SVGs
  -q, --quiet : Only output error messages, not regular status messages
  --show-plugins : Show available plugins and exit

Arguments:
  INPUT : Alias to --input

qpdf flags / usage commands

qpdf --help

Usage: qpdf [ options ] { infilename | --empty } [ outfilename ]

An option summary appears below.  Please see the documentation for details.

If @filename appears anywhere in the command-line, each line of filename
will be interpreted as an argument. No interpolation is done. Line
terminators are stripped. @- can be specified to read from standard input.

Note that when contradictory options are provided, whichever options are
provided last take precedence.


Basic Options
-------------

--version               show version of qpdf
--copyright             show qpdf's copyright and license information
--help                  show command-line argument help
--password=password     specify a password for accessing encrypted files
--verbose               provide additional informational output
--linearize             generated a linearized (web optimized) file
--copy-encryption=file  copy encryption parameters from specified file
--encryption-file-password=password
                        password used to open the file from which encryption
                        parameters are being copied
--encrypt options --    generate an encrypted file
--decrypt               remove any encryption on the file
--password-is-hex-key   treat primary password option as a hex-encoded key
--pages options --      select specific pages from one or more files
--rotate=[+|-]angle:page-range
                        rotate each specified page 90, 180, or 270 degrees
--split-pages=[n]       write each output page to a separate file

If none of --copy-encryption, --encrypt or --decrypt are given, qpdf will
preserve any encryption data associated with a file.

Note that when copying encryption parameters from another file, all
parameters will be copied, including both user and owner passwords, even
if the user password is used to open the other file.  This works even if
the owner password is not known.

The --password-is-hex-key option overrides the normal computation of
encryption keys. It only applies to the password used to open the main
file. This option is not ordinarily useful but can be helpful for forensic
or investigatory purposes. See manual for further discussion.

The --rotate flag can be used to specify pages to rotate pages either
90, 180, or 270 degrees. The page range is specified in the same
format as with the --pages option, described below. Repeat the option
to rotate multiple groups of pages. If the angle is preceded by + or -,
it is added to or subtracted from the original rotation. Otherwise, the
rotation angle is set explicitly to the given value.

If --split-pages is specified, each page is written to a separate output
file. File names are generated as follows:
* If the string %d appears in the output file name, it is replaced with a
  zero-padded page range starting from 1
* Otherwise, if the output file name ends in .pdf (case insensitive), a
  zero-padded page range, preceded by a dash, is inserted before the file
  extension
* Otherwise, the file name is appended with a zero-padded page range
  preceded by a dash.
Page ranges are single page numbers for single-page groups or first-last
for multipage groups.


Encryption Options
------------------

  --encrypt user-password owner-password key-length flags --

Note that -- terminates parsing of encryption flags.

Either or both of the user password and the owner password may be
empty strings.

key-length may be 40, 128, or 256

Additional flags are dependent upon key length.

  If 40:

    --print=[yn]             allow printing
    --modify=[yn]            allow document modification
    --extract=[yn]           allow text/graphic extraction
    --annotate=[yn]          allow comments and form fill-in and signing

  If 128:

    --accessibility=[yn]     allow accessibility to visually impaired
    --extract=[yn]           allow other text/graphic extraction
    --print=print-opt        control printing access
    --modify=modify-opt      control modify access
    --cleartext-metadata     prevents encryption of metadata
    --use-aes=[yn]           indicates whether to use AES encryption
    --force-V4               forces use of V=4 encryption handler

  If 256, options are the same as 128 with these exceptions:
    --force-V4               this option is not available with 256-bit keys
    --use-aes                this option is always on with 256-bit keys
    --force-R5               forces use of deprecated R=5 encryption

    print-opt may be:

      full                  allow full printing
      low                   allow only low-resolution printing
      none                  disallow printing

    modify-opt may be:

      all                   allow full document modification
      annotate              allow comment authoring and form operations
      form                  allow form field fill-in and signing
      assembly              allow document assembly only
      none                  allow no modifications

The default for each permission option is to be fully permissive.

Specifying cleartext-metadata forces the PDF version to at least 1.5.
Specifying use of AES forces the PDF version to at least 1.6.  These
options are both off by default.

The --force-V4 flag forces the V=4 encryption handler introduced in PDF 1.5
to be used even if not otherwise needed.  This option is primarily useful
for testing qpdf and has no other practical use.


Page Selection Options
----------------------

These options allow pages to be selected from one or more PDF files.
Whatever file is given as the primary input file is used as the
starting point, but its pages are replaced with pages as specified.

--pages file [ --password=password ] [ page-range ] ... --

For each file that pages should be taken from, specify the file, a
password needed to open the file (if any), and a page range.  The
password needs to be given only once per file.  If any of the input
files are the same as the primary input file or the file used to copy
encryption parameters (if specified), you do not need to repeat the
password here.  The same file can be repeated multiple times.  All
non-page data (info, outlines, page numbers, etc. are taken from the
primary input file.  To discard this, use --empty as the primary
input.

The page range is a set of numbers separated by commas, ranges of
numbers separated dashes, or combinations of those.  The character
"z" represents the last page.  A number preceded by an "r" indicates
to count from the end, so "r3-r1" would be the last three pages of the
document.  Pages can appear in any order.  Ranges can appear with a
high number followed by a low number, which causes the pages to appear in
reverse.  Repeating a number will cause an error, but the manual discusses
a workaround should you really want to include the same page twice.

If the page range is omitted, the range of 1-z is assumed.  qpdf decides
that the page range is omitted if the range argument is either -- or a
valid file name and not a valid range.

See the manual for examples and a discussion of additional subtleties.


Advanced Parsing Options
-------------------------------

These options control aspects of how qpdf reads PDF files. Mostly these are
of use to people who are working with damaged files. There is little reason
to use these options unless you are trying to solve specific problems.

--suppress-recovery       prevents qpdf from attempting to recover damaged files
--ignore-xref-streams     tells qpdf to ignore any cross-reference streams


Advanced Transformation Options
-------------------------------

These transformation options control fine points of how qpdf creates
the output file.  Mostly these are of use only to people who are very
familiar with the PDF file format or who are PDF developers.

--stream-data=option      controls transformation of stream data (below)
--compress-streams=[yn]   controls whether to compress streams on output
--decode-level=option     controls how to filter streams from the input
--normalize-content=[yn]  enables or disables normalization of content streams
--object-streams=mode     controls handing of object streams
--preserve-unreferenced   preserve unreferenced objects
--newline-before-endstream  always put a newline before endstream
--coalesce-contents       force all pages' content to be a single stream
--qdf                     turns on "QDF mode" (below)
--linearize-pass1=file    write intermediate pass of linearized file
                          for debugging
--min-version=version     sets the minimum PDF version of the output file
--force-version=version   forces this to be the PDF version of the output file

Version numbers may be expressed as major.minor.extension-level, so 1.7.3
means PDF version 1.7 at extension level 3.

Values for stream data options:

  compress              recompress stream data when possible (default)
  preserve              leave all stream data as is
  uncompress            uncompress stream data when possible

Values for object stream mode:

  preserve                  preserve original object streams (default)
  disable                   don't write any object streams
  generate                  use object streams wherever possible

When --compress-streams=n is specified, this overrides the default behavior
of qpdf, which is to attempt compress uncompressed streams. Setting
stream data mode to uncompress or preserve has the same effect.

The --decode-level parameter may be set to one of the following values:
  none              do not decode streams
  generalized       decode streams compressed with generalized filters
                    including LZW, Flate, and the ASCII encoding filters.
  specialized       additionally decode streams with non-lossy specialized
                    filters including RunLength
  all               additionally decode streams with lossy filters
                    including DCT (JPEG)

In qdf mode, by default, content normalization is turned on, and the
stream data mode is set to uncompress.

Setting the minimum PDF version of the output file may raise the version
but will never lower it.  Forcing the PDF version of the output file may
set the PDF version to a lower value than actually allowed by the file's
contents.  You should only do this if you have no other possible way to
open the file or if you know that the file definitely doesn't include
features not supported later versions.

Testing, Inspection, and Debugging Options
------------------------------------------

These options can be useful for digging into PDF files or for use in
automated test suites for software that uses the qpdf library.

--deterministic-id        generate deterministic /ID
--static-id               generate static /ID: FOR TESTING ONLY!
--static-aes-iv           use a static initialization vector for AES-CBC
                          This is option is not secure!  FOR TESTING ONLY!
--no-original-object-ids  suppress original object ID comments in qdf mode
--show-encryption         quickly show encryption parameters
--show-encryption-key     when showing encryption, reveal the actual key
--check-linearization     check file integrity and linearization status
--show-linearization      check and show all linearization data
--show-xref               show the contents of the cross-reference table
--show-object=obj[,gen]   show the contents of the given object
  --raw-stream-data       show raw stream data instead of object contents
  --filtered-stream-data  show filtered stream data instead of object contents
--show-npages             print the number of pages in the file
--show-pages              shows the object/generation number for each page
  --with-images           also shows the object IDs for images on each page
--check                   check file structure + encryption, linearization

The --raw-stream-data and --filtered-stream-data options are ignored
unless --show-object is given.  Either of these options will cause the
stream data to be written to standard output.

If --filtered-stream-data is given and --normalize-content=y is also
given, qpdf will attempt to normalize the stream data as if it is a
page content stream.  This attempt will be made even if it is not a
page content stream, in which case it will produce unusable results.

Ordinarily, qpdf exits with a status of 0 on success or a status of 2
if any errors occurred.  In --check mode, if there were warnings but not
errors, qpdf exits with a status of 3.