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
/* | |
* Inspired by: http://stackoverflow.com/questions/4360060/video-streaming-with-html-5-via-node-js | |
*/ | |
var http = require('http'), | |
fs = require('fs'), | |
util = require('util'); | |
http.createServer(function (req, res) { | |
var path = 'video.mp4'; |
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
name: Enable and disable events | |
description: Toggles event firing on and off. | |
host: EXCEL | |
api_set: {} | |
script: | |
content: > | |
$("#toggleEvents").click(() => tryCatch(toggleEvents)); | |
$("#setup").click(() => tryCatch(setup)); |
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: | |
app: | |
image: nextcloud | |
container_name: nextcloud | |
restart: unless-stopped | |
ports: | |
- "80:80" | |
volumes: |
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
# ########################################################## | |
# Dockerfile for Developer Tools. | |
# Description: This Dockerfile is for adding a devtools stage. | |
# | |
# Author information: | |
# Name: Rahul Dhole | |
# Email: rdhole95@gmail.com | |
# GitHub: https://github.com/rahuldhole | |
# | |
# Dockerfile description: |
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
# Use a Debian base image | |
FROM debian:latest | |
ARG USERNAME=debian | |
# Define environment variables | |
ENV SOURCE_CODE_VOLUME_MOUNT="/host-code" \ | |
WORKING_DIR="/app" | |
# Install rsync, make, nano, and procps | |
RUN apt-get update \ |
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 | |
# Change Settings | |
cpu_threshold=30 # max percentage | |
memory_threshold=95 # max percentage | |
processes="chrome,code" # Processes to monitor and kill (comma-separated) | |
# Article to read more: https://dev.to/rahuldhole/managing-resource-deadlocks-a-simple-bash-script-for-linux-1n64 | |
# Function to monitor CPU usage |
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 | |
# Capture CPU usage | |
cpu_usage=$(top -bn2 | grep '%Cpu' | tail -1 | grep -P '(....|...) id,' | awk '{print 100-$8}') | |
# Capture memory usage | |
memory_usage=$(free -m | grep 'Mem:' | awk '{ print $3/$2*100 }') | |
# Display CPU and memory usage in a popup message using xmessage | |
echo -e "System Usage \nCPU Usage: $cpu_usage% \nMemory Usage: $memory_usage%" |