Samstag, 3. Mai 2014

speed up mp4/mp3 with ffmpeg


you may need to download latest ffmpeg
if there are issues with ffmpeg filter options.

szenario: You're having some training videos (mp4) and want to listen to them faster.

Option #1: mp4 to mp3, and speedup (in one step):

create mp3 from mp4 and change the tempo while doing this.
ffmpeg -i input.mp4  -filter:a "atempo=1.8" output.mp3 

Option #2: speedup video (no mp3 conversion):

create mp4 and double the tempo
ffmpeg -i input.mp4 -filter_complex "[0:v]setpts=0.5*PTS[v];[0:a]atempo=2.0[a]" -map "[v]" -map "[a]" output.mp4

For more information, visit: https://trac.ffmpeg.org/wiki

Sonntag, 16. März 2014

convert pdf

note: you need to install imagemagick and ghostscript first

convert multiple png to one pdf


convert page1.png page2.png output.pdf
or simply
convert page*.png output.pdf 

src: http://stackoverflow.com/a/8955465

hint: 
lets say you'd like your oldest file (page01.png) to be the last page in output.pdf.
you can reverse the order of files:
convert page* -reverse output.pdf

reduce filesize of pdf


...via ghostscript

gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -sOutputFile=output.pdf input.pdf

src: http://www.virtualzone.de/2012/11/how-to-reduce-pdf-file-size-in-linux.html


fyi: you can change /screen to /printer for better quality

join multiple pdf files into one file


 ...via ghostscript

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...

...via pdftk

pdftk file1.pdf file2.pdf cat output -

...via pdfsam

pdfsam-console -f 1.pdf -f 2.pdf -o ./output.pdf concat

reverse page order

pdftk in.pdf cat end-1 output out.pdf

Dienstag, 8. Oktober 2013

run tmux automatically in full-screen gnome-terminal

vim ~/bin/terminal
#!/bin/sh 
exec gnome-terminal --window --full-screen -e tmux
 chmod +x ~/bin/terminal

voila!

Montag, 8. April 2013

debian + vmware numpad not working

System -> Einstellungen -> Tastatur:
  Maustasten: "Mauszeiger per Tastatur steuern (muss deaktiviert sein!)

Donnerstag, 15. November 2012

Install nmap 6.0.1 on Debian


apt-get install build-essential checkinstall

wget http://nmap.org/dist/nmap-6.01.tar.bz2

bzip2 -cd nmap-6.01.tar.bz2 | tar xvf -

cd nmap-6.01

./configure

make

checkinstall

dpkg -i nmap_6.01-1_i386.deb

Donnerstag, 18. Oktober 2012

VirtualBox: Debian Linux display resolution 1920x1080


$ gtf 1920 1080 60

# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync

$ xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync

$ xrandr --addmode VBOX0 "1920x1080_60.00"

Then open Display settings and select the previously added mode!



-----

permanent:

~/.xprofile:


xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
 xrandr --addmode VBOX0 "1920x1080_60.00"
 xrandr --output VBOX0 "1920x1080_60.00"


-------

on lubuntu:

xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
 xrandr --addmode Virtual1 "1920x1080_60.00"


xrandr --output Virtual1 --mode "1920x1080_60.00"

but had to install packages "xfonts xfonts-100dpi xfonts-75dpi xfonts-scaleable" first


Sonntag, 20. Mai 2012

list users

awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd