Skip to content

Instantly share code, notes, and snippets.

@ludwig
ludwig / README.md
Created May 17, 2019 21:58 — forked from Luzifer/README.md
Running docker-compose as a systemd service

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
@ludwig
ludwig / ca.md
Created April 17, 2019 19:09 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@ludwig
ludwig / autonomous.txt
Created April 15, 2019 16:42 — forked from benjamincharity/autonomous.txt
Instructions on how to reset the autonomous desk. This fixes a problem where the desk will not lower.
Thank you for reaching out to Autonomous! I am sorry to hear that you are having some trouble with your SmartDesk but I will be glad to assist. It sounds like your system needs a "hard reset" can I please have you follow these steps thoroughly.
Reset Steps:
Unplug the desk for 20 seconds. Plug it back in. Wait a full 20 seconds.
Press the up and down buttons until the desk lowers all the way and beeps or 20 seconds pass.
Release both buttons.
Press the down buttons until the desk beeps one more time or 20 seconds pass.
Then you are good to go!
@ludwig
ludwig / conda_cheat
Created April 10, 2019 20:15 — forked from qheuristics/conda_cheat
conda cheatsheet
to create a new environment
conda create -n mynewenviron package1 package2 etc
conda create -n newenv --clone ~anaconda
to remove an environment
conda remove -n myenvirontoremove --all
always start with
@ludwig
ludwig / CMakeLists.txt
Created March 18, 2019 11:45 — forked from johnb003/CMakeLists.txt
CMake ExternalProject_Add for Google Mock (gmock) and Google Test (gtest) Libraries With Includes and Example Usage
# Assuming this your tests/CMakeLists.txt (and your libs are setup in a root config)
# Just make sure to include(CTest) in your *root* cmake config.
# 3.9 adds support for "GoogleTest" which enumerates the tests inside
# of the code and adds them to ctest.
cmake_minimum_required(VERSION 3.9)
# Configure google-test as a downloadable library.
include(External_GTest.cmake)
@ludwig
ludwig / circle.py
Created September 17, 2018 23:37
Using `mock.patch` to redefine sin & cos
from math import cos, sin, pi
def point_on_circle(theta):
return (cos(theta), sin(theta))
DELIMITER |
CREATE FUNCTION uuid_from_bin(b BINARY(16))
RETURNS CHAR(36) DETERMINISTIC
BEGIN
DECLARE hex CHAR(32);
SET hex = HEX(b);
RETURN CONCAT(LEFT(hex, 8), '-', MID(hex, 9,4), '-', MID(hex, 13,4), '-', MID(hex, 17,4), '-', RIGHT(hex, 12));
END
|
@ludwig
ludwig / README.md
Created July 28, 2018 00:46 — forked from vitiral/README.md
ZMQ python communications

ZMQ python

Demonstrates some simple zmq communication

Similar to this example but usable more generally.

Quoting http://zeromq.org/area:faq:

Can I subscribe to messages using regex or wildcards?

@ludwig
ludwig / .gitconfig
Created July 25, 2018 21:02
git commit template
# https://chris.beams.io/posts/git-commit/
# https://robots.thoughtbot.com/better-commit-messages-with-a-gitmessage-template
[commit]
template = ~/.gitmessage
# ... other configs
@ludwig
ludwig / spacy_intro.ipynb
Created February 21, 2018 15:13 — forked from aparrish/spacy_intro.ipynb
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.