This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yaml | |
data = {} | |
yaml.safe_dump( | |
data, | |
sys.stdout, | |
default_flow_style=False, | |
default_style='"', | |
sort_keys=True, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.ml.classification.LogisticRegression | |
import org.apache.spark.ml.feature.VectorAssembler | |
import org.apache.spark.sql.SparkSession | |
object LogiReg extends App { | |
val spark = SparkSession | |
.builder() | |
.master("local[*]") | |
.appName("LogiReg") | |
.getOrCreate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://techoverflow.net/2013/10/22/docker-remove-all-images-and-containers/ | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
start_time = time.time() | |
total_size = 0 | |
for dirpath, _, _ in os.walk("."): | |
with os.scandir(dirpath) as it: | |
for entry in it: | |
if entry.is_file(follow_symlinks=False): | |
total_size += entry.stat().st_size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
"log" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import psutil | |
tstamp = int(time.time()) | |
d = { | |
"cpu_percent": psutil.cpu_percent(interval=1), | |
"disk_root_percent": psutil.disk_usage('/').percent, | |
"vmem_percent": psutil.virtual_memory().percent, | |
"swap_percent": psutil.swap_memory().percent, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import zmq | |
import psutil | |
context = zmq.Context() | |
socket = context.socket(zmq.PUB) | |
socket.bind("tcp://*:5556") | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import zmq | |
import psutil | |
context = zmq.Context() | |
socket = context.socket(zmq.PUB) | |
socket.bind("tcp://*:5556") | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <modbus.h> | |
const int START_REG = 36; | |
int main(int argc, char *argv[]) |
NewerOlder