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 / checkroot.sh
Created September 7, 2012 22:49
Bash script to first check that you are root ...
#!/bin/bash
if [ "$(id -u)" != 0 ]; then
echo "Please run this as root."
exit 1
fi
echo "Success! You are root!"
@sc137
sc137 / keybase.md
Last active February 16, 2017 23:10

Keybase proofI hereby claim: * I am sc137 on github. * I am sable (https://keybase.io/sable) on keybase. * I have a public key whose fingerprint is EAEA 37ED 9888 AB9F 5911 056F 0810 A090 72C8 358ATo claim this, I am signing this object:```json{ "body": { "key": { "eldest_kid": "01010f7bc866baba9633675e0cc1b683690c6fa5821a4a9c821ef70201cdc3461d1b0a", "fingerprint": "eaea37ed9888ab9f5911056f0810a09072c8358a", "host": "keybase.io", "key_id": "0810a09072c8358a", "kid": "01010f7bc866baba9633675e0cc1b683690c6fa5821a4a9c821ef70201cdc3461d1b0a", "uid": "cfd90af8403941bfc0b06e249c2f8419", "username": "sable" }, "service": { "name": "github", "username": "sc137" }, "type": "web_service_binding", "version": 1 }, "ctime": 1487286574, "expire_in": 157680000, "prev": "30ce677ed00012abb5b8a51bf4c513e64ccb1640c278411a73a61b67b8e55639", "seqno": 4, "tag": "s

@sc137
sc137 / gpg_encrypt.md
Created February 16, 2017 23:59
Use gpg to encrypt your docs with a symmetric key (password) before putting them on dropbox

First compress your folder or files

	tar czvf folder.tar.gz folder/

encrypt personal files symmetrically

	gpg --output test.gpg --symmetric test.txt

decrypt

gpg --output test_d.txt test.gpg

# Use the terminal to create your message
say -v Samantha -o mail.m4a "you've got mail"
# or...
say -v Samantha -o incoming.m4a "incoming message"
# convert the m4a file to wav for use in Thunderbird
afconvert -d UI8 -f 'WAVE' mail.m4a
afconvert -d UI8 -f 'WAVE' incoming.m4a
<!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>
@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
@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 / 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.

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 / 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"