Skip to content

Instantly share code, notes, and snippets.

View rgolangh's full-sized avatar

Roy Golan rgolangh

View GitHub Profile
@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
@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 / 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 / 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==
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;
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