Skip to content

Instantly share code, notes, and snippets.

@andrewpmiller
andrewpmiller / getExternalIP
Last active August 29, 2015 14:00
Command line instruction to return your external IP address (from dyndns.org)
curl -sf http://checkip.dyndns.org/|cut -d ':' -f 2|cut -d '<' -f1|sed -e 's/ //g'
@andrewpmiller
andrewpmiller / speedtest-logger.sh
Created August 3, 2014 22:20
Log speedtest results to a log file (on my Pi)
#!/bin/bash
# Appends simple results to log file
# Remember to chmod +x this script to make it executable
speedtest-cli --simple >>/home/pi/speedtest-log.txt
@andrewpmiller
andrewpmiller / Pi-temp
Created August 10, 2014 13:30
CLI command to show board temperature in Fahrenheit
cat /sys/class/thermal/thermal_zone0/temp | awk '{ $1 = (((9/5)*$1)+32)/1000 } 1'
@andrewpmiller
andrewpmiller / references.md
Last active August 29, 2015 14:07
"Photoshop is Dead!" -- References
@andrewpmiller
andrewpmiller / GmailComposer.scpt
Last active August 29, 2015 14:09
A simple AppleScript that opens a Chrome window to compose a gmail message
on run
tell application "Google Chrome"
make new window
set URL of active tab of window 1 to "https://mail.google.com/mail/?ui=2&view=cm&fs=1&tf=1&shva=1"
activate
end tell
end run
@andrewpmiller
andrewpmiller / Pi-VNC.md
Last active August 29, 2015 14:12
Set up VNC on a Raspberry Pi
  • Install TightVNC Server

    sudo apt-get install tightvncserver

  • Run TightVNC Server

    tightvncserver

    Note: By default this will set up a VNC session on display 1 (i.e. port 5901)

    • Set password
@andrewpmiller
andrewpmiller / cdf.md
Created January 6, 2015 14:09
A clever alias for OSX that lets you cd to the the frontmost finder window. I found this while perusing Cameron Hayne's awesome bash aliases. http://hayne.net/MacDev/Bash/aliases.bash
# cdf: cd to frontmost window of Finder
cdf () 
{
    currFolderPath=$( /usr/bin/osascript <<"    EOT"
        tell application "Finder"
            try
                set currFolder to (folder of the front window as alias)
 on error
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@andrewpmiller
andrewpmiller / rfb.service.xml
Created February 20, 2015 03:12
Avahi Netatalk setup for Pi (create as root /etc/avahi/services/rfb.service)
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_rfb._tcp</type>
<port>5900</port>
</service>
</service-group>