Skip to content

Instantly share code, notes, and snippets.

@ntarocco
ntarocco / delete-record.py
Last active November 1, 2023 10:13
InvenioRDM scripts
from invenio_rdm_records.proxies import current_rdm_records_service
from invenio_access.permissions import system_identity
from invenio_records_permissions.generators import SystemProcess
from invenio_db import db
RECID = "<recid>"
current_rdm_records_service.config.permission_policy_cls.can_delete = [SystemProcess()]
current_rdm_records_service.delete(system_identity, RECID)
db.session.commit()
@ntarocco
ntarocco / docker-prune
Created May 7, 2021 07:37
Docker stop/prune
#!/bin/bash
docker stop $(docker ps -aq)
echo y | docker container prune # Remove all stopped containers
echo y | docker volume prune # Remove all unused volumes
# docker image prune # Remove unused images
echo y | docker system prune # don't really know...
docker ps -a
@ntarocco
ntarocco / Bookmarklet
Last active November 2, 2020 07:15
Bookmarklet for COVID "Attestation de déplacement dérogatoire", attestation generator in France (https://media.interieur.gouv.fr/deplacement-covid-19/)
Bookmarket (<https://en.wikipedia.org/wiki/Bookmarklet>) to autofill the form for sport. If you need for groceries, replace
document.getElementById('checkbox-sport_animaux').checked = true;
with
document.getElementById('checkbox-achats').checked = true;
Instructions:
1. fill in the values with your personal information
@ntarocco
ntarocco / keybase.md
Created January 23, 2018 12:52
My Keybase identity

Keybase proof

I hereby claim:

  • I am ntarocco on github.
  • I am ntarocco (https://keybase.io/ntarocco) on keybase.
  • I have a public key ASCzPgwl611JdAl-oKtrrOQbVX0CwJS6gXicWjQwFM3FBAo

To claim this, I am signing this object:

@ntarocco
ntarocco / docker-stop.sh
Last active August 31, 2021 17:42
Stop and remove all docker containers
#!/usr/bin/env bash
docker stop $(docker ps -aq)
# docker container prune # Remove all stopped containers
# docker volume prune # Remove all unused volumes
# docker image prune # Remove unused images
# docker system prune # All of the above, in this order: containers, volumes, images
echo y | docker system prune
@ntarocco
ntarocco / nico.zsh-theme
Last active October 23, 2017 16:57
Yet another ZSH theme, simple and nice looking
# fork from AVIT ZSH Theme
PROMPT='
$(_user_host)${_current_dir}$(git_prompt_info)
$ '
PROMPT2='%{$fg[grey]%}◀%{$reset_color%} '
#RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(git_prompt_short_sha) $(_git_time_since_commit) ${_return_status} %T% %{$(echotc DO 1)%}'
RPROMPT='$(_vi_status)%{$(echotc UP 1)%}$(git_prompt_short_sha) ${_return_status} %T% %{$(echotc DO 1)%}'