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 / wildfly-toolbelt.md
Last active May 11, 2016 04:46
Wildfly administration tips

#Wildfly Toolbelt

Deploy Related

Find domain deployments in filesystem

Basically, you need to open domain.xml under WILDFLY_HOME/domain/configuration and find the <deployments> session. In that session, each deployment contain a <content> tag. The attribute sha1 contains details where the file is storaged on the filesystem. EG:

<deployments>
 
#!/bin/bash
#
# O pgbadger no modo incremental gera um indice (arquivos .bin)
# para fazer o parser do log, e não possui um mecanismo interno
# de limpeza de arquivos que não estão mais em uso.
#
# Este script efetua a limpeza dos .bin obsoletos, ou seja,
# aqueles que são de dias anteriores aos correspondentes a
# semana corrente.
@jk3us
jk3us / .bash_profile
Last active May 19, 2017 19:23
My psql/tmux configuration
case "$TERM" in
screen*)
alias psql='PAGER=vim_psql_pager psql'
esac
@mitfik
mitfik / gist:3169039
Created July 24, 2012 09:22
Helper for S3 direct upload file
def s3_form_tag(options = {})
bucket = options[:bucket]
access_key_id = options[:access_key_id]
secret_access_key = options[:secret_access_key]
key = options[:key] || ''
content_type = options[:content_type] || '' # Defaults to binary/octet-stream if blank
redirect = options[:redirect] || '/'
acl = options[:acl] || 'public-read'
expiration_date = options[:expiration_date].strftime('%Y-%m-%dT%H:%M:%S.000Z') if options[:expiration_date]
max_filesize = options[:max_filesize] || 671088640 # 5 gb
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'
),
@lfryc
lfryc / gist:aae879ceb5534292e150
Last active May 11, 2020 18:51
Switch WildFly to debug mode in Runtime using jboss-cli
# switch the log level to DEBUG on console
{wildfly}/bin/jboss-cli.sh --connect
[standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=DEBUG)
[standalone@localhost:9990 /] /subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=DEBUG)
# switch it back to whatever it was initial configuration (here it is INFO)
[standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level,value=INFO)
[standalone@localhost:9990 /] /subsystem=logging/root-logger=ROOT:write-attribute(name=level,value=INFO)
@swdunlop
swdunlop / identifypanic.go
Created March 18, 2014 20:45
Identify a GOLANG Panic Function and Line in Recovery
// You can edit this code!
// Click here and start typing.
package main
import "fmt"
import "runtime"
import "strings"
func identifyPanic() string {
var name, file string
ssl = off
maintenance_work_mem = 2GB
work_mem = 2GB
fsync = off
synchronous_commit = off
wal_level = minimal
max_wal_senders = 0
archive_mode = off
wal_buffers = -1
wal_writer_delay = 20ms
@rafaeltuelho
rafaeltuelho / install-gosu-centos.md
Last active February 23, 2022 04:56
installing gosu on a centos docker box
# Install gosu.  https://github.com/tianon/gosu
ENV GOSU_VERSION=1.11
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
    && curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64" \
    && curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-amd64.asc" \
    && gpg --verify /usr/local/bin/gosu.asc \
    && rm /usr/local/bin/gosu.asc \
    && rm -r /root/.gnupg/ \
 &amp;&amp; chmod +x /usr/local/bin/gosu \
@Eugeny
Eugeny / memuse.md
Last active February 1, 2023 01:57
memuse - measure a total unique RAM taken by process tree