Skip to content

Instantly share code, notes, and snippets.

View YourFriendCaspian's full-sized avatar
🙃
I'm sure I'll be slow to respond so don't be mad.

yourfriendcaspian YourFriendCaspian

🙃
I'm sure I'll be slow to respond so don't be mad.
View GitHub Profile
@YourFriendCaspian
YourFriendCaspian / TopFloorClient_RC_433MHz.ino
Created September 6, 2018 19:52 — forked from LarsBergqvist/TopFloorClient_RC_433MHz.ino
An Arduino sketch for an IoT node that broadcasts sensor values via 433 MHz radio signals
//
// An Arduino sketch for an IoT node that broadcasts sensor values via
// 433 MHz radio signals
// The RCSwitch library is used for the transmissions
// The Narcopleptic library is used for power save during delay
// Sensor values are fetched from an BPM180/085 sensor via i2C
//
#include <Wire.h>
#include <Adafruit_BMP085.h>
@YourFriendCaspian
YourFriendCaspian / systemmonitor.py
Created September 6, 2018 19:45 — forked from LarsBergqvist/systemmonitor.py
Make MQTT messages from system monitoring values on a Raspberry Pi
#!/usr/bin/env python3
import paho.mqtt.publish as publish
from subprocess import check_output
from re import findall
import psutil
import sys
def get_temp():
temp = check_output(["vcgencmd","measure_temp"]).decode("UTF-8")
return(findall("\d+\.\d+",temp)[0])
@YourFriendCaspian
YourFriendCaspian / gmusic.py
Created August 27, 2018 21:26
Google Music Python Script for Home Assistant
"""
"""
import asyncio
import logging
import time
import random
import pickle
import os.path
from datetime import timedelta
@YourFriendCaspian
YourFriendCaspian / lp-ssh-add.sh
Created July 7, 2018 15:07 — forked from davidblewett/lp-ssh-add.sh
Allow storage of SSH private keys in LastPass, and use lpass CLI to retrieve and load into ssh-agent. The general idea is to store the private key armored ASCII in an "SSH Key" Secure Note, in a specific folder (i.e.: "Secure Notes\SSH" ).
#!/bin/sh
#
# Import all SSH keys from LP
#
PREFIX=~
SSH_ASKPASS=$PREFIX/bin/lp-askpass.sh
export SSH_ASKPASS
# This is needed to force ssh-add to honor our SSH_ASKPASS.
DISPLAY=foo
export DISPLAY
@YourFriendCaspian
YourFriendCaspian / nextcloud_backup.sh
Created July 2, 2018 05:58
Backup script for Nextcloud on the Odroid-C2
#!/bin/bash
# Credit and special thanks to Carsten Rieger from https://www.c-rieger.de/
# for creating this script.
sudo -u www-data php /var/www/nextcloud/occ maintenance:mode --on
BACKUP_STORE=/backup_work_dir
ARCHIVE_STORE=/home/ubuntuusername/backup_dir
CURRENT_TIME_FORMAT="%w"
echo "START: $(date)"
FOLDERS_TO_BACKUP=(
"/root/"
@YourFriendCaspian
YourFriendCaspian / stt_py3.py
Created July 2, 2018 04:52 — forked from srli/stt_py3.py
Speech to text with PocketSphinx for Python3
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
import os
import pyaudio
import wave
import audioop
from collections import deque
import time
import math
@YourFriendCaspian
YourFriendCaspian / sshKeyGen.sh
Created June 30, 2018 21:22 — forked from wilcollins/sshKeyGen.sh
SSH KeyGen+Copy Bash Script (quick ssh key setup)
#!/bin/bash
#
# Creates an SSH key on a client machine, applies the appropriate file permissions,
# copies to the local ~/.ssh directory, & copies to specified server
#
# parameters:
# ..1 newKeyFileName
# ..2 user@server
#
# usage :
@YourFriendCaspian
YourFriendCaspian / rpi-hdmi.sh
Created May 26, 2018 20:01 — forked from AGWA/rpi-hdmi.sh
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
#!/bin/sh
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
{
tvservice -s | grep "TV is off" >/dev/null
}
case $1 in
/**The MIT License (MIT)
Copyright (c) 2016 by Daniel Eichhorn
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@YourFriendCaspian
YourFriendCaspian / YakYak.desktop
Created February 12, 2018 04:43 — forked from juliancoleman/YakYak.desktop
A concise install instruction for YakYak on Ubuntu GNOME 16.04
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=YakYak
Comment=Desktop client for Google Hangouts
GenericName=Hangouts Client
Exec=/opt/yakyak-linux-x64/yakyak
Icon=/opt/yakyak-linux-x64/resources/app/icons/[email protected]
Terminal=false