Skip to content

Instantly share code, notes, and snippets.

View alexrochas's full-sized avatar

Alex Rocha alexrochas

View GitHub Profile
@alexrochas
alexrochas / extract.plugin.zsh
Created February 13, 2019 16:45
Extract plugin
#!/bin/zsh
function extract {
if [[ -f $1 ]]; then
case $1 in
*.tar.bz2) tar xvjf $1;;
*.tar.gz) tar xvzf $1;;
*.tar.xz) tar xvJf $1;;
*.tar.lzma) tar --lzma xvf $1;;
*.bz2) bunzip $1;;
@alexrochas
alexrochas / .zshrc-after-componentization
Created February 13, 2019 16:41
.zshrc after componentization
# Antigen
[[ -f ~/.zsh/antigen.zsh ]] && source ~/.zsh/antigen.zsh
# Aliases
[[ -f ~/.zsh/aliases.zsh ]] && source ~/.zsh/aliases.zsh
# Quotes
[[ -f ~/.zsh/quotes.zsh ]] && source ~/.zsh/quotes.zsh
# RVM
@alexrochas
alexrochas / .zshrc-before-componentization
Created February 13, 2019 16:38
.zshrc before componentization
source /home/alex/Development/antigen/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle heroku
antigen bundle pip
antigen bundle lein
@alexrochas
alexrochas / .zshrc-antigen-block
Created February 13, 2019 16:27
.zshrc antigen example
source /home/alex/Development/antigen/antigen.zsh
# Load the oh-my-zsh's library.
antigen use oh-my-zsh
# Bundles from the default repo (robbyrussell's oh-my-zsh).
antigen bundle git
antigen bundle zsh-users/zsh-completions
antigen bundle heroku
antigen bundle pip
@alexrochas
alexrochas / .zshrc-first-example
Last active February 13, 2019 16:24
Example of my first zshrc
function whichPort() {
lsof -i tcp:$1;
}
alias zshconfig='vim ~/.zshrc'
alias vimrc='vim ~/.vimrc'
alias i3config='vim ~/.i3/config'
alias git='nocorrect git'
alias environment='sudo vim /etc/environment'
alias xsessionconf='vim ~/.xsession'
@alexrochas
alexrochas / logback.xml
Created February 4, 2019 20:34
Logback config
<configuration>
<appender name="jsonConsoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<customFields>{"log_topic":"dummy-app"}</customFields>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="jsonConsoleAppender"/>
</root>
@alexrochas
alexrochas / filebeat.yml
Last active February 4, 2019 20:29
Filebeat config
filebeat.prospectors:
- type: log
json.keys_under_root: true
# Json key name, which value contains a sub JSON document produced by our application Console Appender
json.message_key: log
enabled: true
encoding: utf-8
document_type: docker
paths:
# Location of all our Docker log files (mapped volume in docker-compose.yml)
@alexrochas
alexrochas / logstash.conf
Created February 4, 2019 20:24
Logstash config
input {
kafka {
bootstrap_servers => "localhost:9092"
topics_pattern => [".*"]
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
@alexrochas
alexrochas / alex.gems
Last active September 2, 2016 15:02
Default gemset generated with 'rvm gemset export'
# alex.gems generated gem export file. Note that any env variable settings will be missing. Append these after using a ';' field separator
actioncable -v5.0.0
actionmailer -v5.0.0
actionmailer -v4.2.4
actionpack -v5.0.0
actionpack -v4.2.4
actionview -v5.0.0
actionview -v4.2.4
activejob -v5.0.0
@alexrochas
alexrochas / pre-push
Last active February 23, 2017 23:56
Gradle pre-push hook
#!/bin/sh
#
# To enable this hook of pre-push, add to your repo ./.git/hooks/pre-push
# and be certified that is executable.
if [ -z "$GRADLE_HOME" ]; then
echo "Need to set GRADLE_HOME"
exit 1
fi