Skip to content

Instantly share code, notes, and snippets.

View collabnix's full-sized avatar
🐳
Docker ! Docker ! Docker !

Collabnix collabnix

🐳
Docker ! Docker ! Docker !
View GitHub Profile
@collabnix
collabnix / gist:d9298ac93a91f369e17ae28eac03e524
Created January 19, 2023 11:58
How to Deploy a set of Microservices with a specified version using Docker?
#!/bin/bash
# Get the version of service1
version_service1=$1
# Get the version of service2
version_service2=$2
# Get any additional parameters
additional_param_1=$3
# Start service1 with the specified version
@collabnix
collabnix / fix-my-system.py
Created March 19, 2023 12:29
Docker Diagnostic Tool Integrated with ChatGPT
import subprocess
import re
import openai
openai.api_key = "sk-peVXXXXXXXg8PPY0QuCYKPT"
def run_diagnose_tool():
# Run the Docker Desktop self-diagnose tool and capture the output
tool_location = "/Applications/Docker.app/Contents/MacOS/com.docker.diagnose"
result = subprocess.run([tool_location, "check"], stdout=subprocess.PIPE)
output = result.stdout.decode()
@collabnix
collabnix / bme680.py
Created April 1, 2023 04:50
A Python script to fetch sensor values
import time
import smbus2
import bme680
# Set up BME680 sensor object
bus = smbus2.SMBus(1) # Use I2C bus 1
bme = bme680.BME680(bme680.I2C_ADDR_PRIMARY, bus)
# Set up oversampling settings for temperature, pressure, and humidity readings
bme.set_humidity_oversample(bme680.OS_2X)
@collabnix
collabnix / final.yaml
Created April 8, 2023 01:03
YAML file for Todo List Apps
kind: Deployment
metadata:
name: node-app
labels:
app: node-app
spec:
replicas: 1
selector:
matchLabels:
app: node-app
@collabnix
collabnix / service.yaml
Created April 8, 2023 01:04
Todo List app on Kubernetes
apiVersion: v1
kind: Service
metadata:
name: node-app-service
spec:
selector:
app: node-app
ports:
- name: http
protocol: TCP
@collabnix
collabnix / docker-compose.yml
Created April 13, 2023 05:54
Docker Compose File Watch
version: '3.6'
services:
app:
build: .
x-develop:
watch:
- action: rebuild
path: .
command: sh -c "yarn install && yarn run dev"
ports: