Skip to content

Instantly share code, notes, and snippets.

View Fokko's full-sized avatar
🚀

Fokko Driesprong Fokko

🚀
View GitHub Profile
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
@Fokko
Fokko / dag.py
Created February 25, 2019 14:01
from airflow import DAG
from datetime import datetime
from bigquery_get_data import BigQueryGetDataOperator
dag = DAG(
dag_id='godatafest',
schedule_interval='@daily',
default_args={
'owner': 'GoDataDriven',
C02VF05JHV2T:flink-gcs-fs fdriesprong$ spark-shell
2019-04-17 08:38:30 WARN NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
Spark context Web UI available at http://c02vf05jhv2t.localdomain:4040
Spark context available as 'sc' (master = local[*], app id = local-1555483115980).
Spark session available as 'spark'.
Welcome to
____ __
/ __/__ ___ _____/ /__
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
MacBook-Pro-van-Fokko:java fokkodriesprong$ docker run -t -i python:3.6 pip install apache-airflow[gcp_api]
Unable to find image 'python:3.6' locally
3.6: Pulling from library/python
5ae19949497e: Pull complete
ed3d96a2798e: Pull complete
f12136850781: Pull complete
1a9ad5d5550b: Pull complete
6f18049a0455: Pull complete
8daf83b35d32: Pull complete
c099d5e9ac68: Pull complete
$ curl -s http://192.168.1.111/a?f=j | jq
{
"cnt": " 19,909",
"pwr": -513,
"lvl": 0,
"dev": "",
"det": "",
"con": "",
"sts": "",
"cs0": " 0,000",
curl -s http://192.168.1.111/a?f=j | \
jq .pwr -r | \
tr ',' '.' | \
xargs printf "watt_current:0|g\\watt_current:%s|g" | \
nc -w 1 -u graphite 8125
curl -s http://192.168.1.111/a?f=j | \
jq .pwr -r | \
tr ',' '.' | \
xargs printf "watt_current:0|g\\watt_current:%s|g" | \
nc -w 1 -u graphite 8125
version: "3.3"
services:
energy-monitor-pwr:
image: fokkodriesprong/docker-alpine-cron
restart: always
links:
- graphite
environment:
- CRON_STRINGS=* * * * * curl -s http://192.168.1.111/a?f=j | jq .pwr -r | tr ',' '.' | xargs printf "watt_current:0|g\\watt_current:%s|g" | nc -w 1 -u graphite 8125
version: "3.3"
services:
energy-monitor:
image: fokkodriesprong/youless-graphite-exporter
restart: always
links:
- graphite
environment:
- YOULESS_ADDRESS=192.168.1.111
- GRAPHITE_ADDRESS=192.168.1.123