Tuesday, January 29, 2013

batch convert dv to avi xvid using ffmpeg

I am using Openindiana.

find bk/Video -type f -exec ~/mmpeg.sh {} \;

The mmpeg.sh script is based on sandipb script.
(Some variables may be unuseful).

https://github.com/alcir/mystuff/blob/master/mmpeg.sh

The converted files will go in /media/003-9VT166/converted/ directory using as name the full path starting from where find was launched.

So, the file
./bk/Video/2012_12/video01.dv
will become
/media/003-9VT166/converted/bk_Video_2012_12_video01.avi 

Please note: I had no time to handle spaces in file names.

dcm4chee query study availability

This query can be useful to list in a range of time the sudies wich availability is ONLINE (0= online, 1= nearline).

SELECT distinct(study.study_iuid)
FROM series
JOIN study ON series.study_fk = study.pk
JOIN patient ON study.patient_fk = patient.pk
JOIN instance ON instance.series_fk = series.pk
where study.study_datetime >= '2000-01-01' and study.study_datetime <= '2010-01-31'
and study.availability = 0 ;

Openindiana: install ffmpeg

pfexec pkg set-publisher -p http://pkg.openindiana.org/sfe
pfexec pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered
pfexec pkg install ffmpeg

links for today

X11 connection rejected because of wrong authentication after sudo to another user

http://jianmingli.com/wp/?p=724

Monday, January 28, 2013

Another sql query for dcm4chee

Find study instance uid for all the files stored before a date.

SELECT distinct(study.study_iuid)
FROM series
JOIN study ON series.study_fk = study.pk
JOIN patient ON study.patient_fk = patient.pk
JOIN instance ON instance.series_fk = series.pk
JOIN files on files.instance_fk = instance.pk
where files.created_time < '2012-12-15';

Tuesday, January 15, 2013

useful links for today

zone provisioning on admin interface seems to get stuck 
https://github.com/joyent/smartos-live/issues/158


Bad /etc/hosts entry when zone's IP is set to "dhcp"
 
zone-clone.markdown

smartos vmadm failed

Maybe this is only a workaround, like a good craftsman.

I was in this situation:

# vmadm list
UUID                   TYPE  RAM      STATE      ALIAS

76ffffff-cc23-4501...  OS    256      failed     db1

No way to boot or halt the zone.
(Cannot to start vm from state "failed", must be "stopped")
(login allowed only to running zones  ... is 'installed')


The only way to solve the issues, for me, was:

vi /etc/zones/76ffffff-cc23-4501-b5f3-41a69c65b321.xml

and search for a line containing "failed", then delete this line.


Friday, January 11, 2013

today useful links

Trying to chainload iPXE with full feature set from a lesser featured one, whilst still being able to boot non-supported cards with UNDI
https://gist.github.com/4008017


Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

https://gist.github.com/2234639

Monday, January 7, 2013

virtualbox pxe

It seems that Virtualbox uses different PXE "roms" depending on the installation of Extension pack or not.

i.e. without extension pack, it seems to use a limited version of iPXE, and maybe some image format are not handled (Exec format error, Could not boot image, etc.)

Friday, January 4, 2013

Centos Apache and Directory index forbidden

Today I struggled a little bit to make directory index module working.
I'm on Centos.

Installed apache (httpd) rpm.
No changes to configuration. Nothing.

I have created a conf file /etc/httpd/conf.d/my.conf

Alias /images "/var/www/images"

<Directory "/var/www/images">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


I have created the /var/www/images directory.
In this directory I don't want to put any html page. I want to use the Apache autoindex module to serve a list of files contained in this directory.

WTF autoindex not working...

And in the logs /var/log/httpd/error_log you can read

[Thu Jan 03 03:44:05 2013] [error] [client 192.168.56.1] Directory index forbidden by Options directive: /var/www/images/


The problem was that in /etc/httpd/conf.d/welcome.conf there was

Options -Indexes

So:
- you can delete such file
- you can change in +Indexes

linux: printing pdf in booklet format

I have a 44 pages PDF. I like trees. I want to save money.

So I want to print a booklet (page 1 and 44 on paper 1 side A, page 2 and 43 on paper 1 side B, etc.) from Ubuntu. I can't find the right way to accomplish this from Document Viewer (Evince?).

sudo apt-get install psutils

pdftops -nocrop -paper A4 -expand origin.pdf test.ps

psbook test.ps test-book.ps

psnup -2 test-book.ps test-book2.ps

We use the last command to put 2-pages together.
Note:  /etc/papersize is consulted, so it is better to set a different page size, using psnup -pa4


References:
https://sites.google.com/site/ocastillofelisola/Home/linux-stuff/convertingpsfilesintobooklets
http://ubuntuforums.org/archive/index.php/t-1210934.html