This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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%" |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
| set -e | |
| sudo apt update | |
| sudo apt install -y openjdk-17-jdk | |
| java --version | |
| sudo apt install -y software-properties-common | |
| sudo add-apt-repository ppa:maarten-fonville/android-studio | |
| sudo apt update | |
| sudo apt install -y android-studio |
This file contains hidden or 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
| #!/usr/bin/env sh | |
| set -e | |
| sudo apt update | |
| sudo apt install -y openjdk-17-jdk wget unzip | |
| java --version | |
| # OPTION: Download and extract Android command-line tools | |
| SDK_URL="https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip" | |
| SDK_DIR="/opt/android-sdk" |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Ruby WASM Calculator</title> | |
| <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet"> | |
| </head> | |
| <body> | |
| <div id="app" class="flex items-center justify-center min-h-screen bg-gray-100"> |
OlderNewer