One of the easiest ways to run a script or command on startup is to use the crontab.
The crontab includes an entry string to let you run a script after reboot or on startup.
Enter the crontab.
crontab -e
Add an item to run on startup.
@reboot <COMMAND OR SCRIPT TO RUN>
My crontab entry is visible below. I used this to start all my scripts on my Pi creation.
Other startup options include, writing an entry into the bashrc. For the Pi, you could also write an entry in /etc/rc.local. This article discusses actually creating an init.d script for those interested.