Asennukset

OH6ECF LARS:asennusmuistio(Edit)

Muistiinpanoja tämän raspin ohjelmistoasennuksista. Jos tässä on pelkkä otsikko, silloin asennus on tehty perusrepositorioista ilman sen kummempaa säätämistä.

UMTSKEEPER 3g-yhteyden ylläpito(Edit)

Umtskeeper hoitaa laitteen 3g-yhteyden kytkennän ja valvonnan. Tarvittaessa se alustaa yhteyden verkkoon uudestaan jos yhteys katkeaa.

Fyysisesti 3g-yhteys on Huawei-datamokkula raspin usb-portissa.

17.1.2017 Install UMTSKEEPER>

GUIDE: http://mintakaconciencia.net/squares/umtskeeper/

pi@raspberrypi:~ $ cd ~

pi@raspberrypi:~ $ pwd

/home/pi

pi@raspberrypi:~ $ mkdir umtskeeper

pi@raspberrypi:~ $ cd umtskeeper

pi@raspberrypi:~/umtskeeper $ wget "http://mintakaconciencia.net/squares/umtskeeper/src/umtskeeper.tar.gz"

—2017-01-17 07:50:20— http://mintakaconciencia.net/squares/umtskeeper/src/umtskeeper.tar.gz

Resolving mintakaconciencia.net (mintakaconciencia.net)... 143.50.159.33

Connecting to mintakaconciencia.net (mintakaconciencia.net)|143.50.159.33|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 233762 (228K) application/x-gzip

Saving to: ‘umtskeeper.tar.gz’

umtskeeper.tar.gz 100%=====================> 228.28K 95.9KB/s in 2.4s

2017-01-17 07:50:24 (95.9 KB/s) - ‘umtskeeper.tar.gz’ saved 233762/233762

pi@raspberrypi:~/umtskeeper $ md5sum umtskeeper.tar.gz

a456e1467057f78d53f4749adcd26d12 umtskeeper.tar.gz

pi@raspberrypi:~/umtskeeper $ chmod +x sakis3g umtskeeper resetusb

chmod: cannot access ‘sakis3g’: No such file or directory

chmod: cannot access ‘umtskeeper’: No such file or directory

chmod: cannot access ‘resetusb’: No such file or directory

pi@raspberrypi:~/umtskeeper $ tar -xzvf umtskeeper.tar.gz

favicon.ico

style.css

robots.txt

LICENSE.txt

umtskeeper.conf.sample

README.txt

README.html

sakis3g

umtskeeper

changelog.txt

pi@raspberrypi:~/umtskeeper $ chmod +x sakis3g umtskeeper resetusb

chmod: cannot access ‘resetusb’: No such file or directory

pi@raspberrypi:~/umtskeeper $ sudo apt-get install usb-modeswitch ppp

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

libjim0.75 libpcap0.8 usb-modeswitch-data

Suggested packages:

comgt wvdial

The following NEW packages will be installed:

libjim0.75 libpcap0.8 ppp usb-modeswitch usb-modeswitch-data

0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.

Need to get 618 kB of archives.

After this operation, 1,531 kB of additional disk space will be used.

Do you want to continue? Y/n y

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libpcap0.8 armhf 1.6.2-2 121 kB

Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libjim0.75 armhf 0.75-1 98.3 kB

Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main ppp armhf 2.4.6-3.1 306 kB

Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main usb-modeswitch-data all 20150115-1 41.5 kB

Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main usb-modeswitch armhf 2.2.0+repack0-2 51.4 kB

Fetched 618 kB in 9s (63.2 kB/s)

Selecting previously unselected package libpcap0.8:armhf.

(Reading database ... 126384 files and directories currently installed.)

Preparing to unpack .../libpcap0.8_1.6.2-2_armhf.deb ...

Unpacking libpcap0.8:armhf (1.6.2-2) ...

Selecting previously unselected package libjim0.75:armhf.

Preparing to unpack .../libjim0.75_0.75-1_armhf.deb ...

Unpacking libjim0.75:armhf (0.75-1) ...

Selecting previously unselected package ppp.

Preparing to unpack .../ppp_2.4.6-3.1_armhf.deb ...

Unpacking ppp (2.4.6-3.1) ...

Selecting previously unselected package usb-modeswitch-data.

Preparing to unpack .../usb-modeswitch-data_20150115-1_all.deb ...

