Skip to content

Instantly share code, notes, and snippets.

@helderco
helderco / .bash_aliases
Last active Nov 20, 2017
Docker aliases
View .bash_aliases
# Add to /etc/hosts
# 127.0.0.1 localhost docker.local db mail
alias docker-host="echo docker.local"
alias drun="docker run -it --rm"
# Docker Compose
alias dc="docker-compose"
@helderco
helderco / db-open
Created Oct 6, 2015
Script to open a mysql database in Sequel Pro from a service in docker-compose.
View db-open
#!/bin/bash
set -e
show_help() {
cat << EOF
Usage: ${0##*/} [-u USER] [-p PASS] [-P PORT] [-H HOST] [DATABASE]
${0##*/} -h
Open a standard connection in Sequel PRO.
View logstash.conf
input {
stdin {
type => "stdin-type"
}
file {
type => "syslog"
path => [ "/var/log/*.log", "/var/log/messages", "/var/log/syslog" ]
start_position => "beginning"
}
@helderco
helderco / README.md
Last active Jan 2, 2016
port forwarding to remote host with iptables
View README.md

Requirements

  • Vagrant
  • VirtualBox

To make it easier to update the virtual box guest additions in case you're running a more updated virtual box, run:

vagrant plugin install vagrant-vbguest
@helderco
helderco / .bash_profile
Last active Dec 17, 2018
Packages installation in a fresh installation of MacOS X.
View .bash_profile
# Aliases
alias ls='ls -hG'
alias ll='ls -l'
alias la='ls -A'
alias lla='ls -lA'
alias le='ls -lAeO@'
alias cleardns="dscacheutil -flushcache"
alias crontab="VIM_CRONTAB=true crontab"
alias gl="git log --graph --pretty='format:%C(yellow)%h%Cblue%d%Creset %s %C(white)%an, %ar%Creset'"
View superplugin.py
from pelican import readers
from pelican import signals
from pelican.utils import get_date
import json
# in lambda x, y: {what to return} ... x is the metadata string and y is settings
def process_json(value, settings):
# do something with `value` such as some cleanup if needed
return json.loads(value)
@helderco
helderco / dsync.py
Last active Dec 17, 2015
Utility to sync local installation of Drupal with a remote one
View dsync.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# dependency:
# pip install clint
from __future__ import print_function
import sys
import os