Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Rudi Broekhuizen rudibroekhuizen

🎯
Focusing
Block or report user

Report or block rudibroekhuizen

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
@rudibroekhuizen
rudibroekhuizen / .spacevim
Last active Dec 29, 2017
space-vim config file (liuchengxu/space-vim)
View .spacevim
" You can enable the existing layers in space-vim and
" exclude the partial plugins in a certain layer.
" The command Layer is vaild in the function Layers().
" Use exclude option if you don't want the full Layer,
" e.g., Layer 'better-defaults', { 'exclude': 'itchyny/vim-cursorword' }
function! Layers()
" Default layers, recommended!
Layer 'fzf'
Layer 'unite'
View psql_to_json.py
#!/usr/bin/env python3
import asyncio
import asyncpg
#DB_CONFIG = {
# 'host': 'localhost',
# 'user': 'drupal_user',
# 'password': 'password',
# 'port': 5432,
View mysql_to_json.php
<?php
$hostname = 'localhost';
$username = 'root';
$password = 'mypass';
$database = 'mysql';
$sql = 'select * from general_log';
//open connection to mysql db
$connection = mysqli_connect($hostname,$username,$password,$database) or die("Error " . mysqli_error($connection));
@rudibroekhuizen
rudibroekhuizen / openstack.grok
Last active Dec 7, 2015
Logstash GROK patterns for OpenStack syslogs
View openstack.grok
# Logstash GROK patterns for OpenStack syslogs
DNSMASQ_DHCP %{WORD:dhcp_action}%{TAP_DEVICE}%{SPACE}%{IPV4:dhcp_client_ip}%{SPACE}%{COMMONMAC:dhcp_client_mac}
TAP_DEVICE (\(%{GREEDYDATA:tap_device})\)
OPENSTACK_PROGRAM (^fuel$|^horizon_access$|^nova-api$|^neutron-server$|^cinder-api$|^heat-engine$|^nailgun-agent$|^mcollective$|^glance-api$|^nova-compute$|^heat-api$|^heat-api-cfn$|^dnsmasq-dhcp$|^ocf-ns_haproxy$|^murano-api$|^haproxy$|^ceph-osd$|^ceph-mon$)
OPENSTACK_USER [0-9A-Za-z]{32}
View gist:fea8b99fb689903b1d36
# Author: rudi.broekhuizen@naturalis.nl
#
# C:/Temp/metrics.ps1:
# Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DeviceID -eq "C:" } | Select-Object SystemName, Caption, FreeSpace | convertto-json -Compress | Out-File -Append -NoClobber "C:/Temp/metrics.json" -encoding utf8
# Get-WmiObject Win32_OperatingSystem | convertto-json -Depth 1 -Compress | Out-File -Append -NoClobber "C:/Temp/metrics.json" -encoding utf8
# Get-WmiObject Win32_PerfFormattedData_PerfOS_System | convertto-json -Depth 1 -Compress | Out-File -Append -NoClobber "C:/Temp/metrics.json" -encoding utf8
#
input {
exec {
command => "@powershell -NoProfile -ExecutionPolicy unrestricted -File C:/Temp/metrics.ps1"
You can’t perform that action at this time.