Skip to main content

Posts

Arduino without arduino IDE

It has been a long time since my last post about hardware or embedded software... This one is just about a link to: A Brief Tutorial on Programming the ATMega (Arduino) without Arduino Software http://brittonkerin.com/cduino/lessons.html The part which had call my attention most was the lesson 11, on persistent storage using the EEPROM. There are much more, it worth a careful the reading.

Adding multiple files to CVS

Since the beginning, this blog was meant more as short mental notes for future retrieval. So, here comes another one: I am a long term CVS users. I have lots of old projects which still being maintained with CVS for version control, backup and central repository. Most of these projects must be updated and/or must have new features added to them, some times I have to add lots of files to the repository, and doing this from the command line would be very painful if there were not powerful command line tools such as "find", "grep", "cut" and "xargs". First, I have to add everything which is not a CVS control folder to the repository: find . -not -name CVS -not -name Root -not -name Entries -not -name Repository -exec cvs add {} \; Second, the remaning files from the projects root folder must be added to. Issuing a "cvs update", the appear with a question mark (?), but cvs echos a lot more info to the stderr. We can cut that off, re...

Resizing images and generating animated gifs

After writing my last posts (P lotting memory usage on console and More trickery with gnuplot dumb terminal ), I had to put here some lines used to make the screenshot I'd put there. To resize all screen shot frames: ls -1 *.png | cut -d . -f 1 | while read line ; do convert $line.png -resize 60% $line.mini.png; done In stead of resizing the image, they can be cropped: ls -1 *.png | cut -d . -f 1 | while read line ; do convert $line.png -crop 400x270+92+37 $line.mini.png; done To make the animated gif convert -delay 100 -loop 0 screenshot0*mini.png screenshot.gif

More trickery with gnuplot dumb terminal

In my post " Plotting memory usage on console " the chart doesn't pan the data. Now, using a named pipe, the effect got a little bit nicer. First, we have to run the memUsage.sh script to get a file filled with memory usage info: ./memUsage.sh > memUsage.dat & Then we have to create a named pipe: mkfifo pipe Now we have to run another process to tail only the last 64 lines from the memUsage.dat while [ 1 ]; do tail -64 memUsage.dat> pipe; done & And now we just have to plot the data from the pipe: watch -n 1 'gnuplot -e "set terminal dumb;p \"pipe\" with lines"' And that is it!

Plotting memory usage on console

This is just a simple hack to play around with gnuplot set to dumb terminal (character console), doesn't meant to be serious application. First I had written a bash scritp to log memory usage a while ago: So, while running this script in background ( ./memUsage.sh > memUsage.dat & ), logging the data, the memory usage information can be plotted with gnuplot and watched in real time: watch -n 1 'gnuplot -e "set terminal dumb;p \"memUsage.dat\" with impulses"' The chart can be plotted with lines, with impulses or any gnuplot style option .

ftdi232 permission on Ubuntu

I'am using the ftdi chip with bitbang mode to control some hardware with linux. Every time I copy my software to a new desktop, it always take me hours to figure out why it has no permission to run the bitbang mode as a regular user. Every website or forum I look around tells me about the udev, but I check back on the working desktops and there is no udev rule for the ftdi hardware. And after trying to force permissions with chgrp and chmod directly on /dev/bus/usb/* I figured out that I had to master at least a little about udev rules. Checking with a little more care at a working machine I´ve found a Virtualbox instalation which created a udev rule for the virtualbox usb driver. Changing that rule to be used with the FTI chip I do the following steps, with had worked perfeclty: Create the file /etc/udev/rules.d/10-ftdi.rules Write on it: SUBSYSTEM=="usb_device", GROUP="dialout", MODE="0664" SUBSYSTEM=="usb", ENV{DEVTYPE}=="u...

powerpoint slides to jpeg

Looking for some way to convert power point slides to JPG, I've found this site: http://www.commandlinefu.com/commands/browse It has tons of good linux command line tips. And here is the tip about the pdf to jpg which brought me there: http://www.commandlinefu.com/commands/view/719/convert-pdf-to-jpg And to convert the powerpoint to pdf before, one can issue the unoconv command: unoconv -f pdf slides.ppt