Skip to content

Instantly share code, notes, and snippets.

View amanaplan's full-sized avatar

Christian Stück amanaplan

  • St. Petersburg, FL
View GitHub Profile
@amanaplan
amanaplan / gist:078549de0c9566324f41ea07f200eb8f
Last active April 29, 2024 01:59 — forked from mattes/gist:40b5fac8231ca567e94416e7c88d2c10
Multiple Google Chrome instances on MacOS
# http://peter.sh/experiments/chromium-command-line-switches/
mkdir -p /tmp/t1
open -na "Google Chrome" --args --user-data-dir=/tmp/t1 --remote-debugging-port=9222 --disable-features=EnforcePrivacySandboxAttestations,FledgeEnforceKAnonymity
# protip: press cmd+h to hide window
@amanaplan
amanaplan / README.md
Created March 7, 2023 19:01 — forked from cgagner/README.md
Electron client certification test

Electron Client Certificate Test

Electron smart card authentication is not working on Linux. The smart card authentication relies on client certifications. This gist has instructions for testing client certifications, which will be used to test smart card authentication.

Simple example

The main.js handles the 'select-client-certificate' event from the

#!/bin/sh
## 98-vlan8_to_wan2.sh
## A script to add policy-based routing to send VLAN8 to WAN2 on the UDM-Pro
## Includes monitoring to re-add rules in the event of config changes
vlan8_to_wan2_monitor() {
(while :; do
ip rule show | grep 32400 &> /dev/null ||
(ip rule add pref 32400 from all iif br8 lookup 202)
sleep 1
@amanaplan
amanaplan / README.md
Created July 12, 2021 03:46 — forked from bekce/README.md
ldap server with mysql backend

I wanted to build an LDAP server that queries a MySQL server to fetch users and check their passwords. It is mainly used for old software that does not work with custom OAuth2 providers. Redmine is an example of this.

Instructions:

  1. Create the database and table with insert.sql
@amanaplan
amanaplan / gist:d9136200b10736e01f8238f4fa44f9f1
Created October 4, 2017 13:26 — forked from phayes/gist:2770495
Manually rendering ctools-content-type
<?
ctools_include('plugins');
ctools_include('context');
ctools_include('content');
$plugin_id = 'super_pane';
$plugin = ctools_get_plugins('ctools','content_types', $this->options['field'], $plugin_id);
$conf = array() // array of configuration to pass to the content-type
@amanaplan
amanaplan / gist:a7fba8c17472327f103b4416bebc6066
Created June 27, 2017 00:59 — forked from steve-todorov/gist:3671626
PHP Array key search for matching string.
<?php
/**
* Search through an array for a matching key.
*
* Examples:
* <code>
* $array = array(
* "database.name" => "my_db_name",
* "database.host" => "myhost.com",
@amanaplan
amanaplan / fix-vagrant-nfs.sh
Last active May 31, 2017 19:52
Fix Vagrant NFS Bash Script
#!/bin/bash
echo "\r"
echo "This script will attempt to resolve Vagrant-related"
echo "nfsd issues on macOS by removing all entries from"
echo "/etc/exports and restarting nfsd."
echo "\r"
# Ask user to confirm execution.
read -r -p "Would you like to continue? [y/N]: " response
@amanaplan
amanaplan / responsive-modal.css
Created April 6, 2017 15:44 — forked from jameswilson/responsive-modal.css
Drupal Ctools Responsive Modal
/* Override inline dom styles from modal.js */
#modalContent {
position: fixed !important;
top: 12% !important;
bottom: 12% !important;
right: 4% !important;
left: 4% !important;
}
/* Limit max width to 1000px */
div.ctools-modal-content {
@amanaplan
amanaplan / d7_language_hierarchy_inter_changelog.md
Created October 31, 2016 02:55
Drupal Language Hierarchy 7.x-1.x-dev commits since 7.x-1.4 release

Drupal Language Hierarchy 7.x-1.x-dev

Stable, community-vetted commits since 7.x-1.4 release

@amanaplan
amanaplan / uli.sh
Created October 10, 2016 15:32
Drush ULI Secure Link Bash Script
#!/usr/bin/env bash
if [ -z "$1" ]
then
# Print usage instructions.
echo "usage: uli alias"
else
uli=`drush $1 uli --browser=none`
echo "${uli/http/https}"
fi