Skip to content

Instantly share code, notes, and snippets.

View azenned's full-sized avatar

Zenned Abderrazak azenned

View GitHub Profile
@azenned
azenned / add-ca-cert.js
Created May 1, 2021 11:40 — forked from mozfreddyb/add-ca-cert.js
privileged JS for Firefox to add a certificate as a trusted CA
if (typeof Cc == "undefined") { Cc = Components.classes; }
if (typeof Cu == "undefined") { Cu = Components.utils; }
if (typeof Ci == "undefined") { Ci = Components.interfaces; }
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509Cert = Ci.nsIX509Cert;
const nsIX509CertDB = Ci.nsIX509CertDB;
const certdb = Cc[nsX509CertDB].getService(nsIX509CertDB);
let certstring = `-----BEGIN CERTIFICATE-----
@azenned
azenned / gist:b7d5f9f4f94b684aa69d2f37d3b95411
Created May 21, 2019 09:43 — forked from jleehr/gist:7ac2a5de785881dfce99f7034547f07b
Drupal 8 - Migrate from public to private files
# Enable maintanance mode
drush state-set system.maintenance_mode 1
# Backup file field data
drush sql-query "CREATE TABLE media__field_file_bak AS SELECT * FROM media__field_file;"
drush sql-query "CREATE TABLE media_revision__field_file_bak AS SELECT * FROM media_revision__field_file;"
# Truncate file field tables (need to change storage settings)
drush sql-query "TRUNCATE media__field_file;"
drush sql-query "TRUNCATE media_revision__field_file;"