Skip to content

Instantly share code, notes, and snippets.

Avatar

Willy Tadema FrieseWoudloper

View GitHub Profile
@FrieseWoudloper
FrieseWoudloper / reprex_cef.R
Created Jun 16, 2020
My attempts to write an event from R to the syslog in ArcSight CEF
View reprex_cef.R
# Problem
# Write an event to the syslog in ArcSight CEF format
# Example:
# Jun 16 08:54:03 myserver.mycompany.nl CEF:0|security|threatmanager|1.0|100|worm successfully stopped|10|src=10.0.0.1 dst=2.1.2.2 spt=1232
### First option: rsyslog package ####
library(rsyslog)
View CLIWOC21.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View CLIWOC21.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FrieseWoudloper
FrieseWoudloper / bevingen.csv
Last active Dec 30, 2019
Bestanden voor blog post over Power BI, Leaflet en R
View bevingen.csv
datum locatie magnitude diepte latitude longitude jaar
1986-12-26 Assen 2.8 1.0 52.992 6.548 1986
1987-12-14 Hooghalen 2.5 1.5 52.928 6.552 1987
1989-12-01 Kwadijk 2.7 1.2 52.529 4.971 1989
1991-02-15 Emmen 2.2 3.0 52.771 6.914 1991
1991-04-25 Eleveld 2.6 3.0 52.952 6.575 1991
1991-08-08 Assen 2.7 3.0 52.965 6.573 1991
1991-12-05 Middelstum 2.4 3.0 53.358 6.657 1991
1992-05-23 Geelbroek 2.6 3.0 52.953 6.572 1992
1992-05-24 Assen 1.6 3.0 52.956 6.562 1992
@FrieseWoudloper
FrieseWoudloper / provinciehuis.txt
Created Dec 27, 2019
Power BI query om onvolledige en foute adressen van provinciehuizen te verbeteren en verrijken met LocatieServer
View provinciehuis.txt
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("LY9ba4NAEIX/yuCzD3G9YB6VQKRNoFB6QcnD6E50m81YZldK/311m8c53+E7TNdFrx6ekJ3zgughi+EoMxseiaNL3EXlPkmeW8hVuD7IeZJeDN8giWGf7XII4LR4T9yTjKsIFLQ/s7UU0Bnl5iFJoBKe6B6yd+NQiPUmKVWqXho4kf11HnXglQyTuZMmZxEZihjSvMyg/oQ3LzRMPrQOQnSFFBpEsQ9zuxgNzTqOrL8tGd4mDsRbaQyNWrBH9kH8YPXshinAZAeFUns4Vv9/Vb02X1DA2WhNtl9kdVz+AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [adres = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"adres", type text}}),
#"Build URL" = Table.AddColumn(#"Changed Type", "URL", each "https://geodata.nationaalgeoregister.nl/locatieserver/v3/free?fq=type:adres AND bron:BAG&fl=*&rows=1&q=" & [adres]),
#"Get Attributes" = Table.AddColumn(#"Build URL", "attrs", each Json.Document(Web.Contents([URL]))[response][docs]{0}),
#"Get wijkcode" = Table.AddColumn(#"Get Attributes", "wijkcode", each [attrs][wijkcode]),
#"Get buurtcode" = Table.A
@FrieseWoudloper
FrieseWoudloper / geocoding_example.R
Last active Dec 22, 2019
Geocoding example - uses PDOK LocationServer
View geocoding_example.R
library(httr)
library(dplyr)
library(readr)
library(purrr)
library(magrittr)
f <- "http://www.landelijkregisterkinderopvang.nl/opendata/export_opendata_lrk.csv"
input <- read_delim(f, delim = ";") %>%
mutate(adres = paste(opvanglocatie_adres, opvanglocatie_postcode, opvanglocatie_woonplaats)) %>%
@FrieseWoudloper
FrieseWoudloper / query.txt
Last active Dec 16, 2019
Geocoding van adressen met LocatieServer en Power Query in Power BI
View query.txt
let
Source = Csv.Document(File.Contents("C:\Users\Willy\Downloads\export_opendata_lrk (1).csv"),[Delimiter=";", Columns=39, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"lrk_id", Int64.Type}, {"type_oko", type text}, {"actuele_naam_oko", type text}, {"aantal_kindplaatsen", Int64.Type}, {"vve", type text}, {"status", type text}, {"inschrijfdatum", type date}, {"opvanglocatie_adres", type text}, {"opvanglocatie_postcode", type text}, {"opvanglocatie_woonplaats", type text}, {"bag_id", Int64.Type}, {"naam_houder", type text}, {"kvk_nummer_houder", Int64.Type}, {"vestigingsnummer_houder", Int64.Type}, {"rechtsvorm_houder", type text}, {"houder_adres", type text}, {"houder_postcode", type text}, {"houder_woonplaats", type text}, {"houder_buitenland", type text}, {"correspondentie_adres", type text}, {"correspondentie_postcode", type text}, {"correspondentie_wo
@FrieseWoudloper
FrieseWoudloper / voorbeeld1.html
Last active Nov 10, 2019
Voorbeelden uit blog post 'BRT als alternatief voor Google Maps'
View voorbeeld1.html
<!doctype html>
<html>
<head>
<title>Voorbeeld 1</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" />
</head>
<body>
<script src="https://unpkg.com/leaflet@1.5.1/dist/leaflet.js"></script>
View arrondissementsgebieden.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View index.html
<!DOCTYPE html>
<script src="https://d3js.org/d3.v3.min.js"></script>
var width = 1200;
var height = 500;
var svg = d3.select("body").append("svg")
.attr('width', width)
.attr('height', height);