Raspberry Pi with “Motion” and a “Raspberry Pi Camera Module”

Motion

To activate the Camera Module and be able to use it with Motion you need to probe it by entering this command line:

$ sudo modprobe bcm2835-v4l2

To start Motion as a Daemon (Service) you need to write:

$ sudo service motion start

To stop:

$ sudo service motion stop

To get the statis of the service:

$ sudo service motion status

How can you disabling the Raspberry Pi Camera Module Led?

Add:

disable_camera_led=1

in

sudo nano /boot/config.txt

 

Create your own HuBot on the free Openshift Servers and run on different platforms

Thx to this article I started using OpenShift for hosting my own bots. It’s a walk though that has some small pitfalls, but any suitable dev will overcome this with some debugging.

Running a Slack BOT

Source: https://github.com/slackapi/hubot-slack

Local

HUBOT_SLACK_TOKEN=<slack_app_token> HUBOT_LOG_LEVEL=debug ./bin/hubot -a slack -n 'botje'

Server (Package.json)

"start": "PORT=$OPENSHIFT_NODEJS_PORT BIND_ADDRESS=$OPENSHIFT_NODEJS_IP HEROKU_URL=$OPENSHIFT_APP_DNS REDIS_URL=redis://:$REDIS_PASSWORD@$OPENSHIFT_REDIS_HOST:$OPENSHIFT_REDIS_PORT HUBOT_SLACK_TOKEN=<slack_app_token> HUBOT_LOG_LEVEL=debug bin/hubot -n 'botje' -a slack"

Running a Facebook Messenger BOT

Source: https://github.com/ClaudeBot/hubot-messenger-bot

Local

MESSENGER_VERIFY_TOKEN=<verify_token> MESSENGER_ACCESS_TOKEN=<facebookaccesstoken> HUBOT_LOG_LEVEL="debug" ./bin/hubot --a messenger-bot

Server (Package.json)

"start": "PORT=$OPENSHIFT_NODEJS_PORT BIND_ADDRESS=$OPENSHIFT_NODEJS_IP HEROKU_URL=$OPENSHIFT_APP_DNS REDIS_URL=redis://:$REDIS_PASSWORD@$OPENSHIFT_REDIS_HOST:$OPENSHIFT_REDIS_PORT MESSENGER_VERIFY_TOKEN=<verify_token> MESSENGER_ACCESS_TOKEN=<facebookaccesstoken> HUBOT_LOG_LEVEL=debug bin/hubot -n '' -a messenger-bot"

Running an Skype BOT

Source: https://github.com/ClaudeBot/hubot-skype-bot

Local

MESSENGER_VERIFY_TOKEN=<verify_token> MESSENGER_ACCESS_TOKEN=<facebookaccesstoken> HUBOT_LOG_LEVEL="debug" ./bin/hubot --a messenger-bot

Server (Package.json)

"start": "PORT=$OPENSHIFT_NODEJS_PORT BIND_ADDRESS=$OPENSHIFT_NODEJS_IP HEROKU_URL=$OPENSHIFT_APP_DNS REDIS_URL=redis://:$REDIS_PASSWORD@$OPENSHIFT_REDIS_HOST:$OPENSHIFT_REDIS_PORT SKYPE_BOT_ID=<skype_bot_id> MICROSOFT_APP_ID=<microsoft_app_id> MICROSOFT_APP_SECRET=<microsoft_app_secret> HUBOT_LOG_LEVEL=debug bin/hubot -a skype-bot"

 

SSH to your Raspberry Pi

Login to your Raspberry Pi with the default user/pass:

user: pi
pass: raspberry

Run the following in the terminal:

$ sudo raspi-config

Navigate to ssh, press Enter

Select Enable or Disable SSH server.

Run:

$ sudo reboot

After the Raspberry Pi is restarted check your ip-address with:

$ ifconfig

Write or note down the ip address!

It is also good to change password, so nobody else can get in. Do this by running:

$ sudo -i
$ passwd pi

And remember the password so you won’t forget :)

Then when you want to SSH to your Raspberry Pi from another computer, just enter:

ssh pi@<THE IP ADDRESS YOU GOT WITH IFCONFIG ON YOUR PI>

 

Get rid of new mail message in linux unix terminal

I had a message that was returning every time I was using Terminal on my local machine. It says that I had unread mail in /var/mail/$USER. But how can you read this mail and how can you get rid of this?

It’s mail that has been send by for example a local install of WordPress or it’s a cronjob which sends reports on cron-jobs which you ran locally. You can of course see if you can disable the mailings. But you also want to read the mails first (what they are about) and get rid of this message that keeps appearing when starting terminal/CLI (so you need to get rid of the emails).

First reading the messages can be done by running:

$ cat /var/mail/$user

Then removing the mail can be done by following the following commands:

$ mail
> d *
> quit

 

[dutch] Notificaties voor nieuw Funda.nl aanbod

In navolging van mijn post over het krijgen van notificaties over nieuw aanbod op een specifieke zoekopdracht op Marktplaats.nl, wilde ik hetzelfde bereiken met nieuw aanbod op Funda.nl. Nou bied Funda.nl dat zelf al aan via een e-mail notificatie, welke je kan instellen op een specifieke zoekopdracht. Alleen kan je deze maar 1x instellen als 1 zoekopdracht. Maar misschien heb je andere wensen per regio, stad of dorp. Of misschien wil  je een notificatie ontvangen op een ander kanaal dan via email. Hoe pak je dat dan aan? Continue reading

Add YouTube titles to Google sheets through Apps Script

I wanted to get a list of all the videos uploaded on YouTube by a specific user. A nice feature of Google Docs (Spreadsheet) is the abbility to add and run apps scripts to get data based from an external source like YouTube. So I changed a already existing script (http://ctrlq.org/code/19561-youtube-google-apps-script) and it works perfectly for me. Open a new Google Spreadsheet. The click “Tools > Script editor…” and copy past the code below. The you can run the script from within the “Script editor”. You probably need to authorise using YouTube within Google Spreadsheet. Continue reading

Fixing the locale error on Debian Wheezy

When you get errors with running commands on your Raspberry Pi like “warning: Setting locale failed.” you can fix this by updating the locale file in the OS. You can do this by typing:

pi@raspberrypi ~ $sudo nano /etc/default/locale

on your Raspberry Pi command line or in your Terminal window from your Mac when connected to the Raspberry Pi.

Next you have to change the following lines within the editor that just opened: Continue reading

Access files on your Raspberry Pi from your Mac

To access the files on your Raspberry Pi on your Mac Finder you can install the appletalk protocol on the Pi by typing the following commands on the Raspberry Pi.

pi@raspberrypi ~ $sudo apt-get install netatalk

This lets you use the following (in the terminal on your Mac) to connect to the Pi

yourmac:~ username$ open afp:/10.1.1.10

Now you will see the Raspberry Pi appearing in your Mac Network where you will need to login on (default user/pass), to see access the files and folders.

Next up is http://www.derkbraakman.com/fixing-locale-error-debian-wheezy/

Connecting with a remote desktop (VNC, Debian Wheezy)

You don’t need to connect to a external monitor when the Raspberry Pi is connected to a network. You can use Virtual Network Computing by installing tightvnc on your Raspberry Pi and using the pre installed “screen sharing” on your Mac.

First you need to install tightvnc on your Pi:

pi@raspberrypi ~ $sudo apt-get install tightvncserver

and run it

pi@raspberrypi ~ $tightvncserver

If you have a Mac you need to go to the “Finder” and select “Go > Connect to Server…” or use the Shortcut “CMD + K”

Continue reading