Category Archives: linux

automating #Twitter with #raspberrypi

I’ve been tweeting pictures and re-tweeting twits automatically for a few years now using two python tools.

  1. Twython
  2. on github
    Here’s an example script for Twython

  3. TwitterFollowBot
  4. on github
    Here’s an example script for TwitterFollowBot

Both require to have an already created Twitter app ( and a little bit of python.

installing #salt-minion on a #raspberrypi

vim /etc/apt/sources.list

add this repository:

deb wheezy-saltstack main

wget -O -|apt-key add -
apt-get update
apt-cache policy salt-minion
apt-get install salt-minion

et voilà!

grayscale #pylepton images to fake colors | #infrafred #thermography #imagemagick – #FLIR #Lepton

images come from the Flir Dev Kit bought from Coolcomponents.

First, in order to map the grayscale to colors, we need to generate a gradient.
This is how I did it, using ImageMagick.

convert xc:black xc:red xc:yellow xc:green1 xc:cyan xc:blue xc:white +append -filter Cubic -rotate 90 -resize 20x80\! gradient_IR_rainbow.jpg

this new gradient works like a charm

convert xc:white xc:yellow xc:red xc:green xc:cyan xc:blue xc:violet xc:black +append -filter Cubic -rotate 90 -resize 20x80\! gradient_IR_4-rainbow.jpg

Once you have the canvas gradient, you can use apply it to each image.

convert -verbose bike.png \( gradient_IR_rainbow.jpg -flip \) -clut -resize 500% fc_bike.png

Here are some of the images:

bikes1   fc_bikes1



bikes2  fc_bikes2



laptop-back1  fc_laptop-back1



laptop-front1  fc_laptop-front1



neighbor-house  fc_neighbor-house




install new #crontab from #bash script

you need to:

  1. save the current cron jobs for the user
  2. create a file with the new job description (pun intended)
  3. insert the new configuration
  4. check the new conf

crontab -l > /tmp/current_cron
or, even better. append directly to your cron conf
crontab -l >> cronconf.txt

the file should look like
cat cronconf.txt
*/1 * * * * /bin/ls >> /tmp/ls
*/1 * * * * /bin/touch /tmp/me

Insert the new conf by calling crontab
crontab cronconf.txt

check the new conf with
crontab -l