Skip to content

Instantly share code, notes, and snippets.

@jcb91
jcb91 / hub_first_successful_spawn_and_redirect.log
Created May 17, 2018 18:21
500: "failed to check authorization" on second start of single-user server
[I 2018-05-17 17:28:29.242 JupyterHub log:122] 302 GET /hub/oauth_login?next= → https://login.microsoftonline.com/36dcc9bb-8e53-421f-8c83-3a8f4f66ee0d/oauth2/authorize?redirect_uri=https%3A%2F%2Fexample.com%2Fhub%2Foauth_callback&client_id=d22e4e92-0c35-437d-8b33-7a2be1bab4a2&response_type=code&state=
[D 2018-05-17 17:28:39.449 JupyterHub proxy:552] Proxy: Fetching GET http://10.10.0.47:8001/api/routes
17:28:39.452 - info: [ConfigProxy] 200 GET /api/routes
[I 2018-05-17 17:28:47.015 JupyterHub azuread:57] ID3: REDACTED AAD_TENANT_ID
[D 2018-05-17 17:28:47.474 JupyterHub base:268] Setting cookie for josh.barnes: jupyter-hub-token, {'secure': True, 'httponly': True}
[I 2018-05-17 17:28:47.475 JupyterHub base:346] User logged in: josh.barnes
[I 2018-05-17 17:28:47.475 JupyterHub log:122] 302 GET /hub/oauth_callback?code=AQABAAIAAADX8GCi6Js6SK82TsD2Pb7riQM7X-KdhxRNyfOZBq-rzwxa2CRj3U7lUcXddnanmc1QvernCqb5j5Zas1Iqz0jDS4P3Wiyvygw0R9mqlZIlRQ8x3ANEH49IG2qcpNMBFoDs-_dJX4G_pkErM5k0RTH3AQtPxCn22rTyBYYqbX5gTYr2IV-9aCPI58U
@jcb91
jcb91 / make_ssh_cell_magic.py
Last active April 27, 2018 11:16
add an ssh cell script magic
"""
This cell magic allows one to do things like
In [1]: %%script ssh -T my_wonderful_host.example.com
...: hostname
...: echo done;
my_wonderful_host.example.com
done
"""
@jcb91
jcb91 / install_docker.sh
Created April 26, 2018 10:29
install docker on ubuntu
#!/usr/bin/env bash
# Uninstall old versions
sudo apt-get remove docker docker-engine docker.io
# Install packages to allow apt to use a repository over HTTPS
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
@jcb91
jcb91 / hunspell.ipynb
Created November 17, 2017 13:14
investigating hunspell eu dictionaries
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcb91
jcb91 / screen.md
Last active April 30, 2017 14:36
Screen Cheat Sheet

GNU Screen Cheat Sheet

Starting screen

  • screen –DR -> list of detached screen
  • screen –r PID -> attach detached screen session
  • screen –dmS MySession -> start a detached screen session
  • screen –r MySession -> attach screen session with name MySession

Basics

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcb91
jcb91 / metakernel_script_magic.py
Created January 15, 2017 19:18
Module providing IPython core's script magics (like %%bash) to metakernel kernels.
# Copyright (c) 2017 Joshua Cooke Barnes
# Distributed under the terms of the BSD-3-Clause License
# https://opensource.org/licenses/BSD-3-Clause
"""
Provides IPython core's script magics (like %%bash) to metakernel kernels.
This is achieved by wrapping the IPython.core.magics.script versions in a
metakernel.magic.Magic subclass which can provides the correct magically-named
methods, help methods and other stuff required by metakernel but not provided
by the core implementations.
@jcb91
jcb91 / many_headings.ipynb
Last active January 26, 2017 12:44
Jupyter notebook to test arbitrary numbers of headings
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jcb91
jcb91 / tmux_local_install.sh
Last active August 22, 2016 11:31 — forked from sharjeelsayed/tmux_local_install.sh
bash script for installing tmux without root access. Updated to Tmux 2.2 from github rather than sourceforge
#!/bin/bash
# Source: https://gist.github.com/ryin/3106801
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.2
sudo apt-add-repository universe
sudo apt-add-repository multiverse
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install exfat-fuse chromium-browser dkms bcmwl-kernel-source