Unpacking usb-modeswitch-data (20150115-1) ...

Selecting previously unselected package usb-modeswitch.

Preparing to unpack .../usb-modeswitch_2.2.0+repack0-2_armhf.deb ...

Unpacking usb-modeswitch (2.2.0+repack0-2) ...

Processing triggers for man-db (2.7.0.2-5) ...

Processing triggers for systemd (215-17+deb8u3) ...

Setting up libpcap0.8:armhf (1.6.2-2) ...

Setting up libjim0.75:armhf (0.75-1) ...

Setting up ppp (2.4.6-3.1) ...

Setting up usb-modeswitch-data (20150115-1) ...

Setting up usb-modeswitch (2.2.0+repack0-2) ...

Processing triggers for libc-bin (2.19-18+deb8u3) ...

Processing triggers for systemd (215-17+deb8u3) ...

pi@raspberrypi:~/umtskeeper $ C

pi@raspberrypi:~/umtskeeper $

UDATED etc/rclocal :

  1. !/bin/sh -e
  2. rc.local
  3. This script is executed at the end of each multiuser runlevel.
  4. Make sure that the script will "exit 0" on success or any other
  5. value on error.
  6. In order to enable or disable this script just change the execution
  7. bits.
  8. By default this script does nothing.
  1. Print the IP address
  2. _IP=$(hostname -I) || true
  3. if [ "$_IP" ]; then
  4. printf "My IP address is %s\n" "$_IP"
  5. fi

/home/pi/umtskeeper/umtskeeper —sakisoperators "USBINTERFACE='0' OTHER='USBMODEM' USBMODEM='12d1:1003' SIM_PIN='1234' APN='CUSTOM_APN' CUSTOM_APN='data.dna.fi' APN_USER='0' APN_PASS='0'" —sakisswitches "—sudo —console" —devicename 'Huawei' —log —silent —monthstart 8 —nat 'no' —httpserver &>> /home/pi/umtskeeper/error.log &

exit 0

RDP etätyöpöytä(Edit)

RDP-protokolla on siitä kätevä, että myös windox - ja android-laitteet toimivat helposti etätyöpöydän näyttäjinä raspille RDP:llä ilman suurempaa säätämistä.

REMOTE DESKTOP SERVER (for Remmina client, rdp-protocol to be combatible with android clients)

Installed XRDP 0.6.1-2+rpi1

WIFI HOTSPOT(Edit)

Tämä asennus jakaa internet-yhteyden (ks UMTSKEEPER yllä) wlan-verkkona laitteen lähistölle.

OHJE https://frillip.com/using-your-raspberry-pi-3-as-a-wifi-access-point-with-hostapd/

pi@raspberrypi:~ $ sudo apt-get install dnsmasq

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

dns-root-data dnsmasq-base libmnl0 libnetfilter-conntrack3

The following NEW packages will be installed:

dns-root-data dnsmasq dnsmasq-base libmnl0 libnetfilter-conntrack3

0 upgraded, 5 newly installed, 0 to remove and 106 not upgraded.

Need to get 456 kB of archives.

After this operation, 1,051 kB of additional disk space will be used.

Do you want to continue? Y/n y

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libmnl0 armhf 1.0.3-5 10.9 kB

Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libnetfilter-conntrack3 armhf 1.0.4-1 40.0 kB

Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main dns-root-data all 2014060201+2 14.9 kB

Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main dnsmasq-base armhf 2.72-3+deb8u1 374 kB

Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main dnsmasq all 2.72-3+deb8u1 15.8 kB

Fetched 456 kB in 2min 14s (3,390 B/s)

Selecting previously unselected package libmnl0:armhf.

(Reading database ... 127677 files and directories currently installed.)

Preparing to unpack .../libmnl0_1.0.3-5_armhf.deb ...

Unpacking libmnl0:armhf (1.0.3-5) ...

Selecting previously unselected package libnetfilter-conntrack3:armhf.

Preparing to unpack .../libnetfilter-conntrack3_1.0.4-1_armhf.deb ...

Unpacking libnetfilter-conntrack3:armhf (1.0.4-1) ...

Selecting previously unselected package dns-root-data.

Preparing to unpack .../dns-root-data_2014060201+2_all.deb ...

Unpacking dns-root-data (2014060201+2) ...

Selecting previously unselected package dnsmasq-base.

