UN*X Note

some geek's notes. Stored here for some reason or another...

Encrypted swap on-the-fly:

cryptsetup -d /dev/random create uswap /dev/sdd1 mkswap /dev/mapper/uswap

Warning! Unexpexted disconnect of USB-storage device will result in a forced reboot!

H264 Encoding for Android (MPEG4 Simple Profile)

 mencoder.exe sourcevideo.mp4 -o finalvideo.mp4 -oac mp3lame -lameopts cbr:br=128 -channels 2 -srate 44100 -ofps 30 -of lavf -ovc x264 -x264encopts \ cabac:bitrate=1200:subq=6:8x8dct:frameref=8:partitions=all:me=umh:threads=auto:global_header:bframes=3:b_pyramid:weight_b:pass=2 -lavfopts \ format=mp4 -vf harddup,scale=720:405 && \ avconv -i infile.avi -vcodec libx264 -b 1200k -mbd 2 -coder 1 -cmp 2 -subcmp 2 -r 25 -f psp -flags loop -trellis 2 \  -acodec aac -strict experimental -ab 128k -ac 2 -ar 44100 -y -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 outfile.mp4 

was not working out too good.

next attempt - 2-pass-encoding with mencoder and GPAC - Pass 1

mencoder -o infile.avi -srate 44100 -passlogfile DB-848x480-3.avi.two-pass-log -oac mp3lame -lameopts vbr=0:br=192 -af volnorm=1 \ -ofps 25.000 -vf-add crop=800:480 -vf-add scale=400:240 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=768:aspect=400/240:turbo:vpass=1 \ -ffourcc FMP4 -force-avi-aspect 1.66666666666667 outfile.avi 

pass 2:

mencoder -o infile.avi -srate 44100 -passlogfile DB-848x480-3.avi.two-pass-log -oac mp3lame -lameopts vbr=0:br=192 -af volnorm=1 -ofps 25.000 -vf-add crop=800:480 -vf-add scale=400:240 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=768:aspect=400/240:vhq:vpass=2  -ffourcc FMP4 -force-avi-aspect 1.66666666666667  outfile.avi 

remux using GPAC:

  MP4Box -add outfile.avi outfile.mp4

...success!

(thx to tablet-encode - original output did not completely do the job for me, but brought me on the way)

Rename files

named like "deliver?numer=R 0000123456&date= 20120822&type=pdf" (typical output from wget) to something useful like RE20120822.pdf for FN in $(ls deliver*pdf); do     cp $FN $(echo $FN|sed -e s/deliver.number=R[0-9]*\&date=/RE/ -e s/\&type=/\./) done

 Android, Postfix + TLS

/etc/postfix/master.cf

: smtps inet n - n - - smtpd -o smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes
So, you've got a bundle of JPG-scans to

join to a single, multipaged PDF

and no fancy graphic app to do it within considerable time? pdfjoin -o all_of_it_in_a_multipage.pdf  *.jpg

Notice: You need to have "pdfjam" installed for that to work