Skip to content

Instantly share code, notes, and snippets.

View karenyyng's full-sized avatar

Karen Ng karenyyng

View GitHub Profile
@karenyyng
karenyyng / gs.error
Last active March 21, 2016 23:00
gs.error fail to build Galsim with Dockerfile
Unable to get python include path python executable:
/usr/bin/python
Using the following options:
CXX = g++
FLAGS =
EXTRA_FLAGS =
LINKFLAGS = ['-fopenmp']
DEBUG = True
EXTRA_DEBUG = False
@karenyyng
karenyyng / Failed_Galsim_Dockerfile
Last active March 21, 2016 22:58
Failed_Galsim_Dockerfile
# Should update the base image ubuntu version to 16.04 LTS when it comes out
FROM ubuntu:14.04
RUN echo "\n\n---------- Downloading and building all OS level tools-----\n\n"
RUN apt update
# -y flag bypasses all questions
RUN apt install -y \
build-essential \
software-properties-common \
python-dev \
@karenyyng
karenyyng / Galsim_pip_requirement.txt
Last active March 21, 2016 04:28
python PIP requirement list
numpy==1.10.4
astropy==0.4.2
scipy==0.14.0
pyyaml
starlink-pyast
@karenyyng
karenyyng / using_remote_IPython_notebook_session.md
Last active May 5, 2017 19:47
using_remote_IPython_notebook_session.md

This post guides you through using an IPython notebook with a kernel running on a remote server / machine in the most painless way possible, even if your remote machine is behind a firewall.

This involves using your remote server / machine as a proxy. (Many thanks to Todd Gamblin for showing me how this life-changing trick works.) This trick is awesome in a sense that it reduces one layer of ssh port that you have to specify. With ssh remote forwarding method such as:

$ ssh -N -f -L $<LOCAL_PORT>:127.0.0.1:$<REMOTE_PORT> $REMOTE_HOST -vvv

you have to worry both about remote host actively listening to remote port and that the local port is available. With this proxy method, you can just treat yourself as sitting at the remote machine.

@karenyyng
karenyyng / matplotlib_cheatsheet.md
Last active March 19, 2019 16:44
Matplotlib_cheatsheet

All things about contour plot

Contour plot with log axes

Post

# approach 1 
z = np.arange(100).reshape((10,10)) 
x = np.logspace(0, 4, 10) 
y = np.logspace(0, 4, 10) 

ax1 = subplot(121) 
@karenyyng
karenyyng / vim_cheat_sheet.md
Last active November 24, 2022 17:28
vim_ultimate_cheat_sheet

Note: C- means pressing control button, not capital C. By default you are NOT in the insert mode, to enter the insert mode press i

Basic movements in non-insert mode

h   # left by 1 char
j   # down
k   # up 
l   # right 
C-f # next page 
C-b # previous page
@karenyyng
karenyyng / tmux_cheat_sheet.md
Last active November 2, 2023 05:09
common work flow of tmux

Title: Tmux project sessions
Date: 2014-12-24 17:00 Tags: Tmux, learn-X-in-Y-minutes
Author: K. Y. Ng

This is a tutorial for setting up Tmux for saving terminal project sessions.

Tmux helps you emulate several shell sessions within the same terminal window.