Tailing the output of multiple files in Linux
This is a quick post to show a trick to tail multiple files, while showing the filename in the beginning of the line
What I needed was a way to grep multiple logs for an exception. But doing "tail -f *.log | grep exception" only let me see the exception, but I didn't know which log file to look in
I have found this guide, and altered the script and added
- Printing the file name in the beginning of each line
- Padding spaces after the file name (you can alter the minimal length in the ALIGN variable
Anyway - here's the script. Hope you find it useful
#!/bin/bash
# When this exits, exit all back ground process also.
trap 'kill $(jobs -p)' EXIT
ALIGN=31
# iterate through the each given file names,
for file in "$@"
do
LENGTH=`echo ${file} | wc -c`
PADDING=`expr ${ALIGN} - ${LENGTH}`
PAD=`perl -e "print ' ' x $PADDING;"`
# show tails of each in background.
tail -f $file | sed "s/^/${file}${PAD}:/g" &
done
# wait .. until CTRL+C
wait
C++ library for the C329 SPI camera module [w/ code]
Just putting it out there for whoever is trying to use the C329 camera module of the SPI variety (the URAT module has code posted online)
Read the rest of this entry »
Simplified FFMPEG video writer (also for OpenFramework) [w/ code]
I want to share a little snippet in case anyone is interested in writing video files from cpp context using FFMPEG, I've made it for usage with OpenFrameworks.
It's basically a simple wrapper around the encoding mechanism of FFMPEG, so you can easily just say which file to write to and start dumping images into it. It will take care of choosing the codec, writing headers and trailers, encode (compress) the frames and write them to the file.
Read the rest of this entry »
Curve tracking with a Heap&Hogg's Particle Filters [w/ code, OpenCV]
I wanna share some code for 2D curve tracking with a particle filter, implementing the body of work of Tony Heap and David Hogg. These guys presented a relatively easy to implement method for tracking deformable curves through space and change in form using a Hierarchical Point Distribution Models (HPDM), which is another elegant way to store shape priors. Granted, it is not perfect, but for a simple 2D shape like a hand it works pretty good, and rather fast as well.
Let's dive in then,
Read the rest of this entry »
Skin Detection with Probability Maps and Elliptical Boundaries [OpenCV, w/code]
Sharing a bit of code I created for skin detection.
Read the rest of this entry »
A Creative way to bypass Pattern lock on Android
Let me start putting everything on the table – this post will describe how I eventually managed to unlock an unrooted, non-Google account linked Samsung Galaxy Mini Plus (GT-5570I) device without ADB support. There are a lot of guides on how to bypass this pattern lock on Android (and I will provide some links), but the purpose of this post is to show how looking for creative ways to do this can come handy
So a friend gave me a locked device. This device had no Google account linked to it (which prevented me from bypassing the lock with that account), there was no root or ADB access via recovery, and the USB debugging option was disabled.
I found this guide here, which states some commands you can type in ADB shell and should deactivate the pattern lock. So – How do I get ADB access on that phone? Read the rest of this entry »
Using your Raspberry Pi as an SSL Proxy
Not long ago, I have purchased an IP camera for my home. A nice toy I must say. I wanted to expose this camera for outside access. The issue is that this camera's interface does not support SSL.
Well because privacy is involved, the least I could do is add SSL somehow. I googled a bit and came across this article. I decided to use my raspberry pi for that.
The process itself is relatively easy but I had to do some improvisations over the article above. So I decided to make a tutorial for this.
You can use this to add SSL layer on top of every http you have.
So here we go: Read the rest of this entry »
Shape manipulation with Moving Least Squares for curves [w/ code]
Hello,
I wanna share some code I've been working on lately that implements smooth shape manipulation using Moving Least Squares. More specifically, the excellent simple and powerful method by Schaefer et al. from Texas A&M and Rice universities (great paper). The method was written for image deformation but very straightforward modifications made it work perfectly for 2D shapes and open curves.
Let's get down to business
Read the rest of this entry »
2D curve matching in OpenCV [w/ code]

Just sharing some code and ideas for matching 2D curves. I was working for a while on matching 2D curves to discover shapes in images, but it didn't work out, what did succeed is this 2D curve matcher that seems to be very robust for certain applications. It's based on ideas from the Heat Kernel Signature and the CSS Image (that I introduced in my latest post), all around inspecting curves under different level of smoothing.
Read the rest of this entry »
Resampling, Smoothing and Interest points of curves (via CSS) in OpenCV [w/ code]

I'm so glad to be back to work on a graphics project (of which you will probably hear later), because it takes me back to reading papers and implementing work by talented people. I want share a little bit of utilities I've developed for working with 2D curves in OpenCV.