Skip to content

Instantly share code, notes, and snippets.

View iarenaza's full-sized avatar

Iñaki Arenaza iarenaza

View GitHub Profile
@iarenaza
iarenaza / hashicorp-0.9.6-Dockerfile
Last active April 6, 2018 11:07
Hashicorp Vault 0.9.6 persistent container Docker file
FROM vault:0.9.6
COPY config.hcl /vault/config/config.hcl
ENTRYPOINT ["vault"]
CMD ["server", "-config=/vault/config/config.hcl"]
@iarenaza
iarenaza / hashicorp-vault-0.9.6-docker-compose.yml
Created April 6, 2018 10:30
Hashicorp Vault 0.9.6 persistent container docker-compose.yml file
version: '3'
services:
hashicorp-vault:
build: .
image: coop.magnet.vault-single-node:0.9.6
container_name: coop.magnet.vault-single-node
cap_add:
- IPC_LOCK
expose:
@iarenaza
iarenaza / hashicorp-vault-0.9.6-config.hcl
Created April 6, 2018 10:33
Hashicorp Vault 0.9.6 file-based storage basic configuration file
storage "file" {
path = "/vault/file"
}
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = true
}
@iarenaza
iarenaza / keybase.md
Created May 4, 2018 21:32
keybase.md

Keybase proof

I hereby claim:

  • I am iarenaza on github.
  • I am iarenaza (https://keybase.io/iarenaza) on keybase.
  • I have a public key ASCdnZRePNtcbm78aimbe6O5dRlSiqa56vlfdt6seQYpygo

To claim this, I am signing this object:

@iarenaza
iarenaza / moodle-35-glossary-bug-multilang-filter.diff
Last active March 25, 2019 15:11
moodle-35-glossary-bug-multilang-filter.diff
diff --git a/filter/glossary/filter.php b/filter/glossary/filter.php
index 1f2591836a1..53f5a68d8ae 100644
--- a/filter/glossary/filter.php
+++ b/filter/glossary/filter.php
@@ -125,7 +125,7 @@ class filter_glossary extends moodle_text_filter {
if ($concept->category) { // Link to a category.
$title = get_string('glossarycategory', 'filter_glossary',
- ['glossary' => $glossaries[$concept->glossaryid], 'category' => $concept->concept]);
+ ['glossary' => format_string($glossaries[$concept->glossaryid]), 'category' => $concept->concept]);
@iarenaza
iarenaza / testkeycloak.py
Last active October 4, 2019 15:04
testkeycloak.py
#!/usr/bin/env python
# You need to install python-keycloak for this to work. Do:
#
# pip install python-keycloak
#
# first
from keycloak import KeycloakOpenID
@iarenaza
iarenaza / lein-cljfmt-check-staged-cljx-files.sh
Last active October 23, 2019 08:09
Run "lein cljfmt check" on .clj/.cljs/.cljc files staged for commit
#!/usr/bin/env bash
set -eu -o pipefail
staged_files=$(mktemp)
file_mappings=$(mktemp)
temporary_files=$(mktemp)
cljx_files=$(mktemp)
# Prepare clean up for normal or abnormal termination of the script
@iarenaza
iarenaza / flat-seq-to-tree-structure.clj
Created March 23, 2020 09:28
flat-seq-to-tree-structure.clj
user> (defn build-hierarchy [flat-list current-root]
(let [{:keys [direct-children others]} (reduce-kv (fn [m k v]
(if (= (:parent-id v) (:id current-root))
(update m :direct-children conj v)
(update m :others conj v)))
(sorted-map)
(vec flat-list))]
(if (seq direct-children)
(let [children (map (fn [direct-child]
(build-hierarchy others direct-child))
diff --git a/auth/ldap/auth.php b/auth/ldap/auth.php
index f03372f3154..3dc9b7258ba 100644
--- a/auth/ldap/auth.php
+++ b/auth/ldap/auth.php
@@ -468,6 +468,16 @@ class auth_plugin_ldap extends auth_plugin_base {
print_error('auth_ldap_ad_create_req', 'auth_ldap');
}
+ // Add the user to the default group (if configured)
+ if (!empty($this->config->create_default_group)) {
@iarenaza
iarenaza / gist:0cd871419a71b24a21c11b1a3ddddf36
Created April 13, 2021 14:43 — forked from brucecrevensten/gist:a16a554ee1c64d9ac475a1468e94f508
Configuring Leaflet, GeoServer, GeoWebCache with custom projection

Properly configuring GeoServer / GeoWebCache with Leaflet and custom projections (Proj4Leaflet)

These instructions demonstrate the process for EPSG:3572.

Set up a Gridset for the appropriate projection.

Geoserver Admin > Tile Caching > Gridsets > New Set Name / Projection to EPSG:3572, when you tab out of the Projection box it should autocomplete a bit of information here, such as Units, Meters per Unit.

Under “Gridset Bounds,” > Compute from maximum extent of CRS. We’ll need these numbers to configure Leaflet. (An error at the top may show, “Field ‘Gridset Bounds’ is required,” ignore that).