Skip to content

Instantly share code, notes, and snippets.

View francescm's full-sized avatar

Francesco Malvezzi francescm

  • Universita' di Modena e Reggio nell'Emilia
  • Italy
View GitHub Profile
@francescm
francescm / rails-bootstrap-italia-playground.md
Last active November 30, 2022 10:49
Apply bootstrap-italia css to a rails7 project

Create rails7 project with bootstrap-italia leveraging esbuild

$ rails new -j esbuild -c sass bootstrap-italia-playground
$ cd bootstrap-italia-playground
$ yarn add bootstrap-italia

please do not add bootstrap: it is already a bootstrap-italia's dependency.

edit package.json

@francescm
francescm / rails-bootstrap-italia-importmap.md
Last active November 30, 2022 10:29
Come adottare lo stile bootstrap-italia con Rails7

Create rails7 project with bootstrap-italia if you don't care about javascript

$ rails new cielogin
$ cd cielogin

Copiare e fare esplodere il bootstrap-italia.zip in ./app/assets (ma va bene anche altrove, i file saranno da copiare e spostare).

$ bundle install
$ # ./bin/importmap pin bootstrap-italia # secondo me si possono dare perdute le utility js di bootstrap
# impersonatingPrincipalName
id=impersonatingPrincipalName
transcoder=SAML2StringTranscoder
displayName.en=impersonatingPrincipalName
# displayName.bacedifo=if you want bacedifo speakers understand it
description.en=original impersonating user name
# description.bacedifo=same as above
saml2.name=urn:mace:example.org:attribute-def:impersonatingPrincipalName
saml1.encodeType=false
@francescm
francescm / AttributeDefinition.xml
Last active April 11, 2021 15:40
ScriptedAttribute for Shibboleth IdP4 to be read from filesystem
<AttributeDefinition id="impersonatingPrincipalName" xsi:type="ScriptedAttribute" language="groovy">
<ScriptFile>%{idp.home}/script/impersonatingPrincipalName.groovy</ScriptFile>
</AttributeDefinition>
@francescm
francescm / impersonatingPrincipalName.groovy
Last active April 11, 2021 15:41
impersonatingPrincipalName groovy script for Shibboleth IdP4
import org.slf4j.*
import net.shibboleth.idp.attribute.*
import net.shibboleth.idp.authn.context.SubjectContext
logger = LoggerFactory.getLogger("org.example.idp.scripted.groovy.impersonatingPrincipalName")
subjectContext = profileContext.getSubcontext(SubjectContext.class)
impersonating_principal_name = subjectContext.impersonatingPrincipalName
@francescm
francescm / access-control.xml
Last active April 11, 2021 15:41
access-control.xml for IdP4 impersonation
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:c="http://www.springframework.org/schema/c"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"

Keybase proof

I hereby claim:

  • I am francescm on github.
  • I am francescmlvz (https://keybase.io/francescmlvz) on keybase.
  • I have a public key ASAd75Brx0ejOGXHvw9Nv9ugQq9KLK6W2CeJ_FFs111F5Ao

To claim this, I am signing this object:

@francescm
francescm / dcesrv_2.trace
Created September 4, 2018 09:30
Another dcesrv trace
sudo gdb -batch -ex bt -p 1468
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
memcpy () at ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S:142
142 ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S: File o directory non esistente.
#0 memcpy () at ../sysdeps/x86_64/multiarch/../multiarch/memmove-vec-unaligned-erms.S:142
#1 0x00007fe51ffc0627 in tdb_read (tdb=0x55574745e270, off=124847564, buf=0x7ffea210e260, len=24, cv=0) at ../lib/tdb/common/io.c:279
#2 0x00007fe51ffc1434 in tdb_rec_read (tdb=0x55574745e270, offset=124847564, rec=0x7ffea210e260) at ../lib/tdb/common/io.c:736
#3 0x00007fe51ffba37d in tdb_find (tdb=0x55574745e270, key=..., hash=490668901, r=0x7ffea210e260) at ../lib/tdb/common/tdb.c:95
#4 0x00007fe51ffba4d8 in tdb_find_lock_hash (tdb=0x55574745e270, key=..., hash=490668901, locktype=0, rec=0x7ffea210e260) at ../lib/tdb/common/tdb.c:125
@francescm
francescm / dcesrv.trace
Created September 4, 2018 09:26
gdb output from dcesrv task
sudo gdb -batch -ex bt -p 1468
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007fe520249f6c in _int_realloc (av=av@entry=0x7fe520569b00 <main_arena>, oldp=oldp@entry=0x55574746a790, oldsize=oldsize@entry=21744, nb=nb@entry=21760) at malloc.c:4330
4330 malloc.c: File o directory non esistente.
#0 0x00007fe520249f6c in _int_realloc (av=av@entry=0x7fe520569b00 <main_arena>, oldp=oldp@entry=0x55574746a790, oldsize=oldsize@entry=21744, nb=nb@entry=21760) at malloc.c:4330
#1 0x00007fe52024b719 in __GI___libc_realloc (oldmem=0x55574746a7a0, bytes=21744) at malloc.c:3083
#2 0x00007fe5217fe11f in _talloc_realloc (context=0x55574801b6a0, ptr=0x55574746a800, size=21648, name=0x7fe51ad248f6 "struct ldb_message *") at ../lib/talloc/talloc.c:1985
#3 0x00007fe5217ff778 in _talloc_realloc_array (ctx=0x55574801b6a0, ptr=0x55574746a800, el_size=8, count=2706, name=0x7fe51ad248f6 "struct ldb_message *") at ../lib/talloc/talloc.c:2743
#4 0x00007f
@francescm
francescm / gist:57cf3ee5cd335ec7ac9f
Created February 4, 2015 08:14
groovy email script definition
import org.slf4j.*
import net.shibboleth.idp.attribute.*
logger = LoggerFactory.getLogger("org.example.idp.scripted.groovy.email")
values = []
if ( uid && ! uid.getValues().empty )
{
uid.getValues().each() { values.add "${it}@example.org" }