Category Archives: linux

get IPs only from arp -a with #vim

arp -a

? (192.168.1.111) at 50:b7:c3:xx:xx:xx [ether] on eth0
? (192.168.1.1) at c8:d7:19:xx:xx:xx [ether] on eth0
? (192.168.1.116) at  on eth0
? (192.168.1.106) at 70:9e:29:xx:xx:xx [ether] on eth0
? (192.168.1.28) at 9c:b6:54:xx:xx:xx [ether] on eth0
? (192.168.1.119) at 70:9e:29:xx:xx:xx [ether] on eth0
? (192.168.1.101) at 50:b7:c3:xx:xx:xx [ether] on eth0
? (192.168.1.4) at b8:27:eb:xx:xx:xx [ether] on eth0
? (192.168.1.105) at 20:e5:2a:xx:xx:xx [ether] on eth0
? (192.168.1.31) at  on eth0
? (192.168.1.26) at 20:4e:7f:xx:xx:xx [ether] on eth0
? (192.168.1.104) at 34:36:3b:xx:xx:xx [ether] on eth0
? (192.168.1.103) at 00:90:f5:xx:xx:xx [ether] on eth0
? (192.168.1.108) at e4:e0:c5:xx:xx:xx [ether] on eth0
? (192.168.1.107) at 6c:ad:f8:xx:xx:xx [ether] on eth0
? (192.168.1.112) at b0:79:94:xx:xx:xx [ether] on eth0
? (192.168.1.102) at 6c:ad:f8:xx:xx:xx [ether] on eth0

with vim:
:%s/.*(\(.*\)).*/\1/g

192.168.1.111
192.168.1.1
192.168.1.116
192.168.1.106
192.168.1.28
192.168.1.119
192.168.1.101
192.168.1.4
192.168.1.105
192.168.1.31
192.168.1.26
192.168.1.104
192.168.1.103
192.168.1.108
192.168.1.107
192.168.1.112
192.168.1.102

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 (https://apps.twitter.com/) and a little bit of python.

installing #salt-minion on a #raspberrypi


vim /etc/apt/sources.list

add this repository:

deb http://debian.saltstack.com/debian wheezy-saltstack main


wget -O - http://debian.saltstack.com/debian-salt-team-joehealy.gpg.key|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

update:
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

update:
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