You can mark a script as executable like so
sudo chmod +x myscriptexample
To start apache
sudo service apache2 start
To install gparted (as an example)
sudo apt-get install gparted
On a Pi it is really better to install it headless and just work in a terminal via SSH. It forces you to learn faster. The following might be of help
After you have Raspbian install on the MicroSD card, insert it into the Pi and power it on. You don't need a monitor, mouse or keyboard attached to the PI to do any of the following. Just power and ethernet. You do need a separate computer.
Work out what the IP address the Raspberry Pi has obtained from DHCP. I assume that DHCP is running on your network, probably from your modem / router.
Login to your router and locate the page that lists all connected devices. Find the entry for the Raspberry Pi.
For the purposes of the following command it is assumed that your Raspberry Pi's IP address is 192.168.0.11
If you are using Windows, PuTTY is a suitable program to accomplish this.
Open a terminal and enter the following command
ssh -p 22 [email protected]
This should then connect you to the Raspberry Pi. Login with the default password. The first thing to do is enter the following command.
sudo raspi-config
Proceed through the options. When finished reboot the Raspberry Pi when prompted and then log back in. The IP should the same at this point.
Now set a static IP. Enter the following command to edit the interfaces file.
sudo nano /etc/network/interfaces
Edit the file so it resembles the following where 192.168.0.10 is the static IP you want your Raspberry Pi to have and your default gateway is 192.168.0.1
auto lo
iface lo inet loopback
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Exit and save the file and then reboot with
sudo shutdown -r now
You can now login with
ssh -p 22 [email protected]
and you know the IP won't change.
The adventure begins!