Skip to content

Instantly share code, notes, and snippets.

View gullevek's full-sized avatar

Clemens Schwaighofer gullevek

View GitHub Profile
@gullevek
gullevek / screen_init.bash
Last active August 29, 2015 14:26
[File will no longer be maintained, use the main git entry: https://github.com/gullevek/scripts/blob/master/screen/screen_init.sh] Helps to init a screen session. Very useful if you have various large ones and want to recreate them after a server reboot.
# Final file has moved into a main GIT:
# https://github.com/gullevek/scripts/blob/master/screen/screen_init.sh
# This file below will no longer be updated.
#!/bin/bash
# AUTHOR: Clemens Schwaighofer
# DATE: 2015/8/4
# DESC: inits a screen with shells (sets titles) and runs command in those shells
# reads all data from a config file
@gullevek
gullevek / progress.pm
Last active August 29, 2015 14:10
perl and python module for progress print out in percent, rows, lines per second, etc
package Progress;
# AUTHOR: Clemens Schwaighofer
# DATE CREATED: 2009/6/16
# DESCRIPTION: progress percent class
# METHODS
# * init
# my $prg = Progress->new();
# will init a new progress class in the var $prg
@gullevek
gullevek / New New Index Bloat Query
Last active July 25, 2022 17:35 — forked from mbanck/New New Index Bloat Query
This version uses pg_stats and not pg_statistics so any user can use this query
WITH btree_index_atts AS (
SELECT nspname, relname, reltuples, relpages, indrelid, relam,
regexp_split_to_table(indkey::text, ' ')::smallint AS attnum,
indexrelid as index_oid
FROM pg_index
JOIN pg_class ON pg_class.oid=pg_index.indexrelid
JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace
JOIN pg_am ON pg_class.relam = pg_am.oid
WHERE pg_am.amname = 'btree'
),