Skip to content

Instantly share code, notes, and snippets.

View sc137's full-sized avatar
💭
clickety clack ⌨️

Sable C. sc137

💭
clickety clack ⌨️
View GitHub Profile
@sc137
sc137 / python-tooter.py
Last active July 9, 2019 20:18
Python script to toot on your mastodon instance from the cli
#!/usr/bin/env python3
# pip3 install Mastodon.py
#
# use in the python cli
# ./tooter.py "your message here"
# or just ./tooter.py to be prompted
# sable cantus
import sys
import os
@sc137
sc137 / file_integrity_check.py
Created May 15, 2019 23:22
check stored sha256 value
#!/usr/bin/env python3
# file_integrity_check.py
# check file integrity from a list
# use shasum -a 256 <filename> to generate initial checksum
import hashlib
from filechecksums import * # gets precomputed variables
import os.path
def filesha256(filename, check, block_size=2**20):
@sc137
sc137 / camera_button.py
Created September 11, 2018 22:50
Push button camera for the AIY Vision kit
#!/usr/bin/env python3
#
# camera-button.py
#
# run this in the terminal
# push the button to take pics
# for the aiy vision kit
from gpiozero import Button
from picamera import PiCamera
@sc137
sc137 / SafeEmailTips.md
Created April 24, 2018 23:25
This is a document that I researched and posted for a college. Please share with your users.

Safe Email Tips

Our email inbox is a "lifeline" of sorts to the world. Email is what we use to communicate with our peers and students. It's how we send proposals and request. And how we receive assignments.

Avoiding email is not a realistic proposition as email is often our primary focus when computing. Email is a primary attack vector to our personal data and computer systems. Email based computer attacks can be especially devastating whether the attacker is a malicious person or program (virus, worm, etc.).

We would like to offer a few tips on how to email safely.

Never Share Your Password

@sc137
sc137 / makeTINY.sh
Created March 8, 2018 20:08
Get a tiny url from their api
#!/bin/sh
read -p "Enter the url to shorten: " URL
if [ ! -z $URL ]; then
shorty=`curl http://tinyurl.com/api-create.php?url=$URL`
echo $shorty
echo $shorty | pbcopy
echo "tinyurl copied to pasteboard"

Keybase proof

I hereby claim:

  • I am sc137 on github.
  • I am sable (https://keybase.io/sable) on keybase.
  • I have a public key whose fingerprint is A18C 5546 1B0D B6E7 A9D3 ACCE D57E 63B5 9D2C 36E1

To claim this, I am signing this object:

@sc137
sc137 / send_o365.py
Created February 8, 2018 00:28
send email to one or many people now or in the future
#!/usr/local/bin/python3
#
# send_o365.py
# /sable cantus/
# http://cantus.us/
###################
"""
Use in a delay_until script to send a timed message.
@sc137
sc137 / check_o365.py
Created February 8, 2018 00:27
check your inbox, print subject lines, know when you need to switch over
#!/usr/local/bin/python3
#
# check_o365.py
# /sable cantus/
# http://cantus.us/
###################
"""
https://github.com/Narcolapser/python-o365
$ pip3 install O365
@sc137
sc137 / email_o365.py
Created February 8, 2018 00:24
send a plain text email from the terminal
#!/usr/local/bin/python3
#
# email_o365.py
# /sable cantus/
# http://cantus.us/
###################
"""
https://github.com/Narcolapser/python-o365
$ pip3 install O365
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Audio on the Web!</title>
</head>
<body>
<h1>How do you play audio on a website?</h1>