How might I pass text data from the ruby console into my clipboard without saving to a file?

You can just echo it instead if there are no newline characters in the string; otherwise, use the IO class. Using echo: system “echo #{stringdata} | pbcopy” OR `echo #{stringdata} | pbcopy` Ruby will then just rip the text from memory, inject it into the shell command which opens a pipe between the echo and … Read more

Rename JPG files according to date created

jhead -n DSCN0382.JPG DSCN0382.JPG –> 0408-150734.jpg any strftime argument can be given as well: jhead -n%Y%m%d-%H%M%S *.jpg This will rename files matched by *.jpg in the format YYYYMMDD-HHMMSS jhead -n%Y%m%d-%H%M%S DSCN0382.JPG DSCN0382.JPG –> 20120408-150734.jpg see also the man page for lots of other cool options. You can for instance correct (shift) the EXIF date. This … Read more

Which systems define EAGAIN and EWOULDBLOCK as different values?

There were some… http://www.gnu.org/s/hello/manual/libc/Error-Codes.html Portability Note: In many older Unix systems, this condition was indicated by EWOULDBLOCK, which was a distinct error code different from EAGAIN. To make your program portable, you should check for both codes and treat them the same. http://lists.parisc-linux.org/hypermail/parisc-linux/9895.html On some SysV systems EAGAIN != EWOULDBLOCK. I think we inherited the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)