This file contains hidden or 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
# first install https://github.com/xavdid/heroku-config | |
heroku plugins:install heroku-config | |
# then add the following to your ~/.bashrc or ~/.zshrc | |
alias hc="heroku config:pull && mv .env env.sh && chmod +x env.sh && . ./env.sh" | |
# next you can just run hc to copy over your config | |
hc |
This file contains hidden or 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
#!/bin/bash | |
# Quick and dirty script to get IP and dl speed | |
# of a Pi on boot | |
# sleep to wait for wifi | |
sleep 20 | |
# get the local IP | |
localip=$(/sbin/ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1') |
This file contains hidden or 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
Host pi | |
Hostname /gsiot-t764-3eyt | |
Port 22 | |
User pi | |
ProxyCommand /usr/local/Cellar/corkscrew/2.0/bin/corkscrew try.yaler.io 80 %h %p |
This file contains hidden or 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
#!/bin/bash | |
# pings 8.8.8.8 and local router, saves into log if offline with timestamp | |
HOSTS="8.8.8.8 192.168.1.1" | |
COUNT=4 | |
for myHost in $HOSTS | |
do |
This file contains hidden or 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
#!/bin/bash | |
# saves date and average of 4 pings to 8.8.8.8 into log file | |
count=$(ping -c 4 8.8.8.8 | tail -1 | awk '{print $4}' | cut -d '/' -f 2) | |
echo "$(date) $count" > pingresponselog.txt |
This file contains hidden or 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
import time, sys, os | |
global pwm | |
from Adafruit_PWM_Servo_Driver import PWM | |
# Set LED parameters | |
pwm = PWM(0x40) | |
pwm.setPWMFreq(1000) | |
print("LEDs are initialised") |
This file contains hidden or 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
#!/bin/bash | |
dig +short myip.opendns.com @resolver1.opendns.com | |
ifconfig en0 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1' |
This file contains hidden or 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
#!/bin/bash | |
# This small program cleans up the formatting of your mac clipboard | |
# (removes any links, coloring, font style, spacing, etc). Drag it | |
# into your dock and click on it whenever you want to clear some | |
# text's formatting. It will then close all by itself. Requires | |
# giving accessibility rights to terminal. | |
# Suggested as alias here https://news.ycombinator.com/item?id=10143852 | |
pbpaste | pbcopy |