Raspberry Pi (or Ubuntu) IP Address Setting

IP Address Settings Static:

# /etc/network/interfaces
iface eth0 inet static
address a.b.c.d
netmask 255.255.255.0
gateway 192.168.0.1

IP Address Settings DHCP:

# /etc/network/interfaces
iface eth0 inet manual

Or

# /etc/network/interfaces
iface eth0 inet dhcp

Starting Ubuntu 18.04 LTS using netplan:
/etc/netplan/01-network-manager-all.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    enp1s0:
      dhcp4: no
      addresses: [192.168.1.222/24]
      # gateway4: 192.168.1.1 --deprecated
routes:
- to: default
via: 192.168.1.1

      nameservers:
        addresses: [8.8.8.8,8.8.4.4]

apply the configuration:
netplan apply

or using NetworkManager

network:
  version: 2
  renderer: NetworkManager

and use command below to set ip:

nmcli con mod "Wired connection 1" ipv4.address 1.2.3.4/24 ipv4.gateway 1.2.3.4 ipv4.dns 1.2.3.4 ipv4.method manual
# write above command in one single line

Nameserver:
a) Ubuntu versions < 14.04

# /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

b) Ubuntu versions >= 14.04

# /etc/network/interfaces
dns-nameservers 8.8.8.8

Note: For raspbian, when using static ip, you must disable DHCP service in /etc/dhcpcd.conf, add this line:

denyinterfaces eth0

Update 13 Oct 18, raspbian now use dhcp5 so you need to edit/etc/dhcpcd.conf

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

Raspberry Pi Kiosk Mode

To make Raspberry Pi automatically run specific app (browser) — kiosk mode, first install:

apt-get install x11-xserver-utils
apt-get install xscreensaver

Then edit this file:

/etc/xdg/lxsession/LXDE/autostart (on newer raspbian this is LXDE changed to LXDE-pi)
@lxpanel --profile LXDE

@pcmanfm --desktop --profile LXDE
#@xscreensaver -no-splash
#run midori
#@midori -e Fullscreen
#or run chromium
@chromium --kiosk http://localhost/dashboard
@xset s noblank
@xset s off
@xset -dpms

Notes:
– Check if the file /home/pi/.config/lxsession/LXDE-pi/autostart file exists. If it exists, it will be used instead of /etc/xdg/lxsession/LXDE-pi/autostart
– View logs (after reboot) in /home/pi/.xsession-errors

You can also change this file to disable screen blank when LXDE not running (terminal mode):

/etc/kbd/config
BLANK_TIME=0
BLANK_DPMS=off
POWERDOWN_TIME=0

And this to disable screen blank in LXDE:

/etc/lightdm/lightdm.conf
[SeatDefaults]
xserver-command=X -s 0 -dpms

Source:
– https://www.danpurdy.co.uk/web-development/raspberry-pi-kiosk-screen-tutorial/
– http://raspberrypi.stackexchange.com/questions/42633/raspberry-pi-autostart-of-lxde-does-not-work