This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /opt/vc/bin/vcgencmd measure_temp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Backup SD card | |
| #Verify that sdb is your SD card or change it. | |
| sudo dd bs=4M if=/dev/sdb | gzip > ~/roomba_`date +%d%m%y`.gz | |
| #Wait until the prompt return. It really takes some time to write 32GB and compress it! | |
| #Restore SD card from image | |
| #Verify that sdb is your SD card or change it. | |
| gzip -dc ~/roomba_XXXXX.gz | sudo dd bs=4M of=/dev/sdb | |
| #Wait until the prompt return. It really takes some time to write 32GB and decompress it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Show saves connections | |
| nmcli c | |
| #Show available hotspots | |
| nmcli d wifi list | |
| #or | |
| sudo iwlist wlan0 scanning | |
| #Connect to saved connection | |
| nmcli c up CONNECTIONNAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Splits the PDF in single pages PDFs which are saved in a subfolder called extracted and the page name. | |
| # If the pages does already exist, it will increment the page number by one, until the filename is not occupied. | |
| #sudo apt-get install pdftk | |
| #chmod +x split_pdf.bash | |
| #./split_pdf.bash source.pdf | |
| PDFFILE=$1 | |
| echo "File: "$PDFFILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + Plugin SD card that contains the Raspbian OS into your computer | |
| + Find the partition that is called "boot" | |
| + Create a file there called ssh | |
| REMARK: Only works for raspbian! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import paho.mqtt.client as mqtt | |
| import RPi.GPIO as GPIO | |
| import time | |
| import signal | |
| TOPIC_1= "lab_switch" | |
| HOST="localhost" | |
| USER="openhab" | |
| class MQTTGPIO(): | |
| def __init__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Example: | |
| #get some info with: | |
| udevadm info -a -n /dev/ttyUSB0 | grep serial | |
| udevadm info -a -n /dev/ttyUSB0 | grep idProduct | |
| udevadm info -a -n /dev/ttyUSB0 | grep idVendor | |
| #or | |
| udevadm info -a -n /dev/ttyUSB0 | grep -E 'idVendor|idProduct|serial' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Replace OLD with the string you want to replace, and NEW with the string you want to insert | |
| find ./ -type f -exec sed -i -e 's/OLD:/NEW:/g' {} \; | |
| grep -rl 'OLD' . | xargs sed -i 's/OLD/NEW/g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Quickly create an android app for IoT : | |
| https://www.blynk.cc/ | |
| #ROS stack and library for roomba and create: | |
| https://github.com/AutonomyLab/create_autonomy | |
| https://github.com/AutonomyLab/libcreate/blob/master/include/create/types.h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This can be quite useful to run some process on the server, | |
| # as it will not listen to the hangup signal of the terminal | |
| # and will not terminate the process, if you close the terminal. | |
| # In addition all output is appended in the log file | |
| nohup /usr/bin/python3.4 /abspath/someFile.py 2>&1 | /usr/bin/tee -a /abspath/log.txt & |