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
| ip -6 addr | grep inet6 | grep global | grep -v "temp" | grep -v "mngtmpaddr" | grep -v "fd" | awk -F '[ \t]+|/' '{print $3}' | |
| #set my addr example: | |
| #ip -6 addr add 2001:19f0::00e3 dev eth0 |
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 minimalmodbus | |
| import time | |
| import serial | |
| import datetime | |
| import redis | |
| import pickle | |
| rconn = redis.Redis('localhost') | |
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 subprocess | |
| import json | |
| cmd = "sensors -j" | |
| x=subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) | |
| temps=json.loads(x) | |
| temp0=(temps['coretemp-isa-0000']['Package id 0']['temp1_input']) | |
| print(temp0) |
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 | |
| #apt-get install linux-cpupower | |
| cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor | |
| echo "Setting to Powersave" | |
| cpupower frequency-set --governor powersave | |
| cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor |
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/sh | |
| ### BEGIN INIT INFO | |
| # Provides: frps | |
| # Required-Start: $local_fs $network | |
| # Required-Stop: $local_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: frps service deamon | |
| # Description: frps service daemon |
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 minimalmodbus | |
| import time | |
| import serial | |
| import datetime | |
| instrument = minimalmodbus.Instrument('/dev/ttyUSB0', 1, debug=False) # port name, slave address (in decimal) | |
| instrument.serial.port = '/dev/ttyUSB0' # this is the serial port name | |
| instrument.serial.baudrate = 9600 # Baud | |
| instrument.serial.bytesize = 8 | |
| instrument.serial.parity = serial.PARITY_NONE |
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
| #include <Arduino.h> | |
| #include <ESP8266WiFi.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <WiFiClient.h> | |
| #include <WiFiClientSecureBearSSL.h> | |
| #include "DHT.h" | |
| DHT dht2(2, DHT11); | |
| const char* ssid = "ssid"; | |
| const char* password = "xxxx"; |
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
| #include <ESP8266WiFi.h> | |
| #include <ESP8266HTTPClient.h> | |
| #include <WiFiClient.h> | |
| #include "DHT.h" | |
| DHT dht2(2,DHT11); | |
| const char* ssid = "ssid"; | |
| const char* password = "xxxxxx"; | |
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
| /* | |
| arduino_esp8266_wifi-client_web-server_pin_ctl.c | |
| compiled on arduino 2.0.4 and using ESP-01 8pin module and a relay. | |
| WiFi Client, HTTP Web Server, to control 2 pins and relays. | |
| */ | |
| #include <ESP8266WiFi.h> |
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 urllib.request | |
| import base64 | |
| import json | |
| import ssl | |
| url="https://jmssub.net/" #change to your url | |
| content = urllib.request.urlopen(url).read().strip() | |
| servers_sub = base64.b64decode(content).decode() | |
| output = [] |