Preparing to unpack .../dnsmasq-base_2.72-3+deb8u1_armhf.deb ...

Unpacking dnsmasq-base (2.72-3+deb8u1) ...

Selecting previously unselected package dnsmasq.

Preparing to unpack .../dnsmasq_2.72-3+deb8u1_all.deb ...

Unpacking dnsmasq (2.72-3+deb8u1) ...

Processing triggers for dbus (1.8.20-0+deb8u1) ...

Processing triggers for man-db (2.7.0.2-5) ...

Processing triggers for systemd (215-17+deb8u3) ...

Setting up libmnl0:armhf (1.0.3-5) ...

Setting up libnetfilter-conntrack3:armhf (1.0.4-1) ...

Setting up dns-root-data (2014060201+2) ...

Setting up dnsmasq-base (2.72-3+deb8u1) ...

Setting up dnsmasq (2.72-3+deb8u1) ...

Processing triggers for libc-bin (2.19-18+deb8u3) ...

Processing triggers for dbus (1.8.20-0+deb8u1) ...

Processing triggers for systemd (215-17+deb8u3) ...

pi@raspberrypi:~ $

pi@raspberrypi:~ $

pi@raspberrypi:~ $ sudo apt-get install hostapd

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

libnl-route-3-200

The following NEW packages will be installed:

hostapd libnl-route-3-200

0 upgraded, 2 newly installed, 0 to remove and 106 not upgraded.

Need to get 559 kB of archives.

After this operation, 1,473 kB of additional disk space will be used.

Do you want to continue? Y/n y

Err http://mirrordirector.raspbian.org/raspbian/ jessie/main hostapd armhf 1:2.3-1+deb8u3

404 Not Found IP: 93.93.128.193 80

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libnl-route-3-200 armhf 3.2.24-2 99.5 kB

Fetched 99.5 kB in 5s (19.7 kB/s)

E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/w/wpa/hostapd_2.3-1+deb8u3_armhf.deb 404 Not Found IP: 93.93.128.193 80

E: Unable to fetch some archives, maybe run apt-get update or try with —fix-missing?

pi@raspberrypi:~ $ sudo apt-get update

Get:1 http://mirrordirector.raspbian.org jessie InRelease 12.2 kB

Get:2 http://archive.raspberrypi.org jessie InRelease 22.9 kB

Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages 9,531 kB

Get:4 http://archive.raspberrypi.org jessie/main armhf Packages 156 kB

Get:5 http://archive.raspberrypi.org jessie/ui armhf Packages 57.9 kB

Get:6 http://mirrordirector.raspbian.org jessie/contrib armhf Packages 43.2 kB

Get:7 http://mirrordirector.raspbian.org jessie/non-free armhf Packages 84.2 kB

Get:8 http://mirrordirector.raspbian.org jessie/rpi armhf Packages 1,356 B

Ign http://archive.raspberrypi.org jessie/main Translation-en_GB

Ign http://archive.raspberrypi.org jessie/main Translation-en

Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB

Ign http://archive.raspberrypi.org jessie/ui Translation-en

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en

Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/main Translation-en

Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en

Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en

Fetched 9,909 kB in 1min 5s (150 kB/s)

Reading package lists... Done

pi@raspberrypi:~ $ sudo apt-get install hostapd

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

libnl-route-3-200

The following NEW packages will be installed:

hostapd libnl-route-3-200

0 upgraded, 2 newly installed, 0 to remove and 297 not upgraded.

Need to get 459 kB/559 kB of archives.

After this operation, 1,473 kB of additional disk space will be used.

Do you want to continue? Y/n y

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main hostapd armhf 1:2.3-1+deb8u4 459 kB

Fetched 459 kB in 5s (83.5 kB/s)

Selecting previously unselected package libnl-route-3-200:armhf.

(Reading database ... 127738 files and directories currently installed.)

Preparing to unpack .../libnl-route-3-200_3.2.24-2_armhf.deb ...

Unpacking libnl-route-3-200:armhf (3.2.24-2) ...

Selecting previously unselected package hostapd.

Preparing to unpack .../hostapd_1%3a2.3-1+deb8u4_armhf.deb ...

Unpacking hostapd (1:2.3-1+deb8u4) ...

Processing triggers for man-db (2.7.0.2-5) ...

Processing triggers for systemd (215-17+deb8u3) ...

Setting up libnl-route-3-200:armhf (3.2.24-2) ...

