(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:
| #!/bin/sh | |
| ## https://gist.github.com/rhee/e272f8bc34cc57ae3a9060c169b28154 | |
| limitKB=${1-100} | |
| exec >>/tmp/throttling.log 2>&1 | |
| trickle -v -s -d $limitKB -u $limitKB socat -d TCP4-LISTEN:5555,reuseaddr,fork TCP4:127.0.0.1:8123 | |
| data:text/html, <link rel="icon" type="image/png" href="https://pyscript.net/assets/images/favicon.ico"/> <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" /> <script defer src="https://pyscript.net/latest/pyscript.js"></script> <title>py-repl</title><body style="font-size:2rem;line-height:1.4;max-width:60rem;margin:2rem auto;padding:4rem;border:solid red 5px;border-radius:15px"> <py-repl auto-generate="true"> </py-repl> </body> |
| // ==UserScript== | |
| // @name KeepFixedWidth | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description use fixed width for google keep | |
| // @author You | |
| // @match https://keep.google.com/ | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com | |
| // @grant none | |
| // ==/UserScript== |
| ## gen() function for proc.stdout ( run_commands, vdl_run ) | |
| ## async read from proc.stdout | |
| if True: | |
| def gen(proc): | |
| remains = b'' # remaining from prev read | |
| while proc.poll() is None: | |
| rlist, _, _ = select([proc.stdout],[],[],500) | |
| if proc.stdout not in rlist: | |
| continue | |
| data = os.read(proc.stdout.fileno(), 16384) |
| """ | |
| # https://gist.github.com/rhee/c038393822eabec681092b6941ef1f1e | |
| # fake_ipython.py | |
| Usage: | |
| from fake_ipython import get_ipython | |
| """ | |
| from inspect import stack | |
| def get_ipython(): |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # // update: 2022-04-15 - single-cell python version | |
| # // gist: https://gist.github.com/rhee/f42aa18c8e3dcb7b6c03c23e750124f7 | |
| with open('__nb-convert__.bash', 'w') as fout: | |
| fout.write('''#!/bin/bash | |
| try_nbconvert() { | |
| local prefix="$1"; shift; | |
| if test ! -z "$prefix" | |
| then |
| ## monitor GPU usage in jupyter notebook -- [email protected] | |
| ## migrated to: https://gist.github.com/rhee-elten/1a1070e3a812ca863c3b937b5180b2f8 |
| # -*- coding: utf-8 -*- | |
| # --- | |
| # jupyter: | |
| # jupytext: | |
| # text_representation: | |
| # extension: .py | |
| # format_name: percent | |
| # format_version: '1.3' | |
| # jupytext_version: 1.3.0+dev | |
| # kernelspec: |
| $ cat detect-pypi-apt-proxy.sh | |
| set -x | |
| PYPI_PROXY_PORT=$1 | |
| APT_PROXY_PORT=$2 | |
| HOST_IP=$(awk '/^[a-z]+[0-9]+\t00000000/ { printf("%d.%d.%d.%d\n", "0x" substr($3, 7, 2), "0x" substr($3, 5, 2), "0x" substr($3, 3, 2), "0x" substr($3, 1, 2)) }' < /proc/net/route) | |
| if test -z "$HOST_IP";then echo "HOST_IP not found" 1>&2; exit 1; fi | |
| mkdir -p $HOME/.config/pip && cat > $HOME/.config/pip/pip.conf <<-EOL | |
| [global] | |
| index-url = http://$HOST_IP:$PYPI_PROXY_PORT/root/pypi/+simple/ | |
| [install] |