2017-10-10

MacOS - How to verify a file's sha256 checksum

Terminal command:
openssl dgst -sha256 /PATH/FILE_NAME

Yields:
SHA256(/PATH/FILE_NAME)= 77aa9930be611ec3f4e72d74c897dac5a98b4e61884a4048d31e4597f9fbb9ff


2017-10-09

MySQL - GROUP_CONCAT Character Limit Setting

Run this session variable before your SQL.
Adjust the number of characters.

SET SESSION group_concat_max_len = 5000;

2017-09-27

MySQL - Table is "Read Only" error message


(1) Locate MySQL's data folder path (run this query, MySQL must be up and running).
select @@datadir;

(2) Change permissions so "mysql" can access it:
chown -Rf mysql:mysql /PATH_TO_DATA_FOLDER/data

(3) Restart MySQL.

(4) Re-attempt to make table/record changes.

2017-08-25

Collibra - DGC Workflow to export a domain view and save it as an attachment in that domain

import com.collibra.dgc.core.file.FileInfo;

// Define the view to download
// Get this from the "excel" object produced behind the scenes when you manually export the view (use Firefox or Chrome's inspector... Network Resources tab)
def tableViewConfig = '{"TableViewConfig":{"displayLength":-1,... "fieldName":"Asfdb5d2c95585d5af41aed"}}]}}'

// File Name
def fileName = "Your file name here.xlsx"
execution.setVariable( "fileName", fileName )
loggerComponent.info("File Name:" + fileName )

// Produce the file
def fileInfo = outputViewComponent.exportExcelWithoutJob( tableViewConfig, fileName, null, true, true);

// Get the file's Id
def fileId = fileInfo.getUuid()
execution.setVariable( "fileId", fileId )
loggerComponent.info("File Id:" + fileId )

// Define the target URL
outputUrl = applicationComponent.getBaseURL() + "rest/1.0/file/" + fileId
loggerComponent.info( "Output URL: " + outputUrl )

// Add as an attachment to the hosting/calling domain
// This task may need to reside within a separate script task, for synchronous execution
attachmentComponent.addAttachmentToResource( item.id, item.type.name(), fileId, fileName )

Collibra - Workaround for groovy string size limitation in Collibra DGC workflows

def VARIABLE_NAME = new TextArea( “LONG_STRING_HERE” )

PS. Tentative, yet to confirm. I assume then you can pass this variable from one workflow to another.

Meteor - Production deployment ignores CSS/Stylus

This happens, amongst perhaps other causes, due to a combination of the existence, in your project, of two packages in your project:

(1) Stylus
(2) Standard CSS Minifier

If you are using Stylus, remove the Standard CSS Minifier... that worked for me.

2017-08-13

MongoDB - Sub-document filtering to return only desired sub-documents

db.COLLECTION_NAME.find(

    // Filtering. match
    {
        "FIELD_TO_FILTER_BY": FILTER_VALUE
    }

    // Projection
    , {
        ARRAY_OF_SUBDOCS:{
            $elemMatch:{"SUB_DOC_FIELD": FILTER_VALUE }
        }
    }
);