Skip to content

Instantly share code, notes, and snippets.

@danielballan
danielballan / README.md
Last active April 21, 2020 23:29
data-transfer

Running a Local DataBroker

Place downloaded files

The exported data consists of one "messagepack" (*.msgpack) file per Bluesky Run. DataBroker can run on top of these files directly, and that's how we'll start. Alternatively, we can read the contents of these files into MongoDB to gain better performance and support for more advanced search queries. We'll address that process at the end. It may or may not be necessary depending on your needs.

@danielballan
danielballan / instructions.md
Last active September 17, 2019 21:26
Try new data access
@martyngigg
martyngigg / setup.md
Last active September 5, 2018 20:42
LFS Storage

These instructions describe how to setup a common storage area for Git LFS objects and move existing objects mantid 3rd party objects there.

Prerequisites

This requires at least version 2.3.0 of git-lfs. Start a bash shell and run git lfs env and check that the version of Git LFS reported is higher than this. If it is not then download and install a newer version of Git from https://git-scm.com/download/win and ensure you check the Git LFS option on install.

Setup and Migration

@trongthanh
trongthanh / mojave.xml
Last active June 3, 2026 09:14
macOS Mojave dynamic background re-implement as GTK+ background slideshow. Background images are changed to reflect the time of the day.
<!-- Instructions:
- Download and unzip Mojave dynamic background here: https://files.rb.gd/mojave_dynamic.zip
- Rename the extracted folder as "mojave-background" (Excuse the trouble but I renamed it on my machine and already use that path in the XML file)
- Save this xml file next to the Mojave background files
- Fix the path to the background images below (better using absolute path)
- Lastly, either:
+ GNOME: Use gnome-tweaks tool to select this XML as wallpaper (as default wallpaper settings won't let you choose wallpaper from custom path)
+ MATE: Go to background setting (in Appearance) > Choose +Add... > make sure **All files** filter is selected at the bottom right > Then choose mojave.xml
-->
<background>
@danielballan
danielballan / gist:686f9a2c218d4a35d076fadf3a3cfe62
Created January 25, 2018 17:07
Area detector teaching notes
class MyDetector(SingleTrigger, SomeHardwareThing):
hdf5 = Cpt(HDF5PluginWithFileStore, ....)
det = MyDetector('PV:..', name='det', image_name='my_image')
det.hdf5.read() # hdf5.read_attrs filename, capture_setting,
Staging:
@martyngigg
martyngigg / CMakeLists.txt
Last active October 25, 2017 22:17
Demonstrate NeXus/HDF5 bug
cmake_minimum_required (VERSION 2.8.12)
project (nxsbug)
# Find libraries
find_path (NEXUS_INCLUDE_DIR nexus/napi.h)
find_library (NEXUS_CPP_LIBRARIES NAMES NeXusCPP libNeXusCPP-0)
find_package (HDF5 COMPONENTS CXX REQUIRED)
# Flags
set (CMAKE_CXX_STANDARD 14)
@williamjmorenor
williamjmorenor / autostart
Last active December 16, 2018 03:03
Openbox autostar file for Fedora Magazine post
cat ~/.config/openbox/autostart
#Set tapping on touchpad on:
xinput set-prop 11 278 1 &
#Set desktop wallpaper:
feh --bg-scale wallpaper.jpg &
#Show system tray:
tint2 &
@danielballan
danielballan / startup.py
Created September 7, 2017 21:24
standard bluesky startup
# Make ophyd listen to pyepics.
from ophyd import setup_ophyd
setup_ophyd()
# Set up a RunEngine and use metadata backed by a sqlite file.
from bluesky import RunEngine
from bluesky.utils import get_history
RE = RunEngine(get_history())
# Set up a Broker.
@danielballan
danielballan / magics.py
Last active July 28, 2017 12:10
IPython magics for user-defined bluesky CLI-like tools
# This file must be run in the global namespace, not imported as a module.
# This can be done using an IPython profile or `%run -i magics.py`.
import ast
from IPython.core.magic import register_line_magic
import bluesky.plans as bp
@register_line_magic
def mv(line):
# %mv theta 3 --> RE(mv(theta, 3))
@apokalyptik
apokalyptik / debian-jessie-kubernetes-1.3-manual-install-guide.md
Last active November 21, 2023 12:31
Set up Kubernetes on 3 Debian Jessie virtual machines -- No magic

The Goal

Set up Kubernetes on 3 Debian Jessie virtual machines: One master. Two nodes. Additionally do this without any "magic" so that what is required to be running to make everything work is plain and obvious.

We will be using flannel for the inter-machine networking layer. Mainly because it is useful and it seems to be pretty popular.

The Setup