Some less than simple sed statements
stuff | sed -n '/pattern1.*/b remove
b next
:remove
# Load a second long
N
package main | |
// docker run -it --rm -v `pwd`:/src -w /src golang go build print_env.go | |
import ( | |
"fmt" | |
"os" | |
"strings" | |
) |
import os | |
from glob import glob | |
import re | |
import numpy as np | |
from itertools import combinations | |
from fractions import Fraction | |
from math import gcd | |
class FoodFile: | |
def __init__(self, name): |
# Basic windows GUI that will persistently try and put your computer to sleep. | |
# WARNING: This ignores Alt+F4 and commands to kill the app. This is on purpose. | |
# The only way to kill is with a force kill, which defeats the purpose of the | |
# script | |
import signal | |
import time | |
import os | |
import threading |
#!/usr/bin/env bash | |
set -eu | |
# Should be run in MinGW | |
if [ "$#" -lt "2" ]; then | |
echo "Usage: $0 {docker_image_name} {WSL name}" >&2 | |
exit 1 | |
fi |
Based on this article, I created a simple docker that uses the host's sssd and can authenticate
docker build -t {someimage} .
docker run -it --rm -v=/var/lib/sss/pipes/:/var/lib/sss/pipes/:rw {someimage}
Tests to show it's working
# Needs virtualenv with win32clipboard installed | |
import argparse | |
import hashlib | |
import ctypes | |
from ctypes import wintypes | |
from collections import OrderedDict | |
import win32clipboard | |
import pywintypes |
Putting Jupyter notebooks in source control is always a good idea. However, the size of notebooks can grow to be quite large due to the output of the cells being large or images. On top of that, re-running a notebook to generate different results would create a large diff for very little to no change in the code, further increasing the repo size. Eventually the repo will be large enough to be unwieldy or even hit maximum repo limits like 2GB most git servers enforce.
The solution is to strip the output of the notebooks automatically, to prevent accidentally commmiting the output. Git provides two different mechanisms to do this: