Skip to content

Instantly share code, notes, and snippets.

View sebastianwebber's full-sized avatar
🏠
Working from home

Sebastian Webber sebastianwebber

🏠
Working from home
View GitHub Profile
@sebastianwebber
sebastianwebber / list-user-permission-by-table.sql
Last active August 29, 2015 14:21
List USER permissions by table on PostgreSQL
-- Tested on PostgreSQL 9.4
-- More details on http://www.postgresql.org/docs/9.4/static/functions-info.html
-- and http://www.postgresql.org/docs/9.4/static/view-pg-tables.html
-- and http://www.postgresql.org/docs/9.4/static/view-pg-roles.html
SELECT
schemaname,
tablename,
rolname,
has_table_privilege(rolname, tablename, 'SELECT') as can_select,
@sebastianwebber
sebastianwebber / create-drop.sql
Created June 27, 2015 23:01
Trabalhando com Constraints - PostgreSQL
SELECT
'ALTER TABLE ' ||
schema.nspname || '.' || class.relname
|| ' DROP CONSTRAINT IF EXISTS ' ||
cons.conname || ';'
FROM pg_constraint AS cons
JOIN pg_class AS class on class.oid = cons.conrelid
JOIN pg_namespace AS schema on schema.oid = cons.connamespace
WHERE schema.nspname = 'schema'
AND class.relname = 'tabela';
[Unit]
Description=RHQ Storage Node
After=network.target
PartOf=rhq-server.service
[Service]
Type=forking
ExecStart=/opt/rhq-server-4.13.1/bin/rhqctl start --storage
@sebastianwebber
sebastianwebber / rhq-server.service
Last active August 29, 2015 14:25 — forked from rafaeltuelho/rhq-server.service
JON/RHQ Server Unit Service for Systemd bases systems (tested with JON 3.3.0.GA-Update2 on RHEL 7)
[Unit]
Description=RHQ Server
Requires=rhq-storage.service
After=rhq-storage.service
[Service]
Type=forking
PIDFile=/opt/rhq-server-4.13.1/bin/internal/rhq-server.pid
[Unit]
Description=RHQ Agent
After=network.target
[Service]
Type=forking
PIDFile=/opt/rhq-agent/bin/rhq-agent.pid
ExecStart=/opt/rhq-server-4.13.1/bin/rhqctl start --agent
#!/bin/bash
yum install python-setuptools python-psutil python-psycopg2 git gcc make postgresql93-devel -y
export PATH="/usr/pgsql-9.3/bin:$PATH"
mkdir /opt/resources
cd /opt/resources
git clone https://github.com/julmon/pg_activity.git
cd pg_activity/
python setup.py install --with-man
:set bg=dark
:set nu
:set tabstop=4
:set shiftwidth=4
:set softtabstop=4
:set expandtab
:set ic
:set nowrap

Instalação do Oracle 11gR2 no OEL6

instalar vnc

yum install tigervnc-server xterm

ajustar configurações

@sebastianwebber
sebastianwebber / README.md
Last active October 7, 2015 03:08
JBoss/Wildfly server.log REGEX sheet cheat

JBoss/Wildfly server.log REGEX sheet cheat

Summary

'(WARN|ERROR)[ ]{1,}\[[\.a-z0-9A-Z]{1,}\]'

egrep sample:

egrep '(WARN|ERROR)[ ]{1,}\[[\.a-z0-9A-Z]{1,}\]' -o server.log
@sebastianwebber
sebastianwebber / README.md
Created October 23, 2015 13:57
PostgreSQL Tools SETUP