Skip to content

Instantly share code, notes, and snippets.

@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 / Pi-Bonjour.md
Last active November 5, 2015 19:48
Make your Pi discoverable on a local (Mac) network
  • Install Avahi Netatalk

    sudo apt-get install netatalk

  • Make VNC service available via Bonjour

    • Create a file /etc/avahi/services/rfb.service (as root) with this content:
     		<?xml version="1.0" standalone='no'?>
    
@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>
@andrewpmiller
andrewpmiller / remove_wolfram.md
Created February 21, 2015 15:39
Remove Wolfram from Raspberry Pi

sudo apt-get purge wolfram-engine

#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# Temperature is reported in degrees Fahrenheit (F) - converting from C requires bc
# CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
@andrewpmiller
andrewpmiller / getload.sh
Last active September 25, 2015 14:32
This miniscule script is a hack to return the current CPU load.
#!/bin/bash
# getload
#
# This miniscule script is a hack to return the current
# CPU load. It is simply stripping off the first
# value returned from loadavg.
cat /proc/loadavg | head -n1 | cut -d " " -f1
exit 0
@andrewpmiller
andrewpmiller / uno-ascii.ino
Last active November 22, 2015 14:31
Arduino Uno ascii map
/*
+-----+
+----[PWR]-------------------| USB |--+
| +-----+ |
| GND/RST2 [ ][ ] |
| MOSI2/SCK2 [ ][ ] A5/SCL[ ] | C5
| 5V/MISO2 [ ][ ] A4/SDA[ ] | C4
| AREF[ ] |
| GND[ ] |
| [ ]N/C SCK/13[ ] | B5
@andrewpmiller
andrewpmiller / remove_libreoffice.md
Created November 29, 2015 18:02
Remove libreoffice from a Raspberry Pi
sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove