Skip to content

Instantly share code, notes, and snippets.

View ChristianKniep's full-sized avatar

Christian Kniep ChristianKniep

View GitHub Profile
import socket
import pickle
import random
import time
import struct
import threading
import urllib2
#from sc_watchdog.logger import log
@ChristianKniep
ChristianKniep / create_rangeset.sh
Created April 30, 2014 07:22
Create a rangeset out of a list of integer (used within clustershell, slurm.conf, ...).
function create_rangeset {
# consumes a list of integers and creates a rangeset
####
# $ create_rangeset 0 1 2 5 6 {10..50}
# 0-2,5-6,10-50
RSET=""
CNT="-1"
PREV_CNT="-1"
for INT in $*;do
@ChristianKniep
ChristianKniep / extract_image_downloads
Created September 15, 2014 20:00
Fetch downloads from registry.hub.docker.io
from bs4 import BeautifulSoup
import requests
req = requests.get("https://registry.hub.docker.com/u/qnib/monster/")
data = r.text
soup = BeautifulSoup(data)
for div in soup.findAll("span", class_="downloads"):
print div.text
@ChristianKniep
ChristianKniep / iter_docker_images
Last active August 29, 2015 14:06
Iterate through image list on registry.hub.docker.io
from bs4 import BeautifulSoup
from graphitesend import graphitesend
import requests
import re
gsend = graphitesend.init(graphite_server='localhost', group='dockerhub', system_name="", prefix="")
req = requests.get("https://registry.hub.docker.com/repos/qnib/")
data = req.text
soup = BeautifulSoup(data)
res = {}
@ChristianKniep
ChristianKniep / gist:2b13b0a01ebd99a82e0b7ffb2710c624
Last active April 20, 2020 18:20
docker/engine-api example to extract JSON docker-stats
package main
import (
"fmt"
"io/ioutil"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
"golang.org/x/net/context"
)
package main
import (
"github.com/docker/docker/client"
"github.com/docker/docker/api/types"
"golang.org/x/net/context"
"encoding/json"
"fmt"
)
@ChristianKniep
ChristianKniep / main.go
Created June 16, 2017 09:13
Parse DockerBench
package main
import (
"bufio"
"fmt"
"log"
"regexp"
"os"
)

Keybase proof

I hereby claim:

  • I am christiankniep on github.
  • I am qnib (https://keybase.io/qnib) on keybase.
  • I have a public key ASCoyIRNZWEzP3x0O_-oe8Qbdfl_rVnjni3A6H4At_rDtQo

To claim this, I am signing this object:

#!/bin/bash
mkdir -p /tmp/opencarp
cd /tmp/opencarp
wget -q https://opencarp.org/rpm/opencarp-v7.0.rpm
yum install -y opencarp-v7.0.rpm