Skip to content

Instantly share code, notes, and snippets.

View bugre's full-sized avatar

Werner [wm] bugre

  • South Brazil
View GitHub Profile
@bugre
bugre / gist:ef7ad5981e54827adca2
Created September 29, 2015 10:33 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
input {
s3 {
# KEY / Secret de amazon, editar segun convenga
access_key_id => "AKIATITELAVOYADECIR"
secret_access_key => "876af98asd6f98ew6fasd98f"
# Bucket de s3 dodne se guarda el billing
bucket => "billing-bucket"
# prefijo (comienzo del nombre de fichero)
prefix => "555555555555555-aws-billing-csv-"
}
@bugre
bugre / GitHub-Forking.md
Created February 3, 2019 13:24 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@bugre
bugre / Vim Plugins bundle submodules.md
Created March 23, 2019 22:34 — forked from manasthakur/submodules.md
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim
@bugre
bugre / smtp_server.py
Created April 11, 2019 09:19 — forked from ieatkillerbees/smtp_server.py
A simple sample SMTP server to push Bamboo notification emails to Datadog's API
import asyncore
import email
import socket
from dogapi import dog_http_api as api
from smtpd import SMTPServer
class Server(SMTPServer):
def __init__(self, dd_api_keys, host="127.0.0.1", port=1125):
self.dd_api_keys = dd_api_keys
asyncore.dispatcher.__init__(self)
@bugre
bugre / aws-creds.bash
Created April 11, 2019 10:51 — forked from ddgenome/aws-creds.bash
Fetch AWS STS keys and set environment variables
#!/bin/bash
# Fetch 24-hour AWS STS session token and set appropriate environment variables.
# See http://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html .
# You must have jq installed and in your PATH https://stedolan.github.io/jq/ .
# Add this function to your .bashrc or save it to a file and source that file from .bashrc .
# https://gist.github.com/ddgenome/f13f15dd01fb88538dd6fac8c7e73f8c
#
# usage: aws-creds MFA_TOKEN [OTHER_AWS_STS_GET-SESSION-TOKEN_OPTIONS...]
function aws-creds () {
local pkg=aws-creds
@bugre
bugre / Update-branch.md
Created May 10, 2019 17:58 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@bugre
bugre / docker_descendants.py
Created May 18, 2019 11:37 — forked from altaurog/docker_descendants.py
Python3 script to find descendants of one or more docker images
#!/usr/bin/python3
#
# usage: python3 docker_descendants.py <image_id> ...
import sys
from subprocess import check_output
def main(images):
image_ids = set(images)
@bugre
bugre / kubectl-shortcuts.sh
Last active June 3, 2019 10:59 — forked from tamas-molnar/kubectl-shortcuts.sh
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@bugre
bugre / vlcrc.js
Created June 9, 2019 19:57 — forked from Marak/vlcrc.js
Remote control multiple VLC apps via the command line using nodejs
// To start vlc with telnet remote control:
// ./VLC --extraintf rc --rc-host 0.0.0.0:3000
//
// To connect to multiple vlc's
// node vlcrc.js host1:3000 host2:3000
var net = require('net');
var readline = require('readline');
//addresses of servers