Setting up hostapd (1:2.3-1+deb8u4) ...

Processing triggers for libc-bin (2.19-18+deb8u3) ...

Processing triggers for systemd (215-17+deb8u3) ...

pi@raspberrypi:~ $

pi@raspberrypi:~ $

pi@raspberrypi:~ $ sudo apt-get update

Get:1 http://mirrordirector.raspbian.org jessie InRelease 12.2 kB

Get:2 http://archive.raspberrypi.org jessie InRelease 22.9 kB

Get:3 http://mirrordirector.raspbian.org jessie/main armhf Packages 9,531 kB

Get:4 http://archive.raspberrypi.org jessie/main armhf Packages 156 kB

Get:5 http://archive.raspberrypi.org jessie/ui armhf Packages 57.9 kB

Get:6 http://mirrordirector.raspbian.org jessie/contrib armhf Packages 43.2 kB

Get:7 http://mirrordirector.raspbian.org jessie/non-free armhf Packages 84.2 kB

Get:8 http://mirrordirector.raspbian.org jessie/rpi armhf Packages 1,356 B

Ign http://archive.raspberrypi.org jessie/main Translation-en_GB

Ign http://archive.raspberrypi.org jessie/main Translation-en

Ign http://archive.raspberrypi.org jessie/ui Translation-en_GB

Ign http://archive.raspberrypi.org jessie/ui Translation-en

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/contrib Translation-en

Ign http://mirrordirector.raspbian.org jessie/main Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/main Translation-en

Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/non-free Translation-en

Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en_GB

Ign http://mirrordirector.raspbian.org jessie/rpi Translation-en

Fetched 9,909 kB in 1min 5s (150 kB/s)

Reading package lists... Done

pi@raspberrypi:~ $ sudo apt-get install hostapd

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

libnl-route-3-200

The following NEW packages will be installed:

hostapd libnl-route-3-200

0 upgraded, 2 newly installed, 0 to remove and 297 not upgraded.

Need to get 459 kB/559 kB of archives.

After this operation, 1,473 kB of additional disk space will be used.

Do you want to continue? Y/n y

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main hostapd armhf 1:2.3-1+deb8u4 459 kB

Fetched 459 kB in 5s (83.5 kB/s)

Selecting previously unselected package libnl-route-3-200:armhf.

(Reading database ... 127738 files and directories currently installed.)

Preparing to unpack .../libnl-route-3-200_3.2.24-2_armhf.deb ...

Unpacking libnl-route-3-200:armhf (3.2.24-2) ...

Selecting previously unselected package hostapd.

Preparing to unpack .../hostapd_1%3a2.3-1+deb8u4_armhf.deb ...

Unpacking hostapd (1:2.3-1+deb8u4) ...

Processing triggers for man-db (2.7.0.2-5) ...

Processing triggers for systemd (215-17+deb8u3) ...

Setting up libnl-route-3-200:armhf (3.2.24-2) ...

Setting up hostapd (1:2.3-1+deb8u4) ...

Processing triggers for libc-bin (2.19-18+deb8u3) ...

Processing triggers for systemd (215-17+deb8u3) ...

pi@raspberrypi:~ $

pi@raspberrypi:~ $

In newer Raspian versions, interface configuration is handled by dhcpcd by default. We need to tell it to ignore wlan0, as we will be configuring it with a static IP address elsewhere. So open up the dhcpcd configuration file with sudo nano /etc/dhcpcd.conf and add the following line to the bottom of the file:

denyinterfaces wlan0

Note: This must be ABOVE any interface lines you may have added!

Now we need to configure our static IP. To do this open up the interface configuration file with sudo nano /etc/network/interfaces and edit the wlan0 section so that it looks like this:

allow-hotplug wlan0

iface wlan0 inet static

address 172.24.1.1

netmask 255.255.255.0

network 172.24.1.0

broadcast 172.24.1.255

  1. wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Restart dhcpcd with sudo service dhcpcd restart and then reload the configuration for wlan0 with sudo ifdown wlan0; sudo ifup wlan0.

VANHA

  1. interfaces(5) file used by ifup(8) and ifdown(8)
  1. Please note that this file is written to be used with dhcpcd
  2. For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  1. Include files from /etc/network/interfaces.d:

source-directory /etc/network/interfaces.d

auto lo

iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0

iface wlan0 inet manual

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1

iface wlan1 inet manual

MUOKATTU

  1. interfaces(5) file used by ifup(8) and ifdown(8)
  1. Please note that this file is written to be used with dhcpcd
  2. For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
  1. Include files from /etc/network/interfaces.d:

source-directory /etc/network/interfaces.d

auto lo

iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan0

iface wlan0 inet static

address 172.24.1.1

netmask 255.255.255.0

network 172.24.1.0

broadcast 172.24.1.255

CONFIGURE HOSTAPD

Next, we need to configure hostapd. Create a new configuration file with sudo nano /etc/hostapd/hostapd.conf with the following contents:

  1. This is the name of the WiFi interface we configured above

interface=wlan0

  1. Use the nl80211 driver with the brcmfmac driver

driver=nl80211

  1. This is the name of the network

ssid=Pi3-AP

  1. Use the 2.4GHz band

hw_mode=g

  1. Use channel 6

channel=6

  1. Enable 802.11n

ieee80211n=1

  1. Enable WMM

wmm_enabled=1

  1. Enable 40MHz channels with 20ns guard interval

ht_capab=HT40SHORT-GI-20DSSS_CCK-40

  1. Accept all MAC addresses

macaddr_acl=0

  1. Use WPA authentication

auth_algs=1

  1. Require clients to know the network name

ignore_broadcast_ssid=0

  1. Use WPA2

wpa=2

  1. Use a pre-shared key

wpa_key_mgmt=WPA-PSK

  1. The network passphrase

wpa_passphrase=raspberry

  1. Use AES, instead of TKIP

rsn_pairwise=CCMP

We can check if it's working at this stage by running sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf. If it's all gone well thus far, you should be able to see to the network Pi3-AP! If you try connecting to it, you will see some output from the Pi, but you won't receive and IP address until we set up dnsmasq in the next step. Use Ctrl+C to stop it.

We aren't quite done yet, because we also need to tell hostapd where to look for the config file when it starts up on boot. Open up the default configuration file with sudo nano /etc/default/hostapd and find the line #DAEMON_CONF="" and replace it with DAEMON_CONF="/etc/hostapd/hostapd.conf".

CONFIGURE DNSMASQ

The shipped dnsmasq config file contains a wealth of information on how to use it, but the majority of it is largely redundant for our purposes. I'd advise moving it (rather than deleting it), and creating a new one with

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

sudo nano /etc/dnsmasq.conf

Paste the following into the new file:

interface=wlan0 # Use interface wlan0

listen-address=172.24.1.1 # Explicitly specify the address to listen on

bind-interfaces # Bind to the interface to make sure we aren't sending things elsewhere

server=8.8.8.8 # Forward DNS requests to Google DNS

domain-needed # Don't forward short names

bogus-priv # Never forward addresses in the non-routed address spaces.

dhcp-range=172.24.1.50,172.24.1.150,12h # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time

SET UP IPV4 FORWARDING

One of the last things that we need to do before we send traffic anywhere is to enable packet forwarding.

To do this, open up the sysctl.conf file with sudo nano /etc/sysctl.conf, and remove the # from the beginning of the line containing net.ipv4.ip_forward=1. This will enable it on the next reboot, but because we are impatient, activate it immediately with : 

sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

We also need to share our Pi's internet connection to our devices connected over WiFi by the configuring a NAT between our wlan0 interface and our eth0interface. We can do this using the following commands:

HUOM! JOTTA 3g yhteys jaetaan, “eth0” pitaa vaihtaa “ppp0” allaolevaan. Tämä jakaa ethernet-yhteyden:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

sudo iptables -A FORWARD -i eth0 -o wlan0 -m state —state RELATED,ESTABLISHED -j ACCEPT

sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT

However, we need these rules to be applied every time we reboot the Pi, so run sudo sh -c "iptables-save > /etc/iptables.ipv4.nat" to save the rules to the file /etc/iptables.ipv4.nat. Now we need to run this after each reboot, so open the rc.local file with sudo nano /etc/rc.local and just above the line exit 0, add the following line:

iptables-restore < /etc/iptables.ipv4.nat

However, we need these rules to be applied every time we reboot the Pi, so run sudo sh -c "iptables-save > /etc/iptables.ipv4.nat" to save the rules to the file /etc/iptables.ipv4.nat. Now we need to run this after each reboot, so open the rc.local file with sudo nano /etc/rc.local and just above the line exit 0, add the following line:

iptables-restore < /etc/iptables.ipv4.nat

WE'RE ALMOST THERE!

Now we just need to start our services:

sudo service hostapd start

sudo service dnsmasq start

And that's it! You should now be able to connect to the internet through your Pi, via the on-board WiFi!

APACHE ja PHP(Edit)

Tämä asennus on apache-serveri joka hoitaa LARS-sivuston jakamisen sekä PHP-joka hoitaa sivuston monia toimintoja.

8.5.2017 APACHE + PHPhttps://www.raspberrypi.org/documentation/remote-access/web-server/apache.md

pi@raspberrypi:~ $ sudo apt-get install apache2 -y

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap liblua5.1-0

ssl-cert

Suggested packages:

apache2-doc apache2-suexec-pristine apache2-suexec-custom openssl-blacklist

The following NEW packages will be installed:

apache2 apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap

liblua5.1-0 ssl-cert

0 upgraded, 10 newly installed, 0 to remove and 297 not upgraded.

Need to get 1,759 kB of archives.

After this operation, 5,258 kB of additional disk space will be used.

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libapr1 armhf 1.5.1-3 77.1 kB

Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libaprutil1 armhf 1.5.4-1 75.9 kB

Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main libaprutil1-dbd-sqlite3 armhf 1.5.4-1 17.7 kB

Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main libaprutil1-ldap armhf 1.5.4-1 16.7 kB

Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main liblua5.1-0 armhf 5.1.5-7.1 83.7 kB

Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-bin armhf 2.4.10-10+deb8u8 901 kB

Get:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-utils armhf 2.4.10-10+deb8u8 195 kB

Get:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main ssl-cert all 1.0.35 20.9 kB

Get:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2-data all 2.4.10-10+deb8u8 162 kB

Get:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main apache2 armhf 2.4.10-10+deb8u8 208 kB

Fetched 1,759 kB in 9s (190 kB/s)

Preconfiguring packages ...

Selecting previously unselected package libapr1:armhf.

(Reading database ... 127768 files and directories currently installed.)

Preparing to unpack .../libapr1_1.5.1-3_armhf.deb ...

Unpacking libapr1:armhf (1.5.1-3) ...

Selecting previously unselected package libaprutil1:armhf.

Preparing to unpack .../libaprutil1_1.5.4-1_armhf.deb ...

Unpacking libaprutil1:armhf (1.5.4-1) ...

Selecting previously unselected package libaprutil1-dbd-sqlite3:armhf.

Preparing to unpack .../libaprutil1-dbd-sqlite3_1.5.4-1_armhf.deb ...

Unpacking libaprutil1-dbd-sqlite3:armhf (1.5.4-1) ...

Selecting previously unselected package libaprutil1-ldap:armhf.

Preparing to unpack .../libaprutil1-ldap_1.5.4-1_armhf.deb ...

Unpacking libaprutil1-ldap:armhf (1.5.4-1) ...

Selecting previously unselected package liblua5.1-0:armhf.

Preparing to unpack .../liblua5.1-0_5.1.5-7.1_armhf.deb ...

Unpacking liblua5.1-0:armhf (5.1.5-7.1) ...

Selecting previously unselected package apache2-bin.

Preparing to unpack .../apache2-bin_2.4.10-10+deb8u8_armhf.deb ...

Unpacking apache2-bin (2.4.10-10+deb8u8) ...

Selecting previously unselected package apache2-utils.

Preparing to unpack .../apache2-utils_2.4.10-10+deb8u8_armhf.deb ...

Unpacking apache2-utils (2.4.10-10+deb8u8) ...

Selecting previously unselected package apache2-data.

Preparing to unpack .../apache2-data_2.4.10-10+deb8u8_all.deb ...

Unpacking apache2-data (2.4.10-10+deb8u8) ...

Selecting previously unselected package apache2.

Preparing to unpack .../apache2_2.4.10-10+deb8u8_armhf.deb ...

Unpacking apache2 (2.4.10-10+deb8u8) ...

Selecting previously unselected package ssl-cert.

Preparing to unpack .../ssl-cert_1.0.35_all.deb ...

Unpacking ssl-cert (1.0.35) ...

Processing triggers for man-db (2.7.0.2-5) ...

Processing triggers for systemd (215-17+deb8u3) ...

Setting up libapr1:armhf (1.5.1-3) ...

Setting up libaprutil1:armhf (1.5.4-1) ...

Setting up libaprutil1-dbd-sqlite3:armhf (1.5.4-1) ...

Setting up libaprutil1-ldap:armhf (1.5.4-1) ...

Setting up liblua5.1-0:armhf (5.1.5-7.1) ...

Setting up apache2-bin (2.4.10-10+deb8u8) ...

Setting up apache2-utils (2.4.10-10+deb8u8) ...

Setting up apache2-data (2.4.10-10+deb8u8) ...

Setting up apache2 (2.4.10-10+deb8u8) ...

Enabling module mpm_event.

Enabling module authz_core.

Enabling module authz_host.

Enabling module authn_core.

Enabling module auth_basic.

Enabling module access_compat.

Enabling module authn_file.

Enabling module authz_user.

Enabling module alias.

Enabling module dir.

Enabling module autoindex.

Enabling module env.

Enabling module mime.

Enabling module negotiation.

Enabling module setenvif.

Enabling module filter.

Enabling module deflate.

Enabling module status.

Enabling module reqtimeout.

Enabling conf charset.

Enabling conf localized-error-pages.

Enabling conf other-vhosts-access-log.

Enabling conf security.

Enabling conf serve-cgi-bin.

Enabling site 000-default.

Setting up ssl-cert (1.0.35) ...

Processing triggers for libc-bin (2.19-18+deb8u3) ...

Processing triggers for systemd (215-17+deb8u3) ...

pi@raspberrypi:~ $ sudo apt-get install php5 libapache2-mod-php5 -y

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

libonig2 libperl4-corelibs-perl libqdbm14 lsof php5-cli php5-common php5-json php5-readline

Suggested packages:

php-pear php5-user-cache

The following NEW packages will be installed:

libapache2-mod-php5 libonig2 libperl4-corelibs-perl libqdbm14 lsof php5 php5-cli php5-common php5-json php5-readline

0 upgraded, 10 newly installed, 0 to remove and 297 not upgraded.

Need to get 5,087 kB of archives.

After this operation, 18.8 MB of additional disk space will be used.

Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main libonig2 armhf 5.9.5-3.2 101 kB

Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libperl4-corelibs-perl all 0.003-1 43.6 kB

Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main php5 all 5.6.30+dfsg-0+deb8u1 1,318 B

Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main lsof armhf 4.86+dfsg-1 321 kB

Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main libqdbm14 armhf 1.8.78-5+b1 86.0 kB

Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-common armhf 5.6.30+dfsg-0+deb8u1 721 kB

Get:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-json armhf 1.3.6-1 16.9 kB

Get:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-cli armhf 5.6.30+dfsg-0+deb8u1 1,911 kB

Get:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main libapache2-mod-php5 armhf 5.6.30+dfsg-0+deb8u1 1,874 kB

Get:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main php5-readline armhf 5.6.30+dfsg-0+deb8u1 11.2 kB

Fetched 5,087 kB in 26s (191 kB/s)

Selecting previously unselected package libonig2:armhf.

(Reading database ... 128456 files and directories currently installed.)

Preparing to unpack .../libonig2_5.9.5-3.2_armhf.deb ...

Unpacking libonig2:armhf (5.9.5-3.2) ...

Selecting previously unselected package libperl4-corelibs-perl.

Preparing to unpack .../libperl4-corelibs-perl_0.003-1_all.deb ...

Unpacking libperl4-corelibs-perl (0.003-1) ...

Selecting previously unselected package lsof.

Preparing to unpack .../lsof_4.86+dfsg-1_armhf.deb ...

Unpacking lsof (4.86+dfsg-1) ...

Selecting previously unselected package libqdbm14.

Preparing to unpack .../libqdbm14_1.8.78-5+b1_armhf.deb ...

Unpacking libqdbm14 (1.8.78-5+b1) ...

Selecting previously unselected package php5-common.

Preparing to unpack .../php5-common_5.6.30+dfsg-0+deb8u1_armhf.deb ...

Unpacking php5-common (5.6.30+dfsg-0+deb8u1) ...

Selecting previously unselected package php5-json.

Preparing to unpack .../php5-json_1.3.6-1_armhf.deb ...

Unpacking php5-json (1.3.6-1) ...

Selecting previously unselected package php5-cli.

