Skip to content

Instantly share code, notes, and snippets.

@valeriocos
valeriocos / dump-all.sh
Last active September 26, 2019 10:43
[crossminer] Dump Elasticsearch indexes (remember to create the BACKUP_FOLDER, you need to install elasticdump)
#!/bin/bash
BACKUP_FOLDER=backup
ELASTICSEARCH=https://admin:admin@localhost:9200
echo "scava-conf-smells"
NODE_TLS_REJECT_UNAUTHORIZED=0 elasticdump \
--input=$ELASTICSEARCH/scava-conf-smells \
--output=$BACKUP_FOLDER/scava-conf-smells.mapping.json \
--limit=100 \
omm_section,omm_score,scava_project_name,ow2_project_name
OMM_COM,"1,9",scheduling,proactive
OMM_CMM,4,scheduling,proactive
OMM_DOC,3,scheduling,proactive
OMM_INF,"2,9",scheduling,proactive
OMM_MGT,"4,4",scheduling,proactive
OMM_LIC,"1,2",scheduling,proactive
OMM_DEV,"0,8",scheduling,proactive
OMM_TST,"0,8",scheduling,proactive
OMM_REL,"4,3",scheduling,proactive
@valeriocos
valeriocos / scava_stats.py
Last active July 9, 2019 09:04
Generates a list of stats (i.e., min, max, avg, sum, median, last) for a set of metrics per project, and save the data obtained to an CSV file.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Get metrics from Scava and publish them in Elasticsearch
# If the collection is a OSSMeter one add project and other fields to items
#
# Copyright (C) 2018 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@valeriocos
valeriocos / get-oauth2-token-meetup-api
Last active May 4, 2022 07:03
Get a bearer/OAuth2 token for Meetup application-only requests in Python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
@valeriocos
valeriocos / logs_inspector.py
Last active June 3, 2019 10:37
Inspect logs info
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@valeriocos
valeriocos / collect-archives-opt.py
Last active April 8, 2019 20:04
Download the archives from githubarchive.com between two dates, process them, store the results in a MySQL db (pool threads and bulk inserts)
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@valeriocos
valeriocos / collect-archives-store-in-db.py
Last active April 2, 2019 21:34
Download and process the archives from githubarchive.com between two dates, the results are stored to a MySQL database
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@valeriocos
valeriocos / collect-archives-threads.py
Last active April 2, 2019 21:33
Download and process the archives from githubarchive.com between two dates using threads
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@valeriocos
valeriocos / collect-archives-processes.py
Last active April 2, 2019 16:14
Download and process the archives from githubarchive.com between two dates using multiprocessing
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@valeriocos
valeriocos / collect-archives-seq.py
Last active August 7, 2023 22:23
Download and process the archives from githubarchive.com between two dates
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2019 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,