Skip to content

Instantly share code, notes, and snippets.

View licode's full-sized avatar

Li Li licode

  • Brookhaven National Laboratory
View GitHub Profile
svn status -u # predict conflicts
import time
import copy
import numpy
import logging
logger = logging.getLogger('iss_processor')
logging.basicConfig(level='DEBUG')
# DEFINE DATABASE
conda build recipe/ python=3.6 -c anaconda
Glob /home/lili/dev/pygobject-feedstock/python=3.6 did not match in root_dir /home/lili/dev/pygobject-feedstock
ERROR:conda_build.utils:Glob /home/lili/dev/pygobject-feedstock/python=3.6 did not match in root_dir /home/lili/dev/pygobject-feedstock
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for pygobject
INFO:conda_build.metadata:Attempting to finalize metadata for pygobject
Solving environment: ...working... done
@licode
licode / _etc_systemd_system_kafka.service
Created April 17, 2018 15:31 — forked from Radamanf/_etc_systemd_system_kafka.service
Kafka daemon with System.d. You also can use bin/kafka for init.d. Just unzip ZooKeeper and Kafka to you home/user/soft/ dir and create listed three files then enable them to be autostarted by systemctl enable kafka.service and systemctl enable zookeeper.service.
[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=zookeeper.service network.target remote-fs.target
After=zookeeper.service network.target remote-fs.target
[Service]
Type=forking
PIDFile=/var/run/kafka.pid
ExecStart=/home/user/bin/kafka start
cd /opt
wget http://apache-mirror.rbc.ru/pub/apache/kafka/0.10.1.0/kafka_2.11-0.10.1.0.tgz
tar xvzf kafka_2.11-0.10.1.0.tgz
ln -s kafka_2.11-0.10.1.0/ kafka
vi /etc/systemd/system/kafka-zookeeper.service
[Unit]
Description=Apache Zookeeper server (Kafka)
Documentation=http://zookeeper.apache.org
# 3 config server first
mongod —configsvr
# mongos, the router
mongos —configdb ip1:port1, ip2:port2, ip3:port3
# mongod at 3 servers
# mongod —shardsvr
@licode
licode / Kafka
Last active April 18, 2018 18:42
Installation:
# install java
# based on https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-debian-8
sudo apt-get update
sudo apt-get install default-jre
sudo apt-get install default-jdk
lili@cmb01:~$ java -version
@licode
licode / streaming_arrow.py
Created March 2, 2018 17:02 — forked from cpcloud/streaming_arrow.py
Streaming Arrow
import random
import time
from collections import deque
from threading import Thread
import zmq
import numpy as np
import pandas as pd
@licode
licode / docker
Last active November 4, 2018 17:17
docker images
docker run -i -t docker_name:version
docker run -it -name li docker_name:version # give it a name
# list containers
docker ps
# go back to a running image
docker attach name(or ID)
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: