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 | |
# Steps: | |
# - Run query in Kibana | |
# - Export results to CSV file: Share -> CSV Reports -> Generate CSV | |
# (you may be required to "Save search" first. Use a temporary name and keep overwriting it to reduce entries) | |
# - Download generated CSV once generated (it takes a short while) | |
# - Run script on local file as shown below | |
# - Profit | |
# |
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
# Reading PZEM-004t power sensor (new version v3.0) through Modbus-RTU protocol over TTL UART | |
# Run as: | |
# python3 pzem_004t.py | |
# To install dependencies: | |
# pip install modbus-tk | |
# pip install pyserial | |
import serial | |
import modbus_tk.defines as cst |
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
#! /usr/bin/env python3 | |
# Print Docker containers log size | |
# Needs to 'pip install docker' first | |
# | |
# $ sudo ./docker_logs_size.py | |
# 658675d834 reverse-proxy_1: 10.31 KB | |
# 85f65ece1d webroot_1: 13.1 KB | |
# 34c6cc54ab redis_1: 18.81 KB | |
# 05a3c8b895 mysql_8.0_1: 48.69 KB |
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 | |
# From: https://forums.linuxmint.com/viewtopic.php?f=90&t=217741 | |
# Credits to user BlackVeils | |
# Steps: | |
# 1. Save this script to battery_notify.sh | |
# 2. Edit the 'alarm' variable to point to your sound file of choice | |
# 3. Give execution permission: chmod +x battery_notify.sh | |
# 4. Run the script to test it. If happy, add to your startup applications. |
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
from smartsheet import * | |
import pandas as pd | |
from credentials import smartsheet_token | |
smartsheet = smartsheet.Smartsheet(smartsheet_token) | |
def get_sheet_as_df(sheet_id): | |
ss1 = smartsheet.Sheets.get_sheet(sheet_id, page_size=0) | |
row_count = ss1.total_row_count | |
ss1 = smartsheet.Sheets.get_sheet(sheet_id, page_size=row_count) |