Skip to content

Instantly share code, notes, and snippets.

View fulv's full-sized avatar
🇮🇹

Fulvio Casali fulv

🇮🇹
  • San Diego, CA, USA
  • 00:02 (UTC -08:00)
View GitHub Profile
@fulv
fulv / main.yml
Last active March 29, 2025 14:42
Ansible - Creating users and copying ssh keypair files to the remote server
Put this in your `local-configure.yml` file, add as many users as you need:
users:
- name: fulvio
sudoer: yes
auth_key: ssh-rsa blahblahblahsomekey this is actually the public key in cleartext
- name: plone_buildout
group: plone_group
sudoer: no
auth_key: ssh-rsa blahblahblah ansible-generated on default
@fulv
fulv / ecriture-des-documents-modele-libreoffice.md
Last active November 25, 2017 17:51
Writing LibreOffice templates

Principles

The office document template is a LibreOffice document written normally, except for the significant fact ;-) that it will contain computer code, allowing to display data from the context, to have conditions, to run loops, to incorporate sub-templates, etc.

When generating the document in a given context, the computer code present in the template is "interpreted" and replaced by data to produce the final document.

The computer syntax used is that of the appy framework library, whose "pod" module manages the generation of the document. The "gen" module of that library is not used.

It is possible to insert the computer code in several ways, all explained below. The presence of this computer code does not prevent formatting.

@fulv
fulv / keybase.md
Created November 1, 2017 09:52
keybase.md

Keybase proof

I hereby claim:

  • I am fulv on github.
  • I am fulv (https://keybase.io/fulv) on keybase.
  • I have a public key ASDg2gQIZPcepu34-km30wPcU1hZM4V0_eZAQTlrNkDDVAo

To claim this, I am signing this object:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by FULL-PACKAGE-NAME preflight VERSION, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ ./preflight -q
## --------- ##
## Platform. ##
@fulv
fulv / gist:7311639
Created November 5, 2013 00:06
This works similarly to https://gist.github.com/fulv/7260167. The only difference is that form1 and form2 have a flditems field, which is a datagrid, and uses formdatagrid as its associated form. Formdatagrid has two fields, a text fldname, and a number fldquantity. After creating a document with form1, containing a few datagrid rows, open form2.
<plominodatabase id="testdb2">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
@fulv
fulv / testdb.xml
Created November 1, 2013 02:23
Simple Plomino DB design to reproduce issue in Products.CMFPlomino 1.18.2: * Create a document with form1 * Then Open form2 The design consists of only two forms, with two fields each. Form2 was created as a copy of Form1, and then a formula was added in the beforeCreateDocument hook. The first field in both forms has a default value, the second…
<plominodatabase id="testdb">
<design>
<dbsettings version="1.18">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">False</debugMode>
<CountDocuments type="Products.Archetypes.Field.BooleanField">False</CountDocuments>
@fulv
fulv / testdb.xml
Created February 20, 2013 00:43
Sample Plomino db design to reproduce an issue with date fields in a datagrid (https://github.com/plomino/Plomino/issues/251). There are two forms: frmVendor and frmHistory. The main form is frmVendor, which has a single field: fldHistory. This field is a datagrid, and uses frmHistory as its associated form. The frmVendor onSave event creates a …
<plominodatabase id="testdb">
<design>
<dbsettings version="1.16">
<AboutDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></AboutDescription>
<UsingDescription type="Products.Archetypes.Field.TextField"><![CDATA[]]></UsingDescription>
<IndexAttachments type="Products.Archetypes.Field.BooleanField">False</IndexAttachments>
<FulltextIndex type="Products.Archetypes.Field.BooleanField">True</FulltextIndex>
<IndexInPortal type="Products.Archetypes.Field.BooleanField">False</IndexInPortal>
<debugMode type="Products.Archetypes.Field.BooleanField">True</debugMode>
<StorageAttachments type="Products.Archetypes.Field.BooleanField">False</StorageAttachments>
@fulv
fulv / case-insensitive.py
Created November 18, 2015 23:59
herding cats
from Products.Archetypes.annotations import AT_ANN_STORAGE
from Products.Archetypes.annotations import AT_FIELD_MD
from Products.Archetypes.annotations import AT_MD_STORAGE
from Products.Archetypes.annotations import AT_REF
from Products.Archetypes.annotations import getAnnotation
from Products.Archetypes.ArchetypeTool import listTypes
from Products.Archetypes.ArchetypeTool import process_types
from Products.Archetypes.ArchetypeTool import registerClasses
from Products.Archetypes.ArchetypeTool import registerType
[theme]
title = plonetheme.tango
description = An example diazo theme
rules = /++theme++plonetheme.tango/rules.xml
prefix = /++theme++plonetheme.tango
doctype = <!DOCTYPE html>
enabled-bundles =
disabled-bundles =
development-css = /++theme++plonetheme.tango/css/main.less
@fulv
fulv / setuplanguages.py
Created November 20, 2012 04:44
migrate I18NFolders
from Products.CMFCore.utils import getToolByName
from Acquisition import aq_parent, aq_inner
def setup(self):
result = []
setterupper = SetupFolders(self)
result.extend(setterupper.setup())
result.extend(setterupper.dfs(self))
result.extend(setterupper.linkGlobalTranslations())
return '\n'.join(result)