Skip to content

Instantly share code, notes, and snippets.

View iati-bot's full-sized avatar

IATI Robot iati-bot

View GitHub Profile
@iati-bot
iati-bot / codelist-migration.sh
Created December 12, 2017 16:00
A script used to migrate Codelists from Embedded to Non-Embedded
#!/usr/bin/env bash
##### A script to migrate Codelists from Embedded to Non-Embedded with the 2.03 upgrade
#### script formed of 3 sections, which should be run separately
#### some manual setting of Embedded Codelist branch names is required
# locate the codelist to update
CL_NAME=$1
echo $CL_NAME
@iati-bot
iati-bot / backup-dashboard-historic-stats.sh
Created October 23, 2017 16:14
Script to automate the backup of gitaggregate data from the IATI-Dashboard server
#!/bin/bash
# Script to automate the backup of gitaggregate data from the IATI-Dashboard server.
files=(gitaggregate-dated.tar.gz gitaggregate-publisher-dated.tar.gz gitaggregate-publisher.tar.gz gitaggregate.tar.gz gitdate.json)
backup_date=`date +\%Y-\%m-\%d`
# Loop over every file and copy from the live dashboard to the server
for file in "${files[@]}"
do
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"IATI"} # the GitHub organization whose repos will be backed up
GHBU_UNAME=${GHBU_UNAME-"bjwebb"} # the username of a GitHub account (to use with the GitHub API)
#GHBU_PASSWD=${GHBU_PASSWD-""} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see notes)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
GHBU_PRUNE_AFTER_N_DAYS=${GHBU_PRUNE_AFTER_N_DAYS-3} # the min age (in days) of backup files to delete
1
1 https://iatiregistry.org/api/1/search/dataset?isopen=false&limit=200
@iati-bot
iati-bot / debug
Last active July 31, 2017 04:45
tmp
This file has been truncated, but you can view the full file.
--2017-07-31 02:06:56-- http://www.actionaid.org/sites/files/actionaid/IATI/actionaidinternational-activities.xml
Resolving www.actionaid.org (www.actionaid.org)... 185.43.76.118
Connecting to www.actionaid.org (www.actionaid.org)|185.43.76.118|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 395966 (387K) [text/xml]
Saving to: ‘data/aai/aai-activities’
0K .......... .......... .......... .......... .......... 12% 11.0M 0s
50K .......... .......... .......... .......... .......... 25% 10.9M 0s
100K .......... .......... .......... .......... .......... 38% 11.2M 0s
393 haveorg
152 nohaveorg
545 total
250 publishers
20 publishers-allfail
206 publishers-allokay
24 publishers-onlysomefail
44 publishers-somefail
230 publishers-someokay
774 total
5328 list
5328 list-fail-validate
0 list-validate
138
11 1.0
146 1.00
214 1.01
37 1.02
805 1.03
404 1.04
400 1.05
1547 2.01
1742 2.02
data/afd/afd-per
data/aflatoun/aflatoun-apr2015
html data/be-dgd/be-dgd-org
data/ccdnigeria/ccdnigeria-1
data/cif/cif-998
data/ec-devco/ec-devco-998
data/fact/fact-srh
data/fco/fco-20130109_3
data/fco/fco-20131231_3
data/fco/fco-20140331_3