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 / format.json
Created October 14, 2019 21:40 — forked from apeckham/format.json
fastly json log format
{
"service_id":"%{req.service_id}V",
"service_version":"%{fastly_info.version}V",
"time_start":%{begin:msec}t,
"time_end":%{end:msec}t,
"time_elapsed":%{time.elapsed.usec}V,
"client_ip":"%{req.http.Fastly-Client-IP}V",
"request":"%{req.request}V",
"protocol":"%{req.proto}V",
"host":"%{req.http.Fastly-Orig-Host}V",
@bugre
bugre / build-tmux.sh
Created July 21, 2019 17:44 — forked from cisano-arelia/build-tmux.sh
Script to build a static tmux for CoreOS
#!/usr/bin/env bash
#Author: https://groups.google.com/forum/#!topic/coreos-dev/JAeABXnQzuE
pushd $(dirname $0) > /dev/null; CURRABSPATH=$(readlink -nf "$(pwd)"); popd > /dev/null; # Get the directory in which the script resides
set -x
MUSLPKG="musl:musl.tgz:http://www.musl-libc.org/releases/musl-1.1.14.tar.gz"
LEVTPKG="libevent:libevent2.tgz:https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz"
TMUXPKG="tmux:tmux.tgz:https://github.com/tmux/tmux/releases/download/2.1/tmux-2.1.tar.gz"
NCRSPKG="ncurses:ncurses.tgz:http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz"
TEMPDIR="$CURRABSPATH/tmp"
TMPLIB="tempinstall/lib"

Live Transcoding

This is a collection of working commandline examples to show how one could use FFMpeg and VLC for live transcoding of video streams. All examples have been tested on OSX 10.7.5 with FFMPeg 1.1.3 and VLC 2.0.5 in early 2013.

Documentation links

@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
@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 / 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 / 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 / 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 / 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 / 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