Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# download with this command:
# curl -O https://gist.githubusercontent.com/f00-/68255fe352f1e310f232259e06a4c0da/raw/7ddd7a9d85ebb20c6b1e31cca993c791f21ec6f4/script4john.sh
# once you have it downloaded
# usage: ./script4john.sh folderYouAreChecking fileYouWantTokeep
# be careful, make sure you specify the right folder and file
# you could potentially rm -rf * somewhere important
:: moves cache.db to C:\tmp\
:: deletes every file in C:\NCompass\NCompass Player\cache (to stop crash)
:: moves cache.db back to C:\NCompass\NCompass Player\cache\cache.db
mkdir "C:\tmp"
move "C:\NCompass\NCompass Player\cache\cache.db" "C:\tmp\"
del "C:\NCompass\NCompass Player\cache\*.*?"
move "C:\tmp\cache.db" "C:\NCompass Player\cache\cache.db"
#https://github.com/trainman419/python-cec
#pip install cec
import cec
import time
cec.init()
tv = cec.Device(0)
while True:
tv.power_on()
#!/bin/sh
ACCT_ID="6ptphr42"
LOG_FILE="/var/log/install-dp.log"
#Wait maximum 30 seconds on network connectivity before giving up
limit=30
retry=0
#Don't bother to run when lo is configured
#https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=53481
#https://github.com/Pulse-Eight/libcec
echo on 0 | cec-client -s -d 1
echo on 0 | "C:\Program Files (x86)\Pulse-Eight\USB-CEC Adapter\x64\cec-client.exe" -s -d 1
import smtplib
login = {"username": "pibot@mg.n-compass.tv", "password":""}
mailgun = {"server": "smtp.mailgun.org", "port": 587}
def send_message_via_smtp(sender, reciever, msg):
smtp = smtplib.SMTP(mailgun["server"], mailgun["port"])
smtp.login(login["username"], login["password"])
smtp.sendmail(sender, reciever, msg)
@DustinAlandzes
DustinAlandzes / sendstatus.sh
Last active January 25, 2017 21:59
uses sendemail.py to send status email about raspberry pi displays
#!/bin/bash
PROMPT="pi@raspberrypi$ "
echo -n $PROMPT > input.txt
echo "ps aux | grep mono" >> input.txt
ps aux | grep mono >> input.txt
echo -n $PROMPT >> input.txt
echo "ps aux | grep mplayer" >> input.txt
ps aux | grep mplayer >> input.txt
#!/usr/bin/env python3
import smtplib
login = {"username":"", "password":""}
mailgun = {"server": "smtp.mailgun.org", "port": 587}
def send_message_via_smtp(sender, reciever, msg):
smtp = smtplib.SMTP(mailgun["server"], mailgun["port"])
smtp.login(login["username"], login["password"])
@DustinAlandzes
DustinAlandzes / update.sh
Created February 1, 2017 09:10
simple script to update folder with player software
# maybe move to dated folder
mv NCompass NCompass.old
# maybe a tarball instead, idk how it comes
curl -Os http://url.to/NCompass.zip
unzip NCompass.zip
# start updated player