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 | |
| # Router Control Script | |
| # Encodes credentials and performs API calls to control the router | |
| # | |
| # Usage: | |
| # ./router_control.sh | |
| # ROUTER_IP=192.168.1.1 USERNAME=admin PASSWORD=mypass ./router_control.sh | |
| # | |
| # Requirements: |
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 | |
| function continueOrExit { | |
| echo "Continue? (y/N)" | |
| read continue | |
| if [ "$continue" != "y" ] && [ "$continue" != "Y" ]; then | |
| echo "Exiting..." | |
| exit 1 | |
| fi |
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 | |
| function getGPUDevices { | |
| echo "===== getGPUDevices =====" | |
| # Get GPU devices and extract PCI IDs | |
| echo "Found GPUs:" | |
| GPU_DEVICES=$(lspci -nn | grep -i vga | grep -E '(AMD|NVIDIA)') | |
| echo "$GPU_DEVICES" |
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 | |
| # | |
| # Original espota.py by Ivan Grokhotkov: | |
| # https://gist.github.com/igrr/d35ab8446922179dc58c | |
| # | |
| # Modified since 2015-09-18 from Pascal Gollor (https://github.com/pgollor) | |
| # Modified since 2015-11-09 from Hristo Gochkov (https://github.com/me-no-dev) | |
| # Modified since 2016-01-03 from Matthew O'Gorman (https://githumb.com/mogorman) | |
| # | |
| # This script will push an OTA update to the ESP |
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
| def solution(message, K): | |
| if K < 3 or K > 500: | |
| raise Exception("K out of range") | |
| if len(message) == 0 or len(message) > 500: | |
| raise Exception("Message too big.") | |
| if len(message) <= K: | |
| return message |