Skip to content

Instantly share code, notes, and snippets.

@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 &
@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)
@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:
@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>
@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

@danielballan
danielballan / instructions.md
Last active September 17, 2019 21:26
Try new data access
@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.

Replay

Replay documents from a bluesky run with realistic time spacing.

Example

This example acquires data with bluesky, saves the documents to disk, accesses the data using databroker, and finally uses replay to push the documents into a LiveTable callback.

@danielballan
danielballan / draft.md
Last active March 4, 2020 21:15
Notes on Refactoring DataBroker to Use Intake

Notes on Refactoring DataBroker to Use Intake

This document is still a working draft.

Summary

We recently refactored DataBroker, a project maintained by the DOE Light Sources as part of the Bluesky Collaboration, to leverage intake and to join the nascent community around it. We adopted several good ideas from intake's design, and we

@danielballan
danielballan / README.md
Last active March 31, 2020 15:02
Container Builder for NSLS-II JupyterHub at SDCC

Initial setup of Docker worker VM

Start the Docker daemon and a local Docker registry.

sudo systemctl start docker
sudo docker run -d -p 5000:5000 --restart=always --name registry registry:2

Install repo2docker.