Skip to content

Instantly share code, notes, and snippets.

View rgolangh's full-sized avatar

Roy Golan rgolangh

View GitHub Profile
grammar Osinfo;
parse : line* EOF ;
line : COMMENT | EOL | os_record ;
COMMENT : '#' .*? EOL;
os_record : 'os' DOT UNIQUE_OS_NAME DOT attribute DOT key_value EOL;
attribute : ID
| NAME
package org.ovirt.engine.core.bll;
import javax.annotation.Resource;
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import org.infinispan.transaction.tm.DummyTransactionManager;
import org.jboss.arquillian.container.test.api.Deployment;
@rgolangh
rgolangh / gerrit-rerun-hooks.user.js
Last active April 13, 2016 06:38
Gerrit Rerun Hook greasemonkey script
// ==UserScript==
// @name Gerrit Rerun Hooks Comment Button
// @namespace http://www.ovirt.org/gmscripts
// @description Add a button that will add a comment with rerun-hooks message
// @grant none
// @include https://gerrit.ovirt.org/#/c/*
// @version 0.1
// @run-at document-idle
// ==/UserScript==
@rgolangh
rgolangh / AppErrorsGenerator.java
Created September 19, 2016 07:04
A java class generator out of properties file - mainly for oVirt resources files but can be tweaked to create any class
package org.ovirt.engine.common;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.nio.file.FileSystems;
import java.util.Map;
import java.util.Properties;
import com.google.gwt.i18n.client.Constants;
@rgolangh
rgolangh / table_status_by_dead_rows.sql
Last active December 8, 2016 20:59
Report postgres user tables stats order by dead rows count
SELECT
relname,
n_tup_upd,
n_tup_del,
n_tup_hot_upd,
n_dead_tup,
last_vacuum,
last_autovacuum,
last_analyze,
last_autoanalyze,
@rgolangh
rgolangh / large-setup.yml
Last active August 16, 2017 06:41
Build an ovirt lab using ansible
---
- hosts: localhost
connection: local
vars:
#engine_prefix: /
engine_url: "http://example.com:8080/ovirt-engine/api"
engine_user: admin@internal
engine_password: PASSWORD
engine_insecure: true
#engine_cafile: /etc/pki/ovirt-engine/ca.pem
#! /bin/sh
GERRIT_URL=https://gerrit.ovirt.org
function gerrit.change_id() {
git show --shortstat | grep Change-Id | gawk '{print $2}'
}
function gerrit.related.change_id() {
curl -s ${GERRIT_URL}/changes/$(gerrit.change_id)/revisions/current/related | sed '1d' | jq '.[][0] | .commit.commit' | tr -d '"'
#!/bin/sh -x
function usage() {
echo "
USAGE
$0 [IN_FILE]
IN_FILE=/path/to/in_file $0
ES_ADDRESS=elasticsearch.example.com IN_FILE=/path/to/in_file $0
This is a loader from fluentd file into elastic-search
-- extracted from pgcluu https://github.com/darold/pgcluu/blob/0366836dfcbf4285d08bdd36eab58f18b40d2255/pgcluu_collectd#L2473
--
-- dump_missing_indexes generate a ddl scirpt to create missing indexes on foreign keys
--
SELECT
date_trunc('seconds',
now()),
current_database(),
relname,
'CREATE INDEX CONCURRENTLY idx_' || relname || '_' || array_to_string(column_name_list,
@rgolangh
rgolangh / configmap.yaml
Last active January 3, 2019 22:10
Deployment on kubernetes
apiVersion: v1
data:
connection: |
url=https://ovirt-engine-fqdn/ovirt-engine/api
username=admin@internal
password=123
insecure=True
cafile=
kind: ConfigMap
metadata: