Skip to content

Instantly share code, notes, and snippets.

View noodlebreak's full-sized avatar
💭
Dormant

noodlebreak

💭
Dormant
View GitHub Profile

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@noodlebreak
noodlebreak / opencv_v3.0.0_install_c++_project_.travis.yml
Created April 25, 2016 04:05 — forked from Randommood/opencv_v3.0.0_install_c++_project_.travis.yml
Travis CI configuration file to install OpenCV v3.0.0 (beta) for use with C++ projects. Modified for v3.0.0 from original scripts available at: https://github.com/jayrambhia/Install-OpenCV.
language:
- cpp
compiler:
- gcc
before_install:
- sudo apt-get update
install:
# Credits goto: Stackoverflow user gnperumal; http://stackoverflow.com/a/12172706/1114457
# simple bash function list all the users in a group
# requires a python installation
function listusersofgroup {
python -c "import grp; print grp.getgrnam('$1')[3]"
}
# Usage: listusersofgroup <group-name>
# Gives:
@noodlebreak
noodlebreak / ipdb.sublime-snippet
Created February 12, 2016 07:45 — forked from jorgebastida/ipdb.sublime-snippet
Sublime text 2 ipdb snippet - import ipdb; ipdb.set.trace()
<snippet>
<content><![CDATA[import ipdb; ipdb.set_trace()]]></content>
<tabTrigger>ipdb</tabTrigger>
<scope>source.python</scope>
<description>ipdb</description>
</snippet>
logging.basicConfig(
format='%(levelname)s %(asctime)s %(message)s',
filename='/tmp/EJABBERD_DEBUG_LOG',
datefmt='%m-%d-%Y %I:%M:%S %p',
level=logging.DEBUG)
flog = logging.debug
flog("Hey !")
@noodlebreak
noodlebreak / springer-free-maths-books.md
Created December 29, 2015 05:54 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
# Modified version of PowerMeta from
# http://www.pydanny.com/python-partials-are-fun.html
from functools import partial
def power(base, exponent):
return base ** exponent