Archive for May, 2007

Mplayer With Arabic Subtitles FIX

May 24th, 2007

Well, this is my first contribution to “HackRoot” The CAT Distro – Based on Fedora.
There is a very common problem regarding arabic subtitles in Linux video players, I’ve googled and found some old patches with ugly ideas (it was best at their time, because fribidi didn’t support arabic shaping), but now after fribidi2 (beta) which has a almost-finished arabic shaping support I thought I could hack Mplayer and fribidi2 and get things to work together for the complete Linux beginner.Mplayer With Arabic Subtitles

I’ve compiled fribidi2 and hacked it’s configuration alittle and prepared a RPM as there is no RPMS for fribidi2 (because it’s still beta).

I Also hacked the Mplayer to work with my new fribidi2 RPM and to use the arabic shaping capabilities, and here is how you can get arabic subtitles working in Linux:Mplayer With Arabic Subtitles

- You’ll have to remove mplayer if you already have it installed

rpm -e mplayer mplayer-gui

- Download Mplayer RPMs and Fribidi rpms into a new empty directory, aka. /opt/mplayer
- Install all the packages, use force if neccessary (libfribidi may have some conflicts, don’t worry about using force with it)
- Make sure that you have fonts-arabic already installed, if not, Install them via yum.
- Now you need to convert the subtitles for your movie into UTF-8 encoding before playing, let’s see how can you do this

#assume the .sub or srt file is named movie.sub

$ mv movie.sub movie.sub.old

$ iconv -f windows-1256 -t utf8 movie.sub.old > movie.sub

# rm movie.sub.old

OR:

you can download convert_sub script and chmod +x convert_sub.sh and just pass the subtitles file to it and it’ll do the conversion.

then you are ready to play :)

Basically you’ll need to install mplayer, mplayer-gui and fribidi0 RPMS and you’ll have everything setuped. you can download the tree rpms in an empty directory and install them as follows *Please make sure that you have Livna Repo. setuped*

# cd /opt/empty_directory
# yum localinstall *

while /opt/empty_directory is an example for an empty directory you copied the RPMS into.

please don’t hesitate to tell me any comments or problems..

Download RPMS:

mplayer-1.0-0.72.20070325svn.AhmedSoliman.com.i386.rpm
mplayer-gui-1.0-0.72.20070325svn.AhmedSoliman.com.i386.rpm
mplayer-doc-1.0-0.72.20070325svn.AhmedSoliman.com.i386.rpm
mencoder-1.0-0.72.20070325svn.AhmedSoliman.com.i386.rpm

fribidi0-0.19-1.AhmedSoliman.com.i386.rpm

libfribidi0-0.19-1.AhmedSoliman.com.i386.rpm
libfribidi0-devel-0.19-1.AhmedSoliman.com.i386.rpm

Source RPMS:

fribidi-0.19-1.AhmedSoliman.com.src.rpm
mplayer-1.0-0.72.20070325svn.AhmedSoliman.com.src.rpm

NOTE1: Those packages are based on rpm.livna.org packages and are completely compliant with Fedora Core 6

NOTE2: If you chose to install fribidi0-0.19-1.AhmedSoliman.com.i386.rpm then you shouldn’t install libfribidi0 and libfribidi0-devel as they are self-contained in fribidi0, this package was made to make the installation thing easier.

NOTE3: You may face conflicts with original fribidi package while installation, you can rpm -ivh –force fribidi0* before installing mplayer, then do the normal installation and remove fribidi0 from directory.

NOTE4: You may face a problem that my packages aren’t signed during installation using yum localinstall, edit /etc/yum.conf and change gpgcheck=0

الأحتكار الصارخ و المستفز

May 13th, 2007

النهارده كنت بظبط جهاز محمد اخويا الصغير و طبعاً هو من مستخدمين ويندوز اللعين! و انا بفتح الوندز لقيت رسالة تحذير بأن الويندوز غير اصلية و مايكروسوفت بدأت تحارب سرقة البرامج و بناء على هذا الويندوز مش هتعمل تحديث و طبعا الويندوز لو معملتش تحديث يبقي بعد بكرة الصبح هتلاقي الكراكرز عاملين عالية عيد ميلاد و جايبين العيال الصغيرة الي لسا بتتعلم كراك علي جهاز الواد الغلبان .

الموضوع ده استفزني لدرجة كبيرة جداً و بدأت افكر في الخساير الفادحة اللي هنخسرها كأمة من حيث الفلوس و القيمة.

القصة إن ميكروسوفت فضلت تحتل عقول الشباب من المستخدمين و المطورين لحد اما بقي كل الناس فاكرة ان الكمبيوتر هو الويندوز و ان مفيش حاجة غيره! دا انا مرة بكلم واحد صاحبي و بقوللو عن السولاريس و بقولو انه كويس و كده لقيتة بيقوللي “هو فيه حد بيستخدمة ده؟” فقلتلة ان اكبر شركات البترول و البنوك و الأتصالات بتستخدمة و انه مشهور جدا و الحقيقة ان مايكروسوف قعدت مده طويلة جداً مسيطرة علي تفكيري و تعليمي لدرجة اني كنت باتمني اشتغل فيها و مكنتش ابداً عارف ده تأثيرة ايه علينا. الحقيقة ان عايز اوضح نقطة و هي ان مايكروسوفت فضلت فتره كبيييييييييرة سايبة الدنيا في الويندوز عال البحري و الشباب كلة بينسخ و السريال واحد و كله تمام، لكن الواقع انها كانت بالطريقة دي بتعمل دعاية خفية حتي اصبحت الويندوز الأساس بتاع الكمبيوتر بين الشباب، ده غير ان الناس اتعودت على مشاكل الويندوز الكتيرة و بقى شئ عادي

