Skip to content

Instantly share code, notes, and snippets.

View victorsndvg's full-sized avatar

victorsndvg

View GitHub Profile
#/usr/bin/env bash
_completion()
{
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD - 1]}
if [ $COMP_CWORD -eq 1 ]; then
# initialize groups array with all available groups
groups=( "compile" "clean" )
default_clas=( "--help" "-h" "--version" "-v" )

Command line options:

Optional switches:

  • --PARAMETER_HANDLER_PRINT_VALUES value
    default value F
    Print parameter handler values after parsing the command line interface

  • --ENVIRONMENT_NUM_LEVELS value

@victorsndvg
victorsndvg / mkl.dockerfile
Created April 2, 2019 12:24 — forked from mgoldey/mkl.dockerfile
install basic mkl libraries in debian docker image
# install mkl
RUN apt update && apt install -y --force-yes apt-transport-https && \
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB && \
sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list' && \
apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install cpio intel-mkl-64bit-2018.3-051 && \
(find /opt/intel -name "ia32*" -exec rm -rf {} \; || echo "removing ia32 binaries") ; \
(find /opt/intel -name "examples" -type d -exec rm -rf {} \; || echo "removing examples") ; \
(find /opt/intel -name "benchmarks" -exec rm -rf {} \; || echo "removing benchmarks") ; \
(find /opt/intel -name "documentation*" -exec rm -rf {} \; || echo "removing documentation") ; \
@victorsndvg
victorsndvg / index.html
Created May 30, 2018 15:32 — forked from adunkman/index.html
Relay messages from RabbitMQ to a browser using Socket.io
<!DOCTYPE html>
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script>
(function () {
var onMessage = function (data) {
// Do something with the message data
};
@victorsndvg
victorsndvg / docker-cleanup-resources.md
Created April 2, 2018 13:46 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@victorsndvg
victorsndvg / gist:82da5480bec547929e8fba3e019dcdb5
Created March 19, 2018 07:46 — forked from gagnec/gist:5542288
Pika async consumer example
#!/usr/bin/env python26
import logging
import pika
logging.basicConfig()
class Consumer(object):
"""
A RabbitMQ topic exchange consumer that will call the specified function
@victorsndvg
victorsndvg / pub_sub_redis.py
Created February 28, 2018 17:05 — forked from bamthomas/pub_sub_redis.py
Pub/Sub redis python
from multiprocessing.process import Process
import time
import redis
def pub(myredis):
for n in range(10):
myredis.publish('channel','blah %d' % n)
time.sleep(5)
def sub(myredis, name):
@victorsndvg
victorsndvg / RedisPythonPubSub1.py
Created February 28, 2018 17:04 — forked from jobliz/RedisPythonPubSub1.py
A short script exploring Redis pubsub functions in Python
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)
self.redis = r
self.pubsub = self.redis.pubsub()
self.pubsub.subscribe(channels)
@victorsndvg
victorsndvg / dataset-management.md
Created February 19, 2018 14:40 — forked from mheadd/dataset-management.md
Sample API calls for creating, updating and deleting things in CKAN via the CKAN API.

Get package list

~$ curl http://www.civicdata.com/api/action/package_list

Get package details

~$ curl http://www.civicdata.com/api/action/package_show?id={package_id}

Upload a file to storage

~$ curl http://www.civicdata.com/api/storage/auth/form/testdata/test.csv -H "Authorization: <API-KEY>"
require 'omniauth-oauth2'
# this OmniAuth-Strategy uses the Keyrock Identity Management
# see http://catalogue.fiware.org/enablers/identity-management-keyrock
# The server url is from the public FIWARE Lab instance.
module OmniAuth
module Strategies
class FilabStrategy < OmniAuth::Strategies::OAuth2
option :name, "filab"
option :client_options, {