Skip to content

Instantly share code, notes, and snippets.

@reddec
reddec / consul-agent.sh
Last active June 8, 2017 08:48
Wrapper for Docker container for run any application and register them as a service
#!/bin/sh
#
# Wrapper for Docker container for run any application
# and register them as a service
#
# Required consul >= 0.8.3
#
# Copyright Alexander Baryshnikov <dev@baryshnikov.net>
#
# MIT License
@reddec
reddec / .vimrc
Created May 20, 2016 11:54
vimrc for C
" Restore cursor position, window position, and last search after running a
" command.
function! Preserve(command)
" Save the last search.
let search = @/
" Save the current cursor position.
let cursor_position = getpos('.')
" Save the current window position.
@reddec
reddec / gopacket.py
Created September 15, 2015 13:01
Clone golang GIT repo and build rich DEB packet
#!/usr/bin/env python3
__author__ = 'reddec'
import argparse
import os
import subprocess
import shutil
import tempfile
import platform
from distutils.dir_util import copy_tree
@reddec
reddec / Clone any git repo as golang package
Last active September 13, 2015 15:51
Clone private Golang repo to import path
#!/usr/bin/env python
import subprocess
import argparse
import os
import shutil
from urlparse import urlparse
parser = argparse.ArgumentParser(description="Clone GIT repo as GO lang package")
parser.add_argument('repo', type=str, nargs=1, help='Repository URL')
parser.add_argument('--gopath', action='store', default=os.getenv('GOPATH'),