Skip to main content

Posts

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

Books

Tonight I was home alone with my kid. Fortunately for us (the kid and me) our PC is connected to the TV set. So, he watched his favorites DVDs, while I had Google Reader in play mode with slide show enabled and side by side windows. After playing the DVDs a dozen times, Google Reader showed this e-book post . PostgreSQL is my database of choice, so this book will be very appreciated. The PostgreSQL e-book is at: http://www.commandprompt.com/ppbook/

Mac OS X in Linux via VirtualBox (as guest OS)

That is some thing I want to do for quite some time: Install Mac OS X Snow Leopard as a guest OS in a VirtualBox Linux host http://martinml.com/en/how-to-install-mac-os-x-snow-leopard-in-virtualbox/ http://blog.nguyenvq.com/2010/12/04/mac-os-x-in-linux-via-virtualbox-as-guest-os/ http://myhack.sojugarden.com/guide/