Skip to content

Instantly share code, notes, and snippets.

Avatar

Maksim Rakitin mrakitin

  • Brookhaven National Laboratory
  • Upton, NY
View GitHub Profile
@mrakitin
mrakitin / switch-proxy.sh
Last active Oct 20, 2020
Switch ssh proxy configuration via a bash function
View switch-proxy.sh
switch_proxy() {
allowed_values=("o", "i")
cfg_file="$HOME/.ssh/config"
tmp_file="${cfg_file}_tmp"
ssh_base="ssh"
# ProxyCommand ssh -q -W %h:22 issh
current_pattern="ProxyCommand ssh -q -W %h:22 .${ssh_base}"
current_proxy=$(grep -e "${current_pattern}" ${cfg_file} | head -1 | tail -1 | awk '{print $NF}')
View bluesky_plan.py
import bluesky.plan_stubs as bps
import bluesky.plans as bp
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.run_engine import RunEngine
from bluesky.utils import install_kicker
from databroker import Broker
from ophyd.sim import det, motor
import matplotlib.pyplot as plt
plt.ion()
View bluesky_plan_with_custom_callback.py
import bluesky.plan_stubs as bps
import bluesky.plans as bp
from bluesky.callbacks.best_effort import BestEffortCallback
from bluesky.run_engine import RunEngine
from bluesky.utils import install_kicker
from databroker import Broker
from ophyd.sim import det, motor
import matplotlib.pyplot as plt
plt.ion()
View gen-conda-packed-envs.sh
#!/bin/bash
# To be run as:
# $ docker run -it --rm -v $PWD:/build nsls2/debian-with-miniconda:v0.1.2 bash /build/gen-conda-packed-envs.sh
set -e
. /opt/conda/etc/profile.d/conda.sh
conda install conda -y
You can’t perform that action at this time.