Linux, Debian remove / stop service

To stop a service
sudo service servicename stop

To disable service autostart
sudo update-rc.d servicename disable

Raspberry turn off usb ports

download this


You can control the power on a port using the following command. (I installed it in user bin directory)

sudo $HOME/bin/hub-ctrl -h 1 -P 2 -p 1

That says to control hub 3 (-h 3) port 1 (-P 1) and to turn the power off (-p 0). You can also use ”-p 1” to turn the power back on.

Raspberry: upload Arduino sketch from CLI

install these packages

sudo apt-get install arduino-core arduino-mk

Then add yourself to the dialout group to allow you to upload code to the Arduino board

sudo usermod -a -G dialout pi (Change pi to be your username if different)

Create Makefile

ARDUINO_DIR = /usr/share/arduino
include /usr/share/arduino/Arduino.mk

to build


to upload

make upload

Crontab on Linux

To launch a program at reboot.

contab -e

Add following line to crontab file:

@reboot sudo python /home/pi/hw-home.py /home/pi/hw-home.txt