Skip to content

Instantly share code, notes, and snippets.

Avatar

Julio Acuña urkonn

View GitHub Profile
@urkonn
urkonn / init.el
Last active Jan 18, 2019
emacs.d/init.el
View init.el
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/"))
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(package-initialize)
View .gitconfig
[user]
email = user@example.com
name = User Name
[credential]
helper = cache
token = s3cr3t
View kebase.md

Keybase proof

I hereby claim:

  • I am urkonn on github.
  • I am urkonn (https://keybase.io/urkonn) on keybase.
  • I have a public key ASBKHRCMqjAbWyimcps1G8-Cv6EBxWkoLIu6EOesWFe7VQo

To claim this, I am signing this object:

View ckan-insertlogos.py
# bulk insert organizations logos in CKAN
import os
import ckanapi
HOST = os.getenv('CKAN_HOST')
TOKEN = os.getenv('CKAN_API_TOKEN')
LOGOS_URL = os.getenv('IMAGE_HOST')
remote = ckanapi.RemoteCKAN(HOST, user_agent='ckanops/1.0', apikey=TOKEN)
@urkonn
urkonn / ckangroupcreate.py
Created Feb 29, 2016
creates a new group in CKAN with existing datasets
View ckangroupcreate.py
import os
import ckanapi
HOST = os.getenv('CKAN_HOST')
TOKEN = os.getenv('CKAN_API_TOKEN')
remote = ckanapi.RemoteCKAN(HOST, user_agent='ckanops/1.0', apikey=TOKEN)
remote.action.group_create(name='group-name',
packages=[{'id': 'dataset-name1'},
{'id': 'dataset-name2'},
{'id': 'dataset-name3'}])
View ckanops.md

ckanops.py

ALL YOUR DATASETS ARE BELONG TO US

Overview

August 22, 2014

A collection of everyday tasks on CKAN.

@urkonn
urkonn / gist:67db3a0153e473daa847
Created Jul 9, 2014
Get the id from all datasets in CKAN
View gist:67db3a0153e473daa847
#!/usr/bin/env python
import ckanapi
ckan_instance = ckanapi.RemoteCKAN('http://192.168.33.20:8080',
apikey='XXXXX',
user_agent='ckanapi/1.0')
ds_info = ckan_instance.action.current_package_list_with_resources()
View gist:35e0a95dd52dbf068e32
#!/usr/bin/env python
import urllib2
import urllib
import json
import pprint
request = urllib2.Request(
'http://192.168.33.20:8080/api/action/package_show')
request.add_header('Authorization', 'XXXXX')
View gist:8ab91363553b473859d7
#!/usr/bin/env python
import ckanapi
import subprocess
ckan_instance = ckanapi.RemoteCKAN('http://192.168.33.20:8080',
apikey='XXXXX',
user_agent='ckanapi/1.0')
try:
pkg = ckan_instance.action.package_update(id='xxxxx', license_id='')