Skip to content

Instantly share code, notes, and snippets.

View bdombro's full-sized avatar

Brian Dombrowski bdombro

View GitHub Profile
#!/bin/bash
echo "
Because you can only create encrypted home for another not logged in user, you must create a separate user to set up the encrypted home for.
The manjaro_setup_encrypted_home.sh script will set the ecryptfs pam moduls, and encrypt the home dir if the user has no running processes (not logged in).
Follow the original instructions from the encryption output at the end of the process: the target user should test if he/she can log in before the restart.
After setting encrypted home(s), a restart is advised.
#!/bin/bash
echo "
Because you can only create encrypted home for another not logged in user, you must create a separate user to set up the encrypted home for.
The manjaro_setup_encrypted_home.sh script will set the ecryptfs pam moduls, and encrypt the home dir if the user has no running processes (not logged in).
Follow the original instructions from the encryption output at the end of the process: the target user should test if he/she can log in before the restart.
After setting encrypted home(s), a restart is advised.
@bdombro
bdombro / touchegg.xml
Created January 9, 2022 17:55
touchegg config
<touchégg>
<settings>
<property name="composed_gestures_time">0</property>
</settings>
<application name="All">
<gesture type="TAP" fingers="2" direction="UNKNOWN">
<action type="MOUSE_CLICK">undefined</action>
</gesture>
<gesture type="TAP" fingers="3" direction="UNKNOWN">
<action type="MOUSE_CLICK">undefined</action>
@bdombro
bdombro / scrubTranslation.js
Last active September 3, 2021 15:07
scrubTranslation.js
/**
* This CLI script will scrub/delete a translation from all translation files
*/
const path = require('path');
const fs = require('fs');
const execSync = require('child_process').execSync;
const toDelete = process.argv[2];
@bdombro
bdombro / benchmark-require.sh
Last active December 17, 2020 16:14
SFCC Benchmark Require Impact
#!/bin/bash
TIMEFORMAT=%R
function fetchWithGlobals {
curl 'https://zztr-140.sandbox.us01.dx.commercecloud.salesforce.com/on/demandware.store/Sites-RefArch-Site/en_US/HelloGlobals' \
-H 'authority: zztr-140.sandbox.us01.dx.commercecloud.salesforce.com' \
-H 'cache-control: max-age=0' \
-H 'upgrade-insecure-requests: 1' \
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' \
-H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
@bdombro
bdombro / ArrayN.js
Created December 17, 2020 02:26
ArrayN.js - Extended Array for Rhino
'use strict';
var ArrayN = {
findIndex: findIndex,
find: find,
includes: includes,
keyBy: keyBy,
test: test,
};
Object.getOwnPropertyNames(Array).forEach(function(name) {
@bdombro
bdombro / ObjectN.js
Created December 17, 2020 02:25
ObjectN.js - Extended Object for Rhino
'use strict';
var ObjectN = {
assign: assign,
create: create,
entries: entries,
fromEntries: fromEntries,
pick: pick,
pickBy: pickBy,
omit: omit,
@bdombro
bdombro / prismaSchemaGen.ts
Created November 30, 2020 16:56
prismaSchemaGen.ts - an approach to prisma modularization
import * as fs from 'fs'
import * as glob from 'glob'
const datasource = fs.readFileSync('prisma/datasource.prisma')
const moduleFiles = glob.sync('src/**/*.prisma', {})
const modules = moduleFiles.reduce((a,f) => {
const module = fs.readFileSync(f)
return a + module
@bdombro
bdombro / KeyValueStore.ts
Created November 18, 2020 16:40
KeyValueStore.ts - Class to make Indexed Database's easy for Key-Value Stores with maxAge feature
/**
* Class to make Indexed Database's easy for Key-Value Stores
*
* In addition to wrapping IDB, it also adds a feature for maxAge,
* which can discard records if createdAt + maxAge > now
*
* Adapted from https://github.com/elias551/simple-kvs
* - Adds timestamp field and garbage collection feature.
*/
export default class KeyValueStore {
@bdombro
bdombro / streamFilter.js
Created April 21, 2020 22:50
Easy stream filters for, say, file read streams/pipes
/**
* Easy stream filters for, say, file read streams/pipes
*/
const stream = require('stream')
class StreamFilter extends stream.Transform {
constructor(filterCallback) {
super({
readableObjectMode: true,