Since minidlna doesn’t serve external subtitle files properly, merge the .srt and .avi files into an mkv file as follows:
mkvmerge -v -o movie.mkv movie.avi --sub-charset 0:UTF8 -s 0 -D -A movie.srt
A more general purpose script:
#!/bin/bash
INPUT=$(basename $1 .avi)
SRT=$(ls | grep $INPUT.srt)
SUB=$(ls | grep $INPUT.sub)
SSA=$(ls | grep $INPUT.ssa)
if [ "$SRT" != "" ]; then
# mkvmerge -v -o $INPUT.mkv $1 $INPUT.srt
mkvmerge -v -o $INPUT.mkv $1 --sub-charset 0:UTF8 -s 0 -D -A $INPUT.srt
# mkvmerge -v -o $INPUT.mkv $1 $INPUT.eng.srt --sub-charset 0:UTF8 -s 0 -D -A $INPUT.spa.srt
elif [ "$SUB" != "" ]; then
mkvmerge -v -o $INPUT.mkv $1 $INPUT.sub
elif [ "$SSA" != "" ]; then
mkvmerge -v -o $INPUT.mkv $1 $INPUT.ssa
else
mkvmerge -v -o $INPUT.mkv $1
fi
Unfortunately, this still doesn’t help for PS3, which doesn’t yet understand mkv.
Here’s a handy trick I didn’t know about for launching OCaml:
$ cat >> .ocamlinit
#use "topfind";;
#require "sdl";;
#require "sdlvideo";;
open Sdl
open Sdlvideo;;
open Str;;
.ocamlinit is sourced from the current directory, falling back to /home/user/.ocamlinit. you can explicitly override it via ocaml -init <filename>
Google did a data mining exercise to uncover what makes a good Google manager. and the 8 habits are:
Be a good coach
Empower your team, don’t micromanage
Express interest in team members’ success and personal wellbeing
Don’t be a sissy: Be productive and results-oriented
Be a good communicator and listen to your team
Help your employees with career development
Have a clear vision and strategy for the team
Have key technical skills so you can help the team
3 pitfalls:
Have trouble making a transition to the team
Lack a consistent approach to performance management and career development
Spend too little time managing and communicating
The SystemRescueCd has all sorts of useful tools to restore ailing Linux systems.
Check it out at: http://www.sysresccd.org
Categories: Uncategorized Tags: boot, centos, grub, grub2, linux, lvm, lvm2, raid, recover, redhat, rescue, restore, rhel, system, ubuntu
I recently replaced the RAID 1 drives in my CentOS 5 box and had to reinstall the grub MBR. As the drives are a couple of TB each, I thought I’d try GPT instead of the old MBR partitioning, since soon all drives will exceed MBR’s 2TB limit. Luckily GPT is baked into RH/CentOS kernels (unlike many others).
Restoring the MBR was trickier than I expected and I made a couple of mistakes along the way – wish I had found the following description sooner:
http://idolinux.blogspot.com/2009/07/reinstall-grub-bootloader-on-md0.html
In a nutshell run grub interactively and do the following:
# grub
grub> root (hd0,0)
root (hd0,0)
Filesystem type is ext2fs, partition type 0xfd
grub> setup (hd0)
setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/grub/stage2 /grub/grub.conf"... succeeded
Done.
grub> quit
# reboot
As I install most Linux/BSD software on Mac via Macports, I figured I’d forgo GODI and try to install OCaml the Macports way.
Everything went mostly smoothly except for ocamlnet which is installed as a dependency of batteries. By default, to avoid installing GPL software, Macports doesn’t build nethttpd and related modules. To work around this, perform the install as usual:
sudo port install caml-batteries
but this won’t install the httpd files. To the ocamlnet Portfile I had to add:
configure.args-append -with-nethttpd
after configure.pre_args. Also, for ocamlnet 2.2.9, I had to patch src/batCamomile.ml as follows:
replace:
-module CDC = CamomileLibrary.CamomileDefaultConfig
with:
+module CDC = CamomileLibraryDefault.Config
and:
-include CamomileLibrary.Main.Make(CamConfig)
with:
+include CamomileLibrary.Make(CamConfig)
then port uninstall batteries (and ocamlnet), then reinstall.
For an excellent walkthrough of LVM, check out this link on Stephen Foskett’s blog: http://blog.fosketts.net/guides/walkthrough-logical-volume-manager-linux/
From Phil Sung:
Another Ubuntu release, another set of X.org shakeups.
Some things in X changed in Lucid (xorg 1:7.5+5 and higher), breaking existing Thinkpad TrackPoint scrolling configurations that modify files in /etc/hal/fdi/policy (like those you may have seen in this previous post). You can use gpointing-device-settings to apply the same policy, but I found that even that stops working after a suspend/resume cycle.
Samson Yeung pointed out to me the following fix which can be applied on Ubuntu Lucid/10.04:
Create a new file /usr/lib/X11/xorg.conf.d/20-thinkpad.conf with the following contents:
Section “InputClass”
Identifier “Trackpoint Wheel Emulation”
MatchProduct “TrackPoint”
MatchDevicePath “/dev/input/event*”
Driver “evdev”
Option “EmulateWheel” “true”
Option “EmulateWheelButton” “2″
Option “Emulate3Buttons” “false”
Option “XAxisMapping” “6 7″
Option “YAxisMapping” “4 5″
EndSection
Then restart X.
The configuration above works for both Thinkpad laptops with TrackPoints and the Thinkpad TrackPoint keyboard.
Not sure why, but Ruby and the MySQL 5.1 client library don’t play well together.
Fortunately the the solution is simple: download an older MySQL client library from (libmySQL.dll) or (libmySQL.dll) and copy it to your Ruby\bin folder.
This worked for me with: Windows 7, MySQL 5.1.47, Ruby 1.9.1 and rubygems: sequel 3.13.0, mysql (2.8.1 x86-mingw32).
This from Xen wiki:
These messages are from a glibc that was built with negative GS register offsets. Xen can run with negative GS register references, but it must “trap and emulate” this condition, which is relatively resource intensive, and quite slow.
If you don’t have a patched glibc, see the no-tls-direct-seg-refs patch mentioned in XenSpecificGlibc.
Most newer distributions are shipped with a “-mno-tls-direct-seg-refs” compiled glibc, but it might not be enabled by default.
Some newer distributions like the RHEL5 Beta1/Beta2 require the ld.so.conf.d trick below to refer to the patched glibc.
Some slightly older distributions like Ubuntu Dapper can be fixed with a simple rebuild of glibc: (see UbuntuDapperHowTo).
echo ‘hwcap 0 nosegneg’ > /etc/ld.so.conf.d/libc6-xen.conf && ldconfig
Reference Link: http://lists.xensource.com/archives/html/xen-users/2006-11/msg00026.html and http://www.mail-archive.com/fedora-xen@redhat.com/msg00041.html