Skip to content

Instantly share code, notes, and snippets.

@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'),
@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 / .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 / 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 / backup-compose.sh
Created July 29, 2017 07:38
Simple backup of docker-compose with images and data-volumes
#!/bin/sh
if [ "1$1" != "1" ]; then
cd "$1"
fi
BACKUP_IMAGES="backup/images"
BACKUP_VOLUMES="backup/volumes"
rm -rf "$BACKUP_IMAGES"
0xaD9b872817b05315611B23F1C16306e0E692ab87
0x7d60184a28111092225d274c743993D8C9d9D7bb
0xE650dABEC5005E0A7e847f64BFcd743Bd1Bb1a50
0xcb8606ae62a075cdd20c7da79b79bd387c0f7280
@reddec
reddec / 8d3f76cb4d343720913305c599524bbc96e17f6c
Created October 19, 2017 07:53
8d3f76cb4d343720913305c599524bbc96e17f6c
0x8d3f76cb4d343720913305c599524bbc96e17f6c