Skip to content

Instantly share code, notes, and snippets.

@larsenglund
Last active January 14, 2016 12:22
Show Gist options
  • Save larsenglund/92aa8cb8a0b711d5c289 to your computer and use it in GitHub Desktop.
Save larsenglund/92aa8cb8a0b711d5c289 to your computer and use it in GitHub Desktop.
sudo apt-get update # Repair things that that seem to be a little sick.
sudo apt-get upgrade
sudo apt-get install -f locales
sudo locale-gen en_US en_US.UTF-8
sudo dpkg-reconfigure locales # Select "en_US" locales.
sudo apt-get install gcc make # Get the C compiler
cd ~/chipled
cat >on.c <<__EOF__ # Create C programs to turn the status LED on
#include <stdio.h>
int main(int argc, char **argv)
{
system("/usr/sbin/i2cset -f -y 0 0x34 0x93 0x1");
return 0;
}
__EOF__
cat >off.c <<__EOF__ # Create C programs to turn the status LED off
#include <stdio.h>
int main(int argc, char **argv)
{
system("/usr/sbin/i2cset -f -y 0 0x34 0x93 0x0");
return 0;
}
__EOF__
sudo gcc -o on on.c # Compile
sudo gcc -o off off.c
sudo chmod +s on # Allow executables to run with root privilage
sudo chmod +s off
sudo apt-get install nodejs
sudo apt-get install npm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment