Skip to content
Raspberry Pi 3B scripts collection
Shell Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
forward.sh
gateway.sh
governor.py
gpio.sh
net-monitor.sh
randmac.sh
restart.sh
temperature.py

README.md

rpi-scripts

Raspberry Pi 3B scripts collection

Comaptibility

Tested and 100% compatible: Raspbian 8 Lite (jessie)

Now testing Raspbian 9.1 (stretch)

Forward traffic

For example, if eth0 is configured to use internet and wlan0 is access point (WiFi hotspot), you can do this:

forward.sh eth0 wlan0

Poof! You have access to the internet on your wlan0 now.

Temperature

Just shows current CPU & GPU temperature. Real-time monotor: watch -tn 1 ./temperature.py

Example output:

CPU: 50.5'C 122.9'F
GPU: 49.9'C 121.8'F

GPIO

Control GPIO pins with easy syntax: gpio.sh pin value

  • set pin 18 to 1: ./gpio.sh 18 1
  • set pin 15 to 0: gpio.sh 15 0
  • gpio.sh 17 sets pin 17 to 1 or 0 depending on current value. It works like a switch.

Example:

$ ./gpio.sh 18 1 # pin 18 will be set to 1
$ ./gpio.sh 15 0 # pin 15 will be set to 0

$ ./gpio.sh 17 # pin 17 will be set to 1
$ ./gpio.sh 17 # pin 17 will be set to 0

CPU governor

Raspberry Pi supports several CPU governors. For example: powersave, ondemand, performance.

List available: governor.py -l

Available governors:
 - conservative
 - ondemand
 - userspace
 - powersave
 - performance
 - schedutil

Current governor: governor.py -c

Current governor: powersave

Set governor: sudo ./governor.py -s performance

Random MAC

Requires macchanger package.

Changes MAC on all interfaces by default. But you can specify one manuaally: randmac.sh wlan0

Net monitor

Requires ifstat and bc package.

Switches GPIO pins depending on current network bandwidth. Works like an indicator with LEDs connected to the GPIO.

License

GPLv3

You can’t perform that action at this time.