Skip to content

Instantly share code, notes, and snippets.

Avatar

noodlebreak

View GitHub Profile
View using-multiple-github-accounts-with-ssh-keys.md

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 Apr 25, 2016 — 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.
View opencv_v3.0.0_install_c++_project_.travis.yml
language:
- cpp
compiler:
- gcc
before_install:
- sudo apt-get update
install:
View list_users_in_a_group.sh
# 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 Feb 12, 2016 — forked from jorgebastida/ipdb.sublime-snippet
Sublime text 2 ipdb snippet - import ipdb; ipdb.set.trace()
View ipdb.sublime-snippet
<snippet>
<content><![CDATA[import ipdb; ipdb.set_trace()]]></content>
<tabTrigger>ipdb</tabTrigger>
<scope>source.python</scope>
<description>ipdb</description>
</snippet>
View file logging python
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 Dec 29, 2015 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
View functools_partial.py
# 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
You can’t perform that action at this time.