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
""" | |
Download this gist as with wget: | |
!wget -O meter_classification_model.py https://gist.githubusercontent.com/MagedSaeed/fdb22182d4ccbaff73c989ece01e0661/raw/meter_classification_model.py | |
""" | |
import torch | |
import torch.nn.functional as F | |
from huggingface_hub import PyTorchModelHubMixin | |
class MeterClassificationModel(torch.nn.Module,PyTorchModelHubMixin): | |
def __init__( |
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 | |
# This script monitors CPU and memory usage | |
# Get the current usage of CPU and memory | |
cpuUsage=$(top -bn1 | awk '/Cpu/ { print $2}') | |
memUsage=$(free -m | awk '/Mem/{print $3}') | |
# Print the usage | |
echo "CPU Usage: $cpuUsage%" |
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
--- | |
- hosts: all | |
become: true | |
tasks: | |
- name: ensure ufw installed | |
apt: name=ufw update_cache=true | |
- name: ufw deny incoming | |
ufw: | |
direction: incoming |