Preparing to unpack .../php5-cli_5.6.30+dfsg-0+deb8u1_armhf.deb ...

Unpacking php5-cli (5.6.30+dfsg-0+deb8u1) ...

Selecting previously unselected package libapache2-mod-php5.

Preparing to unpack .../libapache2-mod-php5_5.6.30+dfsg-0+deb8u1_armhf.deb ...

Unpacking libapache2-mod-php5 (5.6.30+dfsg-0+deb8u1) ...

Selecting previously unselected package php5.

Preparing to unpack .../php5_5.6.30+dfsg-0+deb8u1_all.deb ...

Unpacking php5 (5.6.30+dfsg-0+deb8u1) ...

Selecting previously unselected package php5-readline.

Preparing to unpack .../php5-readline_5.6.30+dfsg-0+deb8u1_armhf.deb ...

Unpacking php5-readline (5.6.30+dfsg-0+deb8u1) ...

Processing triggers for man-db (2.7.0.2-5) ...

Setting up libonig2:armhf (5.9.5-3.2) ...

Setting up libperl4-corelibs-perl (0.003-1) ...

Setting up lsof (4.86+dfsg-1) ...

Setting up libqdbm14 (1.8.78-5+b1) ...

Setting up php5-common (5.6.30+dfsg-0+deb8u1) ...

Creating config file /etc/php5/mods-available/pdo.ini with new version

php5_invoke: Enable module pdo for cli SAPI

php5_invoke: Enable module pdo for apache2 SAPI

Creating config file /etc/php5/mods-available/opcache.ini with new version

php5_invoke: Enable module opcache for cli SAPI

php5_invoke: Enable module opcache for apache2 SAPI

Setting up php5-json (1.3.6-1) ...

php5_invoke: Enable module json for cli SAPI

php5_invoke: Enable module json for apache2 SAPI

Setting up php5-cli (5.6.30+dfsg-0+deb8u1) ...

update-alternatives: using /usr/bin/php5 to provide /usr/bin/php (php) in auto mode

update-alternatives: using /usr/bin/phar5 to provide /usr/bin/phar (phar) in auto mode

Creating config file /etc/php5/cli/php.ini with new version

Setting up libapache2-mod-php5 (5.6.30+dfsg-0+deb8u1) ...

Creating config file /etc/php5/apache2/php.ini with new version

Module mpm_event disabled.

Enabling module mpm_prefork.

apache2_switch_mpm Switch to prefork

apache2_invoke: Enable module php5

Setting up php5 (5.6.30+dfsg-0+deb8u1) ...

Setting up php5-readline (5.6.30+dfsg-0+deb8u1) ...

Creating config file /etc/php5/mods-available/readline.ini with new version

php5_invoke: Enable module readline for cli SAPI

php5_invoke: Enable module readline for apache2 SAPI

Processing triggers for libc-bin (2.19-18+deb8u3) ...

Processing triggers for libapache2-mod-php5 (5.6.30+dfsg-0+deb8u1) ...

pi@raspberrypi:~ $

Windows share raspille(Edit)

Muistiinpanoja komentosarjasta, jolla windowsin jaetun kansion (Users) saa näkymään raspin tiedostopuussa (/home/pi/WINDOWS):

sudo mount -t cifs -o username=User,password=***** //172.24.1.75/Users /home/pi/WINDOWS

huom. ip-osoite on tietysti oltava ko. windows-koneen ja Users-kansion jaettu windowsin asetuksissa.

Tämä näyttää toimivan ainakin Win7:ssa.

FLDIGI (radiomodeemi)(Edit)

RTL-FM(Edit)

rtl_fm asentuu osana rtl-sdr pakettia

sudo apt-get install rtl-sdr

-tarvitsee uudelleenkäynnistyksen

PAVUCONTROLL (audio "mixeri")(Edit)

ssmtp (to send email)(Edit)

sudo apt-get install ssmtp

sudo apt-get install mailutils

asetukset:

sudo nano /etc/ssmtp/ssmtp.conf

root=postmaster

mailhub=smtp.gmail.com:587

hostname=raspberrypi

AuthUser=AGmailUserName@gmail.com

AuthPass=TheGmailPassword

FromLineOverride=YES

UseSTARTTLS=YES

Tags:


Powered by LionWiki. Last changed: 2017/06/24 19:26 Erase cookies Edit History