ffmpeg and h.264 in Debian Lenny

June 10th, 2010

Ever tried to transcode into H.264 using ffmpeg in Debian Lenny just to end up with this message

Unknown encoder ‘libx264′

Here is how you solve the problem:

  1. Download the debian-multimedia-keyring package
  2. Install it dpkg -i debian-multimedia-keyring_2008.10.16_all.deb
  3. Add the Debian Multimedia repository to your sources.list
  4. Run apt-get update and apt-get upgrade
  5. Install the libx264 and ffmpeg packages; apt-get install libx264 ffmpeg or apt-get --reinstall install libx264 ffmpeg

Good luck!

JavaScript Date Format in Swedish

March 10th, 2010

Found myself “late-night-surfing” again, but this time I actually found something interesting. Steven Levithan has written an easy-to-use and easy-to-extend JavaScript date format function. So, to encourage his great work I publish the Swedish translation.

// Internationalization strings
dateFormat.i18n = {
dayNames: [
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör",
"Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"
],
monthNames: [
"Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec",
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
]
};

The complete code at its latest version can be found at Stevens blog, JavaScript Date Format.

Configure pure-ftpd in Debian

January 27th, 2010

Currently there is a lack of good documentation about how to configure pure-ftpd in Debian and Ubuntu. It’s easy to find information about the command-line flags for pure-ftpd but in Debian you are supposed to use files in the /etc/pure-ftpd/conf directory. Information about what filenames to use and what they should contain is hard to find, so here is a list that translates the command-line flag to filenames.

Not all files requires a contents, it’s sufficient if you just “touch” it. See the pure-ftpd documentation for details about the flag values.

Flag Filename Value
-W AllowAnonymousFXP
-z AllowDotFiles
-w AllowUserFXP
-O %s AltLog string
-t %s AnonymousBandwidth range
-M AnonymousCanCreateDirs
-i AnonymousCantUpload
-e AnonymousOnly
-q %d:%d AnonymousRatio range
-s AntiWarez
-r AutoRename
-S %s Bind string
-b BrokenClientsCompatibility
-o CallUploadScript
-A ChrootEveryone
-j CreateHomeDir
-Z CustomerProof
-B Daemonize
-D DisplayDotFiles
-H DontResolve
-P %s ForcePassiveIP IP-number
-F %s FortunesFile string
-4 IPV4Only
-6 IPV6Only
-K KeepAllFiles
-L %d:%d LimitRecursion range
-1 LogPID
-c %d MaxClientsNumber
-C %d MaxClientsPerIP integer
-k %d MaxDiskUsage integer
-I %d MaxIdleTime integer
-m %d MaxLoad integer
-u %d MinUID integer
-N NATmode
-E NoAnonymous
-R NoChmod
-G NoRename
-0 NoTruncate
-p %d:%d PassivePortRange range
-y %d:%d PerUserLimits range
-X ProhibitDotFilesRead
-x ProhibitDotFilesWrite
-n %d:%d Quota range
-f %s SyslogFacility string
-Y %d TLS integer
-a %d TrustedGID integer
-V %s TrustedIP IP-number
-U %s:%s Umask file:dir
-T %s UserBandwidth range
-Q %d:%d UserRatio range
-d VerboseLog

There is a bugreport for this problem so hopefully it will be fixed in the future.