Protected: Grafana Notes

This content is password protected. To view it please enter your password below:

Protected: Moz FNPRMS Notes

This content is password protected. To view it please enter your password below:

Protected: Moz Dashboard Dataflow Notes

This content is password protected. To view it please enter your password below:

Linux Alerting Circa 2020: signal-cli, ssmtp

Trying to present the smallest attack service possible? Don’t want to run a local mailserver? Check, check.

From java land, use signal-cli, aka signal-cli.

From systems land, ssmtp via a google account. Here’s a how-to.

And this for the 2FA bits.

Then to test it:

echo "this is the body" | mail -s "quint automation: alerting active" bdekoz@mozilla.com

Dell Precision 5820 Tower Notes

Notes for running Fedora 29 on the Dell Precision 5820 Tower workstation. The particular model has Intel Xeon W-2155, ie 10 cores at 3.3-4.5 GHz, 32GB RAM, 500GB NVMe drive, Nvidia P400 graphics cards with mDP outs.

BIOS Settings

Linux needs certain BIOS settings flipped:

  • Secure Boot Disabled
  • System Config -> SATA to AHCI (RAID might work but untested)
  • Misc Devices -> Enable SD Card, SD Card boot
  • Boot Sequence -> UEFI, UEFI boot path security off

Install

Used the netinstall ISO image written to a SD card, and then booted the computer off this device (Hold down the function 12 key at startup to get a boot menu.)

There is no getting around the video oddness when installing. Embrace the suck. This is the only tricky part of installing on this hardware (well, the SSD drive can be a bit problematic if not using a very current Fedora version, so don’t do that).

What worked:

Add

inst.text

to the linux boot line, which boots you into text mode (aka init 3). Then,
start the network and install the Nvidia drivers from RPMFusion.

ifup en01;
dnf install -y kmod-nvidia

This should add the nouveau modules to the blacklist on future boots, but to make sure this is how to do it on the linux boot line:

rd.driver.blacklist=nouveau modprobe.blacklist=nouveau

 

Dual Boot, Windows VM, etc.

Let’s be able to run windows 10, either via virtualization or natively.

To extract the windows key from the machine when using linux, try:

sudo cat /sys/firmware/acpi/tables/MSDM | tail -c 32 | xargs -0 echo

Then use that key to install windows 10 from the ISO, or use it in an existing KVM image.

To install natively, shrink your windows install away to a mere sliver so that most space can be used by a linux install via…

Just right click on “My Computer”, choose “Manage”, and you will get a popup window, choose “Disk Management” in the left navigation bar. And then, your hard disk condition will show as follow. Then you need to right click on the partition which you want to shrink, and choose “Shrink Volume”.

WordPress CPT x AFC: Post to PDF via SVG template fun

Description

Assume that the starting point is a wordpress site with a Custom Page Type (CPT) for video (custom-type-video.php). This custom type uses Advanced Custom Fields (AFC) to store meta-data, and a uses a template file (single-video.php) to display the page on the website.

For example, this page: Craig Wilkins.

Given this display of information for the web, how is this translated into an archival print form?

Here is an example of an archival print form in PDF for the same page. This is a three-page PDF file, created by concatenating 3 individual pages into the final file.

The first page of this PDF file is generated via an input SVG file. This SVG file, as created by Inkscape or Illustrator, is a long and messy text file.

Simplified, it looks much more straightforward:

svg open


text open
afc_video_title
text close

text open
afc_video_youtube_link
text cclose

svg close

The goal is to extract the information residing in the AFC fields of the wordpress site, and strip it in to the SVG template. So, for the AFC field video_title, query the wordpress database, get a result, and strip it in to the SVG text file where afc_video_title currently resides.

Do this for all the AFC fields.Then, once done, a SVG file for this specific post will be produced.

Then, take this SVG file and transform it to a PDF file via cairosvg or inkscape.

Assume linux as the underlying OS, and utilities like ghostsript, ffmpeg, etc.

Questions

Is there a way to serialize wordpress posts that use ACF? Right now I am seeing support for Local Json, aka afc-json, which is cool and all but only describes the field group being used, not the values for a particular page.

The afc-json for data file for the above page looks like: this.

POD Linux Workflow

Follow these steps with letter or A4 sized layouts. Assuming the input is generated via composition and abuse of pdfunite, and will be called base.pdf

This becomes necessary when the design parameters for the input PDF include a lot of custom typography, complex vector art, and other challenging graphic elements. All of these vector elements are rendered to raster formats at high resolution, and then those rasterized versions are used to print the file.

In order:

    1.  Adobe Acrobat Pro as a re-writer, and save off base-opt.pdf as input for the next step. (optional)
    2. Vector transform: 50% shrink quad-A4 to A4, and then 90-degree rotate from landscape to portrait A4-sized sheet. For USA, substitute letter size for A4. (aka ghostscript-scale-to-a4p-rotate-90-file.sh)
    3. Raster Vector to TIFF: 300 dpi raster versions of complex layouts mandatory for generated forms. (aka ghostscript-drop-each-page-to-pdf.sh)
    4. Convert TIFF to PDF (aka ghostscript-tiff-to-pdf.sh)
    5. Transform individual pages into single file. (aka pdfunite)
    6. Postscript smoothing and flattening. (aka ghostscript-flatten.sh)

The final output is a file transformed-flat.pdf that is used as input to the publisher or physical press.