This file contains 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 | |
# | |
# More of a reference of using jinaj2 without actual template files. | |
# This is great for a simple output transformation to standard out. | |
# | |
# Of course you will need to "sudo pip install jinja2" first! | |
# | |
# I like to refer to the following to remember how to use jinja2 :) | |
# http://jinja.pocoo.org/docs/templates/ | |
# |
This file contains 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
from gpiozero import Motor, OutputDevice | |
from time import sleep | |
motor1 = Motor(24, 27) | |
motor1_enable = OutputDevice(5, initial_value=1) | |
motor2 = Motor(6, 22) | |
motor2_enable = OutputDevice(17, initial_value=1) | |
motor3 = Motor(23, 16) | |
motor3_enable = OutputDevice(12, initial_value=1) | |
motor4 = Motor(13, 18) |
This file contains 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
# https://itsec.media/post/python-send-outlook-email/ | |
import win32com.client | |
from win32com.client import Dispatch, constants | |
const=win32com.client.constants | |
olMailItem = 0x0 | |
obj = win32com.client.Dispatch("Outlook.Application") | |
newMail = obj.CreateItem(olMailItem) | |
newMail.Subject = "I AM SUBJECT!!" |
This file contains 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
# Decrypt password-protected PDF in Python. | |
# cleaned-up version of http://stackoverflow.com/a/26537710/329263 | |
# | |
# Requirements: | |
# pip install PyPDF2 | |
# | |
# Usage: decrypt_pdf('encrypted.pdf', 'decrypted.pdf', 'secret_password') | |
from PyPDF2 import PdfFileReader, PdfFileWriter |
Raspberry Pi InfluxDB: The solution for IoT Data storage
Raspberry Pi is costeffect linux computer very commonly used for IoT home automation projects.
Here are the 3 problems with conventional databases for IoT data store applications:
- Too much or complex configuration
- Unable to expire data / set retentional policies
- Not tailor made of Time Series Data
This file contains 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
''' | |
620031587 | |
Net-Centric Computing Assignment | |
Part A - RSA Encryption | |
''' | |
import random | |
''' |