This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Here comes some general advise on how to use HyperLogLog | |
-- for someone who wants to implement a YouTube-like service | |
-- using the awesome https://github.com/citusdata/postgresql-hll PostgreSQL extension | |
-- | |
CREATE TABLE counter ( | |
id text NOT NULL, | |
sketch hll NOT NULL DEFAULT hll_empty(), | |
PRIMARY KEY (id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import asyncio | |
import asyncpg | |
#DB_CONFIG = { | |
# 'host': 'localhost', | |
# 'user': 'drupal_user', | |
# 'password': 'password', | |
# 'port': 5432, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Author: [email protected] | |
# | |
# 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" |