###IF you are using Raspian many of these tasks are unescessary. With Raspbian:
- SSH is ready to go out of the box
- default runlevel is 3
- many items can be configured with raspi-config tool
###Adding more swap for high memory use concerns
sudo dd if=/dev/zero of=/swap bs=1M count=1024
sudo mkswap /swap
sudo swapon /swap
###Switch Runlevel to 3 so you can run headless without GUI loading
[root@raspi ~] ln -sf /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target
[root@raspi ~] ll /etc/systemd/system/default.target
###Switch back to Runlevel 5 to boot to GUI
[root@raspi ~] ln -sf /usr/lib/systemd/system/graphical.target /etc/systemd/system/default.target
[root@raspi ~] ll /etc/systemd/system/default.target
###Options for memory and processor overclocking management
#FILE: /boot/config.txt
#Processor Management
arm_freq=1000
arm_freq_min=700
force_turbo=0 #allows the OS to dynamically adjust processor frequency possible not on all OS
core_freq=500
sdram_freq=500
over_voltage=6
force_turbo=0
#Memory Management
gpu_mem=16 #set to the amount of memory you would like the gpu to consume
60 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
###Make sure SSH is running (Pidora and others)
systemctl enable sshd.service
systemctl start sshd.service
systemctl status sshd.service
systemctl enable sshd.service #makes it run on bootup
##Headless Mode (Pidora) In order to run in headless mode right out of the gate you need to create a file called 'headless' on the SD card before you insert into the Pi. If you want get an ip address from dchp use an empty file, otherwise use something like the options below
IPADDR=192.168.1.105
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
RESIZE
SWAP=512
##Write Image to SD Card
diskutil list #to find the volume of the card
diskutil unmountdisk /dev/diskN
sudo dd bs=4M if=/path/to/image of=/dev/diskN
####bs=4M needed to be changed to 4m on some cards , not sure why
##Backing up sd card once you get it setup
diskutil list
sudo dd if=/dev/<disk choice> of=~/Desktop/backup.dmg
sudo nano /etc/rc.local
[details](http://forums.debian.net/viewtopic.php?f=5&t=1096250
sudo apt-get install isc-dhcp-server
##Wireless Client Debian Tutorial [Raspberry Pi Website] (http://www.raspberrypi.org/forums/viewtopic.php?f=27&t=7592)
iwlist scan
###Edit /etc/network/interfaces
# my wifi device
auto wlan0
iface wlan0 inet dhcp
wireless-essid [ESSID]
wireless-key [KEY]
wireless-mode [MODE]
More details with man interfaces
, man wireless
and /usr/share/doc/wireless-tools/README.Debian
.
##Get Realtek Drivers working with HOSTAPD Drivers
sudo unzip RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911.zip
cd RTL8188C_8192C_USB_linux_v4.0.2_9000.20130911
cd wpa_supplicant_hostapd
sudo tar -xvf wpa_supplicant_hostapd-0.8_rtw_r7475.20130812.tar.gz
cd wpa_supplicant_hostapd-0.8_rtw_r7475.20130812
cd hostapd
sudo make
sudo make install
sudo mv hostapd /usr/sbin/hostapd
sudo chown root.root /usr/sbin/hostapd
sudo chmod 755 /usr/sbin/hostapd
##Wireless WICD
###Useful Links Extend Partition to Fill SD Card
##NGINX, Passenger and Sinatra Helpful Blog Post why is it installed in /opt and how to start it
sudo apt-get install rubygems libcurl4-openssl-dev libssl-dev libmysqlclient-dev libpq-dev libmagickcore-dev libmagickwand-dev libsqlite3-dev bundler
sudo gem install passenger
sudo passenger-install-nginx-module
###REmove Apache
sudo apt-get remove apache2.2-common