Skip to content

Instantly share code, notes, and snippets.

View biggers's full-sized avatar

Mark Biggers biggers

View GitHub Profile

Reference: http://stackoverflow.com/a/11593308

I have two branches A and B and, I want to merge branch A's single file with Branch B's corresponding file. How can I do that?

I have two branches A [master] and B with the same files but a different programming interface in some files. Now the methods of file f, which is independent of the interface differences in the two branches, were changed in branch B, but the change is important for both branches. Thus, I need to merge just file f of branch B into file f of branch

from fabric.api import *
from fabric.context_managers import cd
from fabric.operations import local as lrun, sudo
from fabric.contrib.files import sed
from fabric.utils import warn
from local_fabfile import root, prod, lh, SERVER_IP
def virtualenv(command, run_directory=''):
if run_directory == '':
@biggers
biggers / fabfile.py
Created December 4, 2015 23:21 — forked from rochacbruno/fabfile.py
fabfile
#!/usr/bin/python
# encoding: utf-8
from __future__ import with_statement
import os
import sys
import datetime
from fabric.api import cd, run, prefix, task, env, get, roles
from fabric.colors import yellow, green
from contextlib import contextmanager as _contextmanager
@biggers
biggers / x11vnc.sh
Created August 19, 2016 14:37
x11vnc service start-up script
#!/bin/sh
VNC_SERVER=/usr/bin/x11vnc
VNC_DISPLAY=:0
LOG_FILE=/tmp/x11vnc-run.log
case "$1" in
start|restart)
killall ${VNC_SERVER}
@biggers
biggers / network_mgr_wired_mgmt_recipe.sh
Created January 18, 2017 14:09
Enable wired-interfaces (incl VPN) to be managed by systemd - Ubuntu Linux 16+
# NetworkManager should manage wired interfaces!
# Linux Mint 18.x (Ubuntu 16.04)
# REF: "fixing VPN problem in Ubuntu",
# http://blog.wensheng.org/search?updated-min=2015-01-01T00:00:00-06:00&updated-max=2016-01-01T00:00:00-06:00&max-results=5
aptitude install etckeeper
git log
nmcli c # NOTE: no wired-interface controlled
emacs -nw /etc/NetworkManager/NetworkManager.conf
@biggers
biggers / ansible-tagged-install.sh
Last active January 18, 2017 14:10
Installing Ansible from 'git source' -- by tagged-release
## better, working "shell-recipe" for installing a tagged
## Ansible release, from Git source
## https://github.com/ansible/ansible/tags
sudo aptitude install python-yaml python-jinja2 python-paramiko
cd ~/git/Python
tag_name='v1.9.4-1'
git clone git://github.com/ansible/ansible.git --recursive
@biggers
biggers / Makefile.docker
Created March 22, 2016 15:46
GNU Makefile for docker-compose work
## -*- makefile -*-
## biggers@utsl.com, Mark Biggers
## GNU Makefile for docker-compose build & run of a Python or other Project
##
## REFs:
## https://docs.docker.com/compose/reference/
## https://github.com/docker/compose/releases
##
@biggers
biggers / opennebula-suse-install.rst
Created October 31, 2013 15:23
OpenNebula: openSUSE first-cut Deployment -- document

OpenNebula: openSUSE first-cut Deployment

Author

Mark Biggers <mbiggers@ine.com

Description

Install & configuration of OpenNebula (ONE) 4.x on openSUSE 12.3

Ref

SDB:Cloud OpenNebula: <http://en.opensuse.org/SDB:Cloud_OpenNebula>

Ref

ONE Installing the Software: <http://opennebula.org/documentation:rel4.2:ignc#opensuse_platform_notes>

Ref

KVM driver, KVM configuration: <http://opennebula.org/documentation:archives:rel4.0:kvmg#kvm_configuration>

Ref

ONE Rel 4.2 packages, for openSUSE: <http://download.opensuse.org/repositories/Cloud:/OpenNebula:/Testing/openSUSE_12.3/>

@biggers
biggers / streamlogger.py
Last active June 30, 2017 14:44 — forked from pmuller/streamlogger.py
StreamLogger is a context handler which proxies an output stream to python's logging
#!/usr/bin/env python3
#
# Port of "Fabric streamlogger" to Python3
# Credit (originally): https://gist.github.com/2376336.git
# pmuller - streamlogger.py
import sys
import logging
from io import StringIO
@biggers
biggers / async_threadpool_blocking_fn.py
Created August 10, 2017 16:38
async Python3 code using blocking-function
from concurrent.futures import ThreadPoolExecutor, as_completed
import time
import random
TPOOL_SIZE = 8
def blocking(pid):
""" a non-deterministic "blocking" ? task
"""