Skip to content

Instantly share code, notes, and snippets.

@robotamer
Forked from hofmannsven/README.md
Last active April 15, 2019 17:28
Show Gist options
  • Select an option

  • Save robotamer/2c246d511e6d59c7bd55d6948db5a6ef to your computer and use it in GitHub Desktop.

Select an option

Save robotamer/2c246d511e6d59c7bd55d6948db5a6ef to your computer and use it in GitHub Desktop.
Raspberry Pi Cheatsheet

Raspberry Pi

Related tutorial: http://raspberrypiguide.de/

Command Line Cheatsheet: https://gist.github.com/hofmannsven/8392477

Setup

Find all available devices arp -a

Locate Raspberry (b8:27:eb) in Network: Pi Finder

SSH

Connect to device via SSH + Name: ssh pi@rasperrypi

Connect to device via SSH + IP: ssh [email protected]

System

Get system info (e.g. IP): ifconfig

Get network info: iwconfig

Get hostname: hostname

Get hostname IP: hostname -I

Check for all connected USB devices: lsusb

Switch to config: sudo raspi-config

Switch to GUI: startx

Reboot system: reboot / sudo reboot

Shutdown: sudo shutdown -h now

Start SSH while booting: sudo update-rc.d ssh defaults

Apache/PHP/MySQL

Related tutorial: http://cd64.de/apache

Update system: sudo apt-get update & sudo apt-get upgrade

Install Apache: sudo apt-get install apache2 php5

Setup rewrite and overriding: sudo a2enmod rewrite » sudo nano /etc/apache2/sites-enabled/000-default

Change AllowOverride None to AllowOverride All within <Directory /var/www/>

Add Apache user via sudo visudo and add www-data ALL=(ALL) NOPASSWD: ALL to the end of the file

Restart Apache: sudo /etc/init.d/apache2 restart or sudo service apache2 restart

Files are stored within /var/www (changing will require root access)

Install MySQL: sudo apt-get install mysql-server

Install PHP with MySQl libs: sudo apt-get install php5 + sudo apt-get install php5-mysql

Audio

Play: omxplayer audio.mp3

Volume: + & -

GUI Keyboard Shortcuts

System menu: ctrl + esc

Open programm menu: alt + space

Switch programms: alt + tab

Access dropdown: alt + [letter-with-underline] e.g. alt + f

Close window: ctrl + q

Back to CLI: ctrl + alt + backspace

Remote Control

Related tutorial: http://cd64.de/vnc

Install VNC: sudo apt-get install tightvncserver

Start VNC: tightvncserver

Ethernet Port: 5900

WLAN Port: 5901

File Sharing

Related tutorial: http://cd64.de/filesharing

Install file sharing: sudo apt-get install netatalk

Connect to Server (via ⌘K): afp://192.168.64.xxx

WLAN

Via interface: http://youtu.be/sXDqMapgU_M

Via terminal: http://www.maketecheasier.com/setup-wifi-on-raspberry-pi/

Midnight Commander

Install: sudo apt-get install mc

Start: sudo mc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment