Skip to content

Instantly share code, notes, and snippets.

##########

BASICS

##########

To make changes:

git add path/to/file1 path/to/file2
git commit -m "templates: Changed the XX template to do XX"

To push that to the central server (which makes it available for deployment):

@ntk148v
ntk148v / ridge.py
Created September 27, 2016 02:11 — forked from diogojc/ridge.py
Ridge Regression
#!/usr/bin/python
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
class RidgeRegressor(object):
"""
Linear Least Squares Regression with Tikhonov regularization.
@ntk148v
ntk148v / install_byobu_centos.sh
Last active September 22, 2017 07:30 — forked from kranzrm/install_byobu_centos.sh
Install byobu on CentOS (7.x)
#!/bin/bash
yum install wget
wget http://download.fedoraproject.org/pub/epel/7/x86_64/epel-release-7-10.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
yum install byobu
byobu-enable
# Default Key Bindings
# F2 -> Create new window
@ntk148v
ntk148v / local.conf
Created January 27, 2017 09:36 — forked from amotoki/local.conf
local.conf (Mitaka) - Almost all services are enabled with Neutron
[[local|localrc]]
#OFFLINE=True
RECLONE=True
HORIZON_BRANCH=stable/mitaka
KEYSTONE_BRANCH=stable/mitaka
NOVA_BRANCH=stable/mitaka
NEUTRON_BRANCH=stable/mitaka
GLANCE_BRANCH=stable/mitaka
CINDER_BRANCH=stable/mitaka
@ntk148v
ntk148v / dispatch.py
Created February 6, 2017 09:29 — forked from aortbals/dispatch.py
Synchronize two folders using python.
#! /usr/bin/python
# Dispatch - synchronize two folders
import os
import filecmp
import shutil
from stat import *
class Dispatch:
''' This class represents a synchronization object '''
@ntk148v
ntk148v / README.md
Created February 28, 2017 17:48 — forked from mbbx6spp/README.md
Gerrit vs Github for code review and codebase management

Gerrit vs Github: for code review and codebase management

Sure, Github wins on the UI. Hands down. But, despite my initial annoyance with Gerrit when I first started using it almost a year ago, I am now a convert. Fully. Let me tell you why.

Note: This is an opinionated (on purpose) piece. I assume your preferences are like mine on certain ideas, such as:

  • Fast-forward submits to the target branch are better than allowing merge commits to the target branch. The reason I personally prefer this is that, even if a non-conflicting merge to the target branch is possible, the fact that the review/pull request is not up to date with the latest on the target branch means feature branch test suite runs in the CI pipeline reporting on the review/PR may not be accurate. Another minor point is that forced merge commits are annoying as fuck (opinion) and clutter up Git log histories unnecessarily and I prefer clean histories.
  • Atomic/related changes all in one commit is something worth striving for. Having your dev
import logging
import platform
import subprocess
import psutil
LOG = logging.getLogger(__name__)
class ProcessHandler(object):
@ntk148v
ntk148v / local-minial-swift.conf
Last active September 25, 2017 09:55
local.conf for minial swift installation on devstack.
[[local|localrc]]
RECLONE=True
GIT_BASE=http://git.openstack.org
HORIZON_BRANCH=stable/mitaka
KEYSTONE_BRANCH=stable/mitaka
SWIFT_BRANCH=stable/mitaka
#-----------------------------
# Common congigurations
#-----------------------------
@ntk148v
ntk148v / local-minial-s3.conf
Last active April 24, 2017 15:01
local.conf for minial swift-s3 installation on devstack.
[[local|localrc]]
RECLONE=True
GIT_BASE=${GIT_BASE:-https://git.openstack.org}
HORIZON_BRANCH=stable/mitaka
KEYSTONE_BRANCH=stable/mitaka
SWIFT_BRANCH=stable/mitaka
#-----------------------------
# Common congigurations
#-----------------------------
@ntk148v
ntk148v / git.migrate
Created April 20, 2017 02:46 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.