Skip to content

Instantly share code, notes, and snippets.

View theskanthunt42's full-sized avatar
💽
WASTING TIME

the42game@code theskanthunt42

💽
WASTING TIME
View GitHub Profile
@theskanthunt42
theskanthunt42 / index.html
Last active April 13, 2024 06:50
Simple HTTP server running on MicroPython
<html>
<h1>MicroPython HTTP Server on Raspberry Pi Pico W</h1>
Your IP address is: %s:%d
<br>
</html>
@theskanthunt42
theskanthunt42 / monitor.py
Created November 15, 2022 10:43
Useless infomation monitor i wrote for mine Raspberry Pi 400, DON'T USE IT, i upload it just for a handy backup for my own use, and it just a waste of resources
import os
import time
import sys
def OSInfo():
carrier = dict()
carrier['up_since'] = os.popen("uptime -s").read().split("\n")[0]
carrier['uptime'] = os.popen("uptime -p").read().split("up ")[1].split("\n")[0]
carrier['hostname_v4'] = os.popen("hostname -I").read().split(" ")[0]
@theskanthunt42
theskanthunt42 / ups.py
Last active September 7, 2022 16:51
Raspberry Pi w/UPS module(https://github.com/linshuqin329/UPS-18650) general infomations monitor. $h!t code warning
#This piece of code will only run if:
#You have a Raspberry Pi 3 or later with a UPS board using 18650 batteries(https://github.com/linshuqin329/UPS-18650/)
#side notes: in which is my dev env
import os
import struct
import smbus
import sys
import time
off_plan = False
@theskanthunt42
theskanthunt42 / useless.py
Created March 19, 2022 21:32
A rather useless script to show some infomations on your i2c-connected 1602 LCD using https://github.com/sterlingbeason/LCD-1602-I2C
from LCD import LCD
import time
import os
lcd_object = LCD()
#lcd_object.message("Test", 1)
wait_time = 5
def clock_n_temp():
temp_reading = os.popen("vcgencmd measure_temp").read().split("=")[1].split("\\")[0]
arm_clock_freq_hz = int(os.popen("vcgencmd measure_clock arm").read().split("=")[1].split("\\")[0])
@theskanthunt42
theskanthunt42 / ddns.py
Last active March 26, 2022 17:19
A automatic DDNS script using cloudflare api and etc, Please review the script yourself before you use(If there is)
#Script for building up DDNS service using Cloudflare and https://ip.sb or http://icanhazip.com/
import requests
import time
import json
update_interval = 21600 #Update interval, default to 6hr, aka 21600s
api_token = "" #your cf global api key
email_address = "" #your email address
target_domain = "" #e.g gist.github.com
domain = target_domain.split(".")[1] + "." + target_domain.split(".")[2]
identifiyer = ""