Skip to content

Instantly share code, notes, and snippets.

@ltalirz
ltalirz / docker-compose-logs.txt
Created November 1, 2017 22:08
renga: Docker Compose log
This file has been truncated, but you can view the full file.
Attaching to renga_deployer_1, renga_graph-mutation_1, renga_explorer_1, renga_projects_1, renga_graph-init_1, renga_storage_1, renga_resource-manager_1, renga_graph-typesystem_1, renga_graph-navigation_1, renga_cassandra_1, renga_ui_1, renga_keycloak_1, renga_apispec_1, renga_db_1, renga_swagger_1, renga_reverse-proxy_1
graph-mutation_1 | SLF4J: Class path contains multiple SLF4J bindings.
graph-mutation_1 | SLF4J: Found binding in [jar:file:/opt/docker/lib/ch.qos.logback.logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
graph-mutation_1 | SLF4J: Found binding in [jar:file:/opt/docker/lib/org.slf4j.slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
graph-mutation_1 | SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
graph-mutation_1 | SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
graph-mutation_1 | Oops, cannot start the server.
@ltalirz
ltalirz / pip_freeze.txt
Created November 1, 2017 22:09
renga: pip freeze
alabaster==0.7.10
appnope==0.1.0
ase==3.14.1
asetk==0.3.0
asn1crypto==0.22.0
aspy.yaml==1.0.0
astroid==1.5.3
Babel==2.3.4
beautifulsoup4==4.6.0
bleach==1.5.0
@ltalirz
ltalirz / structure.gif
Created June 6, 2018 16:51
Animated gif showing how to use the StructureUploadWidget
structure.gif
@ltalirz
ltalirz / output.log
Created August 10, 2018 10:01
output of ./script/setup from invenio cookiecutter module
$ ./scripts/setup
Cache cleared
Destroying database postgresql+psycopg2://mc-archive:mc-archive@localhost/mc-archive
Creating database postgresql+psycopg2://mc-archive:mc-archive@localhost/mc-archive
Creating all tables!
[#-----------------------------------] 5% Creating table access_actionssystemroles
[###---------------------------------] 10% Creating table accounts_role
[#####-------------------------------] 15% Creating table accounts_user
[#######-----------------------------] 20% Creating table oaiserver_set
[#########---------------------------] 25% Creating table pidstore_pid
@ltalirz
ltalirz / metadata_schema.json
Created October 26, 2020 12:12
Schema for metadata.json of AiiDA archive format v0.10
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"title": "JSON schema for the metadata.json file of the AiiDA archive format",
"description": "The metadata.json stores information on the version of the archive format and how the archive file was created.",
"required": [
"export_version",
"aiida_version",
"all_fields_info",
@ltalirz
ltalirz / affected-jobs
Created January 5, 2021 11:22
AiiDA jobs submitted multiple times
6560593 aiida-186032 /scratch/ongari/aiida_run/69/05/fe82-4790-4313-901a-399c68da4a14
6560594 aiida-186032 /scratch/ongari/aiida_run/69/05/fe82-4790-4313-901a-399c68da4a14
6560596 aiida-186032 /scratch/ongari/aiida_run/69/05/fe82-4790-4313-901a-399c68da4a14
6561394 aiida-187432 /scratch/ongari/aiida_run/75/52/bd3a-58ce-45ef-9359-717676185832
6561395 aiida-187431 /scratch/ongari/aiida_run/36/7b/2005-83ae-4ea2-9f08-75b247d77f5a
6561399 aiida-187432 /scratch/ongari/aiida_run/75/52/bd3a-58ce-45ef-9359-717676185832
6561403 aiida-187431 /scratch/ongari/aiida_run/36/7b/2005-83ae-4ea2-9f08-75b247d77f5a
6564360 aiida-195694 /scratch/ongari/aiida_run/cc/6b/bfc9-83cc-4d0c-a547-e0b1f27bfd47
6564361 aiida-195686 /scratch/ongari/aiida_run/2c/b3/03fb-8db1-4fce-87ac-2099220da650
6564362 aiida-195694 /scratch/ongari/aiida_run/cc/6
@ltalirz
ltalirz / aiida-with-pg-rmq-containers.md
Last active December 2, 2021 12:57
AiiDA production setup with containerized Postgresql & Rabbitmq

Why?

As of May 4th, 2021, erlang is not available from macports for the ARM (Apple Silicon) platform. Docker containers make it super easy to install postgresql and rabbitmq.

The M1 chips have great parallelism, so I'd hope to be able to run docker without noticing the overhead too much. I could use conda as well, but docker provides the neat docker-compose.yaml that makes it possible to start up and shut down all the services required with a single command.

Task

@ltalirz
ltalirz / tqdm_pp.py
Created July 20, 2021 16:23
tqdm with ProcessPoolExecutor
import time
import concurrent.futures
from tqdm import tqdm
def f(x):
time.sleep(0.001) # to visualize the progress
return x**2
def run(f, my_iter):
l = len(my_iter)
@ltalirz
ltalirz / 2-orbital-chain.py
Created March 7, 2023 11:28
One-dimensional chain of atoms with 2 different orbitals
#!/usr/bin/env python
from pythtb import * # import TB model class
import matplotlib.pyplot as plt
lat=[[1.0]]
# one s and one p orbital (at the same site)
orb=[[0.0],[0.0]]
my_model=tb_model(1,1,lat,orb)
# p-orbital is at higher energy (2)