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 python | |
| import time, sys, logging | |
| from daemon2x import Daemon | |
| from lib_oled96 import ssd1306 | |
| from PIL import ImageFont, ImageDraw, Image | |
| from smbus import SMBus | |
| # Logging | |
| logging.basicConfig(filename='/home/pi/oled/lib_oled96/clock.log', |
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 python | |
| import time, sys, logging | |
| from daemon2x import Daemon | |
| from lib_oled96 import ssd1306 | |
| from PIL import ImageFont, ImageDraw, Image | |
| from smbus import SMBus | |
| # Logging | |
| logging.basicConfig(filename='/home/oled/lib_oled96/clock.log', |
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 python | |
| from lib_oled96 import ssd1306 | |
| import time, datetime | |
| from PIL import ImageFont, ImageDraw | |
| from smbus import SMBus | |
| i2cbus = SMBus(1) # 1 = Raspberry Pi, early REV1 boards use 0 | |
| oled = ssd1306(i2cbus) # create oled object, nominating the correct I2C bus, default address |
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 python | |
| # visit https://www.childs.be/blog/post/how-to-run-a-python-script-as-a-service-in-background-as-a-daemon for instructions | |
| # uses https://raw.githubusercontent.com/metachris/python-posix-daemon/master/src/daemon2x.py | |
| import time, sys, logging | |
| from daemon2x import Daemon | |
| # Logging | |
| logging.basicConfig( filename='/var/log/daemon-example.log', | |
| filemode='a', |
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
| Sub OSgridPcode() | |
| 'Converts postcode into OS x,y | |
| 'www.childs.be | |
| ' | |
| Dim sURL As String, sHTML As String | |
| Dim oHttp As Object | |
| miles = 6.21371192237334E-04 | |
| cellr = ActiveCell.Row | |
| cellc = ActiveCell.Column | |
| Do While Cells(cellr, cellc - 1) <> "" |
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, os, logging, datetime, re | |
| interface = 'eth0' | |
| cmd = 'cat /proc/net/dev' | |
| line = os.popen(cmd).readlines()[3].strip() | |
| line2 = os.popen(cmd).readlines() | |
| for x in range(2,len(line2)): | |
| line3 = re.sub('\s+', ' ', os.popen(cmd).readlines()[x].strip()) | |
| line4 = line3.split(':')[0] |
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=$(readlink -f $0) | |
| SCRIPTPATH=`dirname $SCRIPT` | |
| cd "$SCRIPTPATH" | |
| python3 network.py | |
| echo " |
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=$(readlink -f $0) | |
| SCRIPTPATH=`dirname $SCRIPT` | |
| cd "$SCRIPTPATH" | |
| python3 temp.py | |
| echo " | |
| set terminal png size 900, 300 |
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 python | |
| import sys, os, logging, urllib, datetime | |
| def fetchtemp(): | |
| cmd = '/opt/vc/bin/vcgencmd measure_temp' | |
| line = os.popen(cmd).readline().strip() | |
| output = line.split('=')[1].split("'")[0]#+' C' | |
| return output |
NewerOlder