Contents
Videographical Spells
Extract 40 seconds starting at 4:40 from biglongmovie.avi into clip.avi - recoding as xvid.
- ffmpeg -ss 00:04:40 -t 40 -i biglongmovie.avi -sameq -isync -acodec copy -vcodec libxvid -vsync 0 clip.avi
On a mac, take a divx and convert to something iMovie likes
- /Applications/ffmpegX.app/Contents/Resources/ffmpeg -i dixmovie.avi -sameq -vsync 0 happyimovie.mov
Convert divx to DVD style MPEG
- mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:aspect=16/9:acodec=ac3:abitrate=192 -ofps 25 -o dvd.mpg mymovie.avi
Create a DVD image from an MPG
-
dvdauthor -o dvdimage -x dvd.xml
Example xml files:
Burn a DVD image in Linux/un*x
- chmod 500 AUDIO_TS VIDEO_TS; chmod 400 VIDEO_TS/*; growisofs -dvd-compat -Z /dev/scd0 -dvd-video .
Transcode a movie to a Roku-friendly MP4
- ffmpeg -i my_divx_or_xvid_or_whatever.avi -vcodec libx264 -acodec libfaac -ac 2 -ar 44100 -ab 128k -b 1000k -vpre medium my_divx_or_xvid_or_whatever.mp4
Extract an MPEG2 from a DVD image quickly
- mencoder dvd://1 -ovc copy -oac copy -of mpeg -o first-title-show.mpg
Perls of wisdom
Search and replace a regular expression in a bunch of files, keeping backups
- perl -pi.bak -e 's/oldthing/newthing/g' *
Discworlde
Making Hybrid CDs/DVDs on a mac
This will build an ISO image that will appear as a Windows CD on Windows machines and a Mac CD on Macs. We assume the current directory contains all the files you want to burn. In this case the Windows autorun files are hidden from the Mac and the "Mac" folder is hidden from Windows.
- hdiutil makehybrid -iso -hfs -joliet -hide-hfs '{autorun.inf,file.html,shellexe.exe}' -hfs-openfolder . -hide-joliet Mac -o ../NewDiskImage.iso .
Debianicals
SysV service maintenance
- update-rc.d -f SERVICENAME remove
- update-rc.d SERVICENAME start 20 2 3 4 5 . stop 80 0 1 6 .
- update-rc.d SERVICENAME defaults
Add missing key to APT to fix apt-get update
- gpg --keyserver wwwkeys.eu.pgp.net --recv-keys XXXXXXXXXXXXXXXX
- apt-key add /root/.gnupg/pubring.gpg
- apt-get update
Spells of the 6th order
Add an address to an interface
- ip a a fe80:ab7f:16d2:1::1 dev eth0
Add a /64 subnet to an interface
-
ip r a fe80:ab7f:16d2:1::/64 dev eth0
This is useful if you've been given a /48 from your ISP. In this (fictional) case, the block was fe80:ab7f:16d2::/48
<< Back