لكن دلوقي ميكروسوفت بتعمل اعلاناات في الراديو عشان تبيع النسخة الفاشلة تماماً “فيستا” و التي تطلب مواصفات خارقة اللينكس بيعتبرها مواصفات سيرفر و اعتقد ان ده بالتعاون مع شركات الهاردوير عشان كله ياكل عيش. و عملت الأختراع اللي اسمة
“Windows Genuine Check”

و بقى دلوقتي اللى عندة ويندوز مش اصلية يشربها عشان مفيش تحديث و الويندوز ب 500 جنية مصري يعني صدقوني الناس هتبدأ تنصاع للفكرة و كلة هايشتري كأنها قطعة من مكونات الكمبيوتر

امتى بقى الناس تفوق و ضميرها يصحي و زي ما بتطبق المقاطعة في الأكل تتطبق المقاطعة لمنتجات الاحتكار الامريكية و خصوصاً ان فية بديل مجاني و احسن و مش عايز اتكلم عن مميزاته الفنية ، لكن عايز اقول انه يمكن يكون بيدينا فرصتنا الأخيرة اننا نرجع اسياد العلم في العالم و نرجع اصحاب كلمة و صوت وسط الدول الأولي في صناعة السوفت وير

يمكن يكون هو الأمل في ان المهندسين يتخرجوا على مستوى محترم من العلم و روح المشاركة ، يمكن يكون هو ده حل مشاكل امه مالهاش هدف ، يمكن يمكن يمكن

و يمكن لأ، لكن الفكرة تستحق التجربة و التضحية

الفكرة دي هي اللينكس! يا مسلمين افيقوا و حرروا الأمة

The Sexiest OS Ever, MAC OS X Tiger 10.4.6

May 5th, 2007

After waiting 5 days of downloading, I finally got the installation DVD iso of the sexiest operating system ever – MAC OS X Tiger 10.4.6 for Intel with SSE2 and SSE3 patches for older and new processors support. I didn’t waste much time and I burnt the DVD and freed a partition of 6 GB to have the system installed on.

In the past few days I had some reading about this system and its hardware compatibility to expect the types of problems I might face with my hardware. I was dying to see it and finally it’s here on a DVD :)

So I rushed and booted the system and I got a nice Apple Icon in the center of the screen and I waited for 5 minutes with complete patience in hope to see the next, the thing which didn’t happen! :D

Quickly I started searching on the internet and I found two great website http://www.osxx86.info/ http://forum.insanelymac.com then I started searching for how to get the boot log, I found the -v and -x boot options for verbose and safe mode. I discovered that the installer was printing out a message “still waiting for root device”!, After some search I discovered that I should set the DVD and the Harddisk as Master devices (primary master, secondary master). then quickly I had things working but this time with a new error :) “Load of /sbin/launchd failed, errno 88″, so again quickly to google and I found that it may have millions of reasons! – I tried a very strange one which is reburn the DVD but using the lowest speed 2.4x and surprisingly it worked!!

» Read more: The Sexiest OS Ever, MAC OS X Tiger 10.4.6

My Storage Server

May 4th, 2007

I’d a very complicated problem related to storing data, I have a bad story also about losing my work files. So I decided to unify my storage into a single (24/7) online storage server – but low cost -.

I had some old hardware in my closet and I decided to use them as effecient as possible, so I started with a Manli Motherboard and a P3 Processor (1.2 GHz) with 1 20GB Harddisk and 2 160GB SATA Harddisks.

I had a problem regarding the SATA harddisks as I don’t have SATA controller in my Motherboard, so I searched in the hardware market and I found a PCI SATA Controller based on VIA VT6421 chipset which was perfectly compatible with Linux 2.6 kernel. At then I started assembling things together and I bought a good ventilated chassis to make things comfortable for the hardware inside.

I have used the IDE 20GB Disk as the system harddisk and installed Fedora core 6 i386 on it and then I had a large free space remaining on the disk. I used this disk to mirror the fedora updates repos and I wrote a small script to rsync the fedora updates mirror every 2 days on 3:30AM automatically using Vixie Cron.

#!/bin/bash
if rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/updates/6/i386/ \
–exclude=debug/ –exclude=repodata/ –exclude=*debuginfo* –exclude=*i18* \
–exclude=*langpack* /fedora-6/updates/
then
createrepo /fedora-6/updates/
fi

The remaining 2 160GB SATA Disks were connected and configured as RAID 1 (Mirror) to get a high redundancy and availability possible having a total storage area of 160GB. I think I’ll buy another 160GB disk and I’ll switch into RAID 5 to get 320GB of total storage.

The machine is headless and I’m using VNC to control everything, It’s used also as a DNS caching and forwarding server to my computers and download machine ;)

The last thing is to see how to access my files in an effecient and a speedy way, I used a NFS server optimized to get the best performance on LAN, I can get transfer rates up to 9Mbytes/Sec and Samba server with authentication to have access from windows machines.

The performance is really nice although the machine is pretty old and has only 256MB of memory but Linux is working great with outstanding performance and excellent stability. I’ve achieved disk reads of 53.5 Mbyte/Sec with buffered reading on the RAID 1 array.
Soon I’ll buy a real IP address to bind with this machine to have it accessible through the internet for remote files access. I’ll show you some of pictures about it ;)