#!/bin/bash
# Login MOTD for Raspberry Pi
print_line () {
for i in {0..50..1}Systemd has its own logging system called the journal, and the log files are stored in /var/log/journal.
sudo journalctl --disk-usage- Active journal files will be marked as archived, so that they are never written to in future.
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.9" | |
| services: | |
| jupyter: | |
| image: jupyter/minimal-notebook | |
| container_name: jupyter | |
| ports: | |
| - "81:8888" | |
| volumes: | |
| - /home/kk/jupyter/notebooks:/home/jovyan/ |
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 python3 | |
| # Service script for TorrentBox to periodically deletes files from a directory. | |
| # Use systemctl to init a service. | |
| import os | |
| from datetime import datetime | |
| import logging | |
| logging.basicConfig(filename='delete_service.log', | |
| format='%(asctime)s %(levelname)-8s %(message)s', | |
| datefmt='%d-%m-%Y %H:%M:%S', |
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 | |
| # For Updating Packages and Portainer | |
| # Tested on Ubuntu 20.04 | |
| LATEST="`wget -qO- https://hub.docker.com/v1/repositories/portainer/portainer-ce/tags`" | |
| LATEST=`echo $LATEST | sed "s/{//g" | sed "s/}//g" | sed "s/\"//g" | cut -d ' ' -f2` | |
| RUNNING=`docker inspect "portainer/portainer-ce" | grep Id | sed "s/\"//g" | sed "s/,//g" | tr -s ' ' | cut -d ' ' -f3` | |
| if [ "$RUNNING" != "$LATEST" ];then |
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 bash | |
| # Last Updated June 2, 2020 | |
| # Tested on Ubuntu Server 20.04 LTS | |
| # Variables for pretty printing | |
| RED=`tput bold``tput setaf 1` # Red Color | |
| GREEN=`tput bold``tput setaf 2` # Green Color | |
| NC=`tput sgr0` # No Color | |
| BEGIN=$(df /home --output=used | grep -Eo '[0-9]+') |
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 python3 | |
| """ | |
| Adds DNS A records pointing to a mentioned server using Cloudflare API v4. Edit places necessary. | |
| Note: | |
| For better codebase privacy/security, refer configuration file for | |
| authentication in python-cloudflare docs. This is for internal usage. | |
| """ | |
| import CloudFlare # pip3 install cloudflare | |
| import sys |
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
| clear | |
| echo "$(tput bold)$(tput setaf 2)" | |
| echo " .~~. .~~. " | |
| echo " '. \ ' ' / .' " | |
| echo "$(tput setaf 1)" | |
| echo " .~ .~~~..~. " | |
| echo " : .~.'~'.~. : " | |
| echo " ~ ( ) ( ) ~ " | |
| echo " ( : '~'.~.'~' : )" | |
| echo " ~ .~ ( ) ~. ~ " |
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
| import cv2 | |
| import numpy as np | |
| import torch | |
| def visualize_cam(mask, img): | |
| """Make heatmap from mask and synthesize GradCAM result image using heatmap and img. | |
| Args: | |
| mask (torch.tensor): mask shape of (1, 1, H, W) and each element has value in range [0, 1] | |
| img (torch.tensor): img shape of (1, 3, H, W) and each pixel value is in range [0, 1] | |
