Skip to content

Instantly share code, notes, and snippets.

Joris de Vrede jorisdevrede

  • The Netherlands
Block or report user

Report or block jorisdevrede

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View server.py
from argparse import ArgumentParser
from configparser import ConfigParser
from http.server import BaseHTTPRequestHandler
from socketserver import TCPServer
import time
class MyHandler(BaseHTTPRequestHandler):
def do_GET(self):
View spool.yml
---
- name: Reboot
hosts: all
become: yes
tasks:
- name: reboot system
@jorisdevrede
jorisdevrede / log.py
Last active Jan 10, 2018
python logger
View log.py
#!/usr/bin/env python
import argparse
import logging
def main():
logging.debug('main')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--log',
View hlogreader.py
#!/usr/bin/env python
from __future__ import print_function
import argparse
import re
import os
class HlogReader:
type_principal = 1
@jorisdevrede
jorisdevrede / install.sh
Last active Dec 6, 2017
development client installation
View install.sh
sudo apt-get install -y software-properties-common
sudo apt-add-repository -y ppa:ansible/ansible
sudo apt-get update
sudo apt-get install -y ansible
echo 'set nocompatible' > ~/.vimrc
sudo apt-get install -y maven
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
View config.md

Java

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Java Cryptography Extension (JCE) Unlimited Strength

To utilize 256 bits keys in Java, the following extensions need to be installed: Unlimited Strength Jurisdiction Policy Files (Java 8)

@jorisdevrede
jorisdevrede / connect.py
Last active Nov 16, 2017
Elasticsearch optimization
View connect.py
from argparse import ArgumentParser
from logbook import Logger, StreamHandler
import json
import requests
import sys
import uuid
StreamHandler(sys.stdout).push_application()
log = Logger(__name__)
View weighted_spark_grid.py
from pyspark import SparkConf, SparkContext
from operator import add
def explode_coords(record):
"""Restructure record into multi (coord, value) tuples
Takes a list of [x-coord, y-coord, value] and explodes that
into inverted tuples with a key (x,y) and a value v for all
View instructions.md

Import relevant Spark classes

Spark ML and SQL classes are considered optional and therefore not loaded by default. You will need to load these before proceding with ML.

from pyspark.ml import Pipeline
from pyspark.ml.feature import *
from pyspark.ml.classification import *
from pyspark.ml.evaluation import *
View readme.md

Kopieer mij:

diamonds = sqlContext.sql("SELECT * FROM diamonds")
display(diamonds.select("*"))

Kopieer mij:

diamonds = sqlContext.sql("SELECT * FROM diamonds")
You can’t perform that action at this time.