Skip to content

Instantly share code, notes, and snippets.

@olberger
olberger / cas-get.sh
Last active June 21, 2023 14:15 — forked from mgrRaf/cas-get.sh
Works better with curl -L for redirections and POST parameter is execution instead of lt
#!/bin/bash
# Uncomment to debug:
#set -x
# Latest version at https://gist.github.com/olberger/4327fb94ca557e4ba58c0314d9c6f740, forked off from https://gist.github.com/mgrRaf/3432c0a189d7e7d48f9980b634f7b21e
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST="$1"
#!/bin/bash
# Usage: cas-get.sh {url} {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST="$1"
ENCODED_DEST=`echo "$DEST" | perl -p -e 's/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg' | sed 's/%2E/./g' | sed 's/%0A//g'`
#IP Addresses or hostnames are fine here
CAS_HOSTNAME=galaxy:9143
@olberger
olberger / convert.sh
Created October 18, 2022 08:30
convert wrapper to use pdftoppm in pdfsandwich
#!/bin/bash
# Convert wrapper for pdfsandwich, to avoid using imagemagick's convert for PDF to PBM conversion, as it relies on GS under the hood,
# and GS security settings disallow such conversion on most distros.
# Instead of ImageMagick's convert, we then rely on poppler-utils' pdftoppm
# To be invoked with 'pdfsandwich -convert .../convert.sh'
# By using this I figured out the options passed
# convert -verbose $*
# which are of the form
@olberger
olberger / sinistre-auto.txt
Last active May 17, 2021 09:33
Sinistre auto
group: sinistre auto
Clients = {numCl:number nom:string prenom:string adresse:string}
Contrats = {numCont:number numCl:number type:string date:string}
Vehicules = {matriculeVe:number numCont:number numCl:number marque:string annee:number puissance:number}
Sinistres = {numSi:number matriculeVe:number date:string}
Simples = {numSi:number dateReparation:string}
Complexes = {numSi:number estimation:number}
@olberger
olberger / Vagrantfile
Last active January 25, 2022 07:40
"Rapidly spinning up a VM with Ubuntu, Docker and Minikube (using the –vm-driver=none option) on my Windows laptop using Vagrant and Oracle VirtualBox" by Marc Lameriks - Source: https://technology.amis.nl/2019/02/12/rapidly-spinning-up-a-vm-with-ubuntu-docker-and-minikube-using-the-vm-drivernone-option-on-my-windows-laptop-using-vagrant-and-ora…
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.define "ubuntu_minikube" do |ubuntu_minikube|
config.vm.network "forwarded_port",
guest: 8001,
host: 8001,
auto_correct: true
@olberger
olberger / mvp.org
Created April 6, 2020 17:47
Quick & dirty Python 3 i18n (with babel) MVP

Quick & dirty Python 3 i18n (with babel) MVP

Running Kata Containers in Minikube

minikube is an easy way to try out a kubernetes (k8s) cluster locally. It utilises running a single node k8s stack in a local VM.

Kata Containers is an OCI compatible container runtime that runs container workloads inside VMs.

Wouldn't it be nice if you could use kata under minikube to get an easy out of the box experience to try out Kata? Well, turns out with a little bit of config and setup that is already supported, you can!

@olberger
olberger / shibb-cas-get.sh
Created December 4, 2014 09:59
Connection to a web app protected via Shibboleth with curl
#!/bin/sh
#set -x
# Usage: shibb-cas-get.sh {username} {password} # If you have any errors try removing the redirects to get more information
# The service to be called, and a url-encoded version (the url encoding isn't perfect, if you're encoding complex stuff you may wish to replace with a different method)
DEST=https://myapp.example.com/
SP=https://myapp.example.com/index.php
IDP="https://myidp.example.com/idp/shibboleth&btn_sso=SSOok"

Keybase proof

I hereby claim:

  • I am olberger on github.
  • I am olberger (https://keybase.io/olberger) on keybase.
  • I have a public key whose fingerprint is ACE4 6EBD 89F6 656D 6642 660B E941 DEDA 7C5B B6A5

To claim this, I am signing this object:

@olberger
olberger / sparql.py
Created May 14, 2014 15:09
Using RDFAlchemy together with RDFLib's SPARQLStore to query DBPedia and process resources in OO way
import urllib2
import os
#import sys
from itertools import islice
from rdflib import Namespace, Graph, ConjunctiveGraph, URIRef, RDFS, RDF
from rdflib.plugins.stores.sparqlstore import SPARQLStore
from rdfalchemy.rdfSubject import rdfSubject
from rdfalchemy import rdfSingle, rdfMultiple
from rdfalchemy.descriptors import rdfAbstract, rdfLocale
from rdfalchemy.orm import mapper