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 | |
# Check if Homebrew is installed | |
if ! command -v brew &>/dev/null; then | |
echo "Homebrew is not installed. Please install Homebrew first." | |
exit 1 | |
fi | |
# Check if PHP 7.1 and PHP 8 are installed via Homebrew | |
if ! brew ls --versions php@7.1 &>/dev/null; then |
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
const delay = (millis) => | |
new Promise((resolve, reject) => { | |
setTimeout((_) => resolve(), millis); | |
}); | |
async function postData(url = '', data = {}) { | |
// Default options are marked with * | |
const response = await fetch(url, { | |
method: 'POST', // *GET, POST, PUT, DELETE, etc. | |
mode: 'cors', // no-cors, *cors, same-origin |
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
version: '3' | |
services: | |
cal-kung-hub-api: | |
image: registry.gitlab.com/mynameismaxz/cal-kung-hub-api:master | |
container_name: cal-kung-hub-api | |
labels: | |
- "traefik.http.routers.api_cal-kung-hub.rule=Host(`api.cal-kung-hub.mymacz.com`)" | |
- "traefik.http.routers.api_cal-kung-hub.entrypoints=websecure" | |
- "traefik.http.routers.api_cal-kung-hub.tls=true" | |
- "traefik.http.routers.api_cal-kung-hub.tls.certresolver=letsencrypt" |
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 requests | |
r = requests.post('[URL]', json={"key": "value", "key2": "value2"}) | |
r.status_code |
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 cv2 | |
import io | |
import socket | |
import struct | |
import time | |
import pickle | |
import zlib | |
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
client_socket.connect(('192.168.1.124', 8485)) |
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
# --------------------------------------------- | |
# Stage 1: Initial State | |
# --------------------------------------------- | |
FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04 as essential_stage | |
# Install Essential Package | |
RUN apt-get update && apt-get -y install --no-install-recommends \ | |
build-essential \ | |
g++ \ | |
curl \ |
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
./configure # answer prompts or use defaults | |
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package | |
./bazel-bin/tensorflow/tools/pip_package/build_pip_package /mnt # create package | |
chown $HOST_PERMS /mnt/tensorflow-version-tags.whl |
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
$ docker pull tensorflow/tensorflow:1.12.0-devel-gpu-py3 | |
$ docker run --runtime=nvidia -it -w /tensorflow -v $PWD:/mnt -e HOST_PERMS="$(id -u):$(id -g)" \ | |
tensorflow/tensorflow:1.12.0-devel-gpu-py3 bash |
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
version: '2.3' | |
services: | |
node_exporter: | |
image: prom/node-exporter | |
command: --collector.textfile.directory=/run/prometheus | |
pid: "host" | |
volumes: | |
- prometheus_data:/prometheus | |
- prometheus_textfiles:/run/prometheus:ro |
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
global: | |
scrape_interval: 15s | |
scrape_configs: | |
- job_name: research-pc-monitor | |
scrape_interval: 5s | |
static_configs: | |
- targets: | |
- <IP:PORT TARGET> |
NewerOlder