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 | |
| INSTALL_DATE=$(stat -c %w /) | |
| NOW_DATE=$(date "+%Y-%m-%d %H:%M:%S") | |
| echo "System installed at $INSTALL_DATE" | |
| # Format 1: days, hours, minutes, seconds | |
| DAYS_DIFF=$(datediff -f "%d days, %H hours, %M minutes, %S seconds" "$INSTALL_DATE" "$NOW_DATE") | |
| echo "Days since installation: $DAYS_DIFF" |
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 | |
| echo "System installed at $(stat -c %w /)" | |
| INSTALL_DATE=$(stat -c %w /) | |
| NOW_TIMESTAMP=$(date +%s) | |
| INSTALL_TIMESTAMP=$(date -d "$INSTALL_DATE" +%s) | |
| TIME_DIFF_SECONDS=$((NOW_TIMESTAMP - INSTALL_TIMESTAMP)) |
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 | |
| # get list of sinks/cards (for settings CARD1/CARD2) | |
| # For each of your audio interfaces, run: | |
| # pactl get-default-sink | |
| CARD1="alsa_output.pci-0000_0a_00.1.hdmi-stereo-extra1" # Speakers | |
| CARD2="alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.HiFi__Line1__sink" # Headphones | |
| CURRENT_SINK=$(pactl get-default-sink) |
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 sys | |
| import yaml | |
| from influxdb_client import InfluxDBClient, Point | |
| import logging | |
| from logging.handlers import RotatingFileHandler | |
| from datetime import datetime | |
| # imports for surepy | |
| import asyncio | |
| from typing import List |
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
| using Microsoft.Xna.Framework; | |
| using Terraria; | |
| using Terraria.ID; | |
| using Terraria.ModLoader; | |
| namespace DrewsSword.Items | |
| { | |
| public class DrewSword : ModItem | |
| { |
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
| // Set analogPin to the input pin | |
| int inputAnalogPin = 0; | |
| void setup() { | |
| // put your setup code here, to run once: | |
| pinMode(inputAnalogPin, INPUT); | |
| Serial.begin(9600); | |
| } | |
| void loop() { |
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 ecobee | |
| from influxdb import InfluxDBClient | |
| def logPoint(sensorName=None, sensorValue=None, sensorType=None): | |
| return { | |
| "measurement": sensorType, | |
| "tags": { | |
| "sensor": sensorName | |
| }, | |
| "fields": { |
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 forecastio | |
| from influxdb import InfluxDBClient | |
| client = InfluxDBClient(host='YOUR_IP', | |
| port=8086, | |
| database='YOURDB', | |
| username='username', | |
| password='password', | |
| verify_ssl=False) |
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 | |
| # | |
| # Script to reduce bandwidth rate and create network delay and packet loss on linux interfaces | |
| # Can be placed on one interface (one server) or both interfaces (both servers). | |
| # | |
| # Simply run ./tc-con start to start it | |
| # and ./tc-con stop to stop it. | |
| # Run ./tc-con status to see if it's running. | |
| # | |
| # tc uses the following units when passed as a parameter. |
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 -eu | |
| # | |
| # Color log4j-style logs for easier visual parsing. | |
| # | |
| # Usage: | |
| # tail foo.log | log-color | |
| # run-service | log-color | |
| export TERM=xterm-256color |