Archive for » February, 2009 «

Saturday, February 21st, 2009 | Author:

The relatively new document types Office 2007 has given some web hosts problems when their clients want to offer documents for download. Most often, the documents are being offered by the web server as text/html which is then rendered as a ton of garbage on the web user’s screen.

The best way to resolve this is to add all the MIME types to the server’s main configuration. IIS7 for Windows already has these MIME types set up correctly by default. IIS6 and IIS5 require the MIME types to be added, as might Apache on older installations. For Apache, there is also a workaround for the individual domain owner to add the mime types via Apache’s .htaccess ফাইল.

IIS 6 MIME type addition (for the Server Administrator)

Before this can be done, ensure that your server is also set to allow direct metabase editing:

  1. Load IIS Manager: Start -> Rজাতিসংঘ, “inetmgr” -> [OK]
  2. Right click theserverand clickProperties
  3. Within theInternet Information Servicestab (usually the only tab), ensure that theEnable Direct Metabase Editcheckbox is checked.
  4. Click [OK]

Be sure to back up IIS’s configuration (এখানে for IIS5) beforehand. I won’t take any responsibility for an admin breaking his server. I have reason to believe this may also work on IIS5 however I have just as much reason to believe that it might just give lots of errors. If an IIS5 / Windows 2000 admin is willing to test this for me after backing up your configuration please let me know of the results.

Copy the following text into a file named msoff07-addmime.vbs and execute it once from the commandline by typing cscript msoff07-addmime.vbs and pressing Enter. If you run it more than once, the MIME types will be added each time and you will have multiple identical entries:

' This script adds the necessary Office 2007 MIME types to an IIS 6 সার্ভার.
' To use this script, just double-click or execute it from a command line.
' Running this script multiple times results in multiple entries in the
' IIS MimeMap so you should not run it more than once.
' Modified from
Dim MimeMapObj, MimeMapArray, MimeTypesToAddArray, WshShell, oExec
' Set the MIME types to be added
MimeTypesToAddArray = Array(".docm", "application/", _
".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", _
".dotm", "application/", _
".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template", _
".potm", "application/", _
".potx", "application/vnd.openxmlformats-officedocument.presentationml.template", _
".ppam", "application/", _
".ppsm", "application/", _
".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow", _
".pptm", "application/", _
".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation", _
".sldm", "application/", _
".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide", _
".xlam", "application/", _
".xlsb", "application/", _
".xlsm", "application/", _
".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", _
".xltm", "application/", _
".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template") 
' Get the mimemap object
Set MimeMapObj = GetObject("IIS://LocalHost/MimeMap")
' Call AddMimeType for every pair of extension/MIME type
For counter = 0 থেকে UBound(MimeTypesToAddArray) পইঠা 2
    AddMimeType MimeTypesToAddArray(counter), MimeTypesToAddArray(counter+1)
' Create a Shell object
Set WshShell = CreateObject("WScript.Shell")
' Stop and Start the IIS Service
Set oExec = WshShell.Exec("net stop w3svc")
Do While oExec.Status = 0
    WScript.Sleep 100
Set oExec = WshShell.Exec("net start w3svc")
Do While oExec.Status = 0
    WScript.Sleep 100
Set oExec = Nothing
' Report status to user
WScript.Echo "Microsoft Office 2007 Document MIME types have been registered."
' AddMimeType Sub
Sub AddMimeType (Ext, MType)
    ' Get the mappings from the MimeMap property.
    MimeMapArray = MimeMapObj.GetEx("MimeMap") 
    ' Add a new mapping.
    i = UBound(MimeMapArray) + 1
    Redim Preserve MimeMapArray(i)
    Set MimeMapArray(i) = CreateObject("MimeMap")
    MimeMapArray(i).Extension = Ext
    MimeMapArray(i).MimeType = MType
    MimeMapObj.PutEx ADS_PROPERTY_UPDATE, "MimeMap", MimeMapArray
End Sub

Apache MIME type addition (for the Server Administrator)

Apache stores its MIME types in a file normally located at $installpath/conf/mime.types. See the mod_mime documentation for more on how it works. Arch লিনাক্স installs its MIME types at /etc/httpd/conf/mime.types এবং Parallels Plesk installs it in /usr/local/psa/admin/conf/mime.types. Your distribution might have it in another place, so find your mime.types file by running locate mime.types.

Add the following lines to your mime.types file:

application/                          docm
application/vnd.openxmlformats-officedocument.wordprocessingml.document   docx
application/                          dotm
application/vnd.openxmlformats-officedocument.wordprocessingml.template   dotx
application/                    potm
application/vnd.openxmlformats-officedocument.presentationml.template     potx
application/                       ppam
application/                   ppsm
application/vnd.openxmlformats-officedocument.presentationml.slideshow    ppsx
application/                pptm
application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
application/                       sldm
application/vnd.openxmlformats-officedocument.presentationml.slide        sldx
application/                            xlam
application/                     xlsb
application/                            xlsm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet         xlsx
application/                         xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.template      xltx

Apache MIME type addition (For the domain owner with at least FTP accessusing .htaccess file)

Add the following text to your domain’s .htaccess ফাইল, most commonly in an httpdocs/ directory

AddType application/ docm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.document docx
AddType application/ dotm
AddType application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx
AddType application/ potm
AddType application/vnd.openxmlformats-officedocument.presentationml.template potx
AddType application/ ppam
AddType application/ ppsm
AddType application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx
AddType application/ pptm
AddType application/vnd.openxmlformats-officedocument.presentationml.presentation pptx
AddType application/ sldm
AddType application/vnd.openxmlformats-officedocument.presentationml.slide sldx
AddType application/ xlam
AddType application/ xlsb
AddType application/ xlsm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx
AddType application/ xltm
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx
Saturday, February 21st, 2009 | Author:

and my Personal Rating (PR) out of 10 😉

I use ফায়ারফক্স so most of these won’t apply to non-FF users. কিন্তু, I’d be very very interested to hear what other addons my friends, subscribers, and random websurfers find interesting or useful to them. Have your say and let us know why you love the addons you love. 🙂

Personally, I prefer addons that aren’t intrusive. Ideally, an addon must have a minimal interface and give me a measurable benefit for me to keep it installed.

Cacheviewer – 7

This is a GUI front-end for the Cache Firefox keeps of the last few pages and media. I’ve found this addon more interesting than useful right now so I’m probably going to remove it soon.

ColorfulTabs – 9

I love the colours. The tab colour-grouping doesn’t work very well when you reach about 30 tabs though… :-/

ডাউনলোড স্ট্যাটাস – 10

আমি ট্যাবে একটি একক উইন্ডোতে ফায়ারফক্সে সবকিছু থাকার পছন্দ. আলাদা উইণ্ডোয় একটি ডাউনলোড বক্স হচ্ছে আমার জন্য একটি বড় চল নেই. It also saves screen real-estate since it is very minimal. 🙂

ভিডিও DownloadHelper – 10

ভিডিও DownloadHelper মিডিয়া স্ট্রিমিং জন্য দেখায় – বিশেষভাবে কোনো বৃহৎ এমন বিষয়বস্তু ডাউনলোড হচ্ছে খুঁজছেন. আপনি আইকনের উপর ক্লিক করুন যখন, এটা আপনি বর্তমানে ডাউনলোড স্ট্রিম দেখায় এবং আপনি একটি যেমন সারিতে বিকল্প দেয় “সাধারণ” ডাউনলোড.

যেহেতু আপনি জানেন না যদি মুক্তিযোদ্ধা বিপর্যস্ত যাচ্ছে বা শক্তি কেটে যাচ্ছে, আমি আমার ডেস্কটপে একটি কপি সংরক্ষণ করতে চান এবং আমি তারপর আবার ভিডিও ডাউনলোড করতে আরো ব্যান্ডউইথ ব্যবহার না করে ভিডিও দেখতে পারেন. এছাড়াও, কর্মক্ষেত্রে, যখন মানুষ আমাকে পাঠাতে ইউটিউব বা অন্যান্য মিডিয়া সংযোগ, আমি সাধারণত পরে অনেক পর্যন্ত পর্যবেক্ষক বিরক্ত করবেন না – আমার নিজের অবসর সময়ে বা একটি বিরতির সময়.

মেয়াদ শেষ হওয়ার ক্যানারি – 9

এই ঝরঝরে এবং ন্যূনতম addon আপনি বলে যদি সাইট বর্তমানে দেখছেন জন্য SSL সার্টিফিকেট শীঘ্রই মেয়াদ শেষ যাচ্ছে. আপনার নিজস্ব সাইট একটি SSL সার্টিফিকেট থাকে, আমি আপনাকে সুপারিশ প্রজ্ঞাপন বা miscommunication একটি সহজ অভাবে সাহায্য করার জন্য আপনার সাইটের SSL সার্টিফিকেটের মেয়াদ উত্তীর্ণ এড়াতে এই addon ব্যবহার.

Fasterfox – 8

Fasterfox adds some network optmisation options. Some of the options could make your corporate network admin a little mad with you though. 😉

ফায়ারবাগ – 9

ওয়েব ডেভেলপমেন্ট এবং পৃষ্ঠাগুলির সাথে পরীক্ষা-নিরীক্ষার জন্য. কোডের সামান্য বিট পরীক্ষামূলক সেইসাথে পৃষ্ঠাগুলি ডিবাগ করার জন্য জট্টিল.

FoxClocks – 6

errtells you the time in other time zones. o.O Was useful for a short timenow its redundant since my head is working it out faster than I can glance. rm -f

FoxyProxy – 9

নির্দিষ্ট প্রক্সি সার্ভারের মাধ্যমে নির্দিষ্ট পৃষ্ঠাগুলির ব্রাউজিং জন্য জট্টিল. This is useful for when some sites are blocked or the SAIX Transparent Proxy servers aren’t working properly. 🙂

আমি প্রক্সি সার্ভার যে আমি বরং ডিফল্ট রুট দিয়ে যেতে না চাই কিছু ট্রাফিক রুট এই ব্যবহার. Its also very flexible. আপনি একাধিক প্রক্সি সার্ভার উপলব্ধ আছে এবং আপনি সাধারণত হঠাৎ ব্যবহার পলকে যায় যদি, পরের এক ওভার সুইচ. 🙂

যন্ত্রশিল্পী – 10

Right now, I use this only for the GooglemonkeyR লিপি. This script reformats গুগুল‘s search results to your specifications and also has an option to show small thumbnail of the pages Google links to. Greasemonkey can do a lot more and there are plenty of scripts readily available for many many sites.

Live HTTP headers – 8

I’ve used this a few times to diagnose gzip compression issues with IIS web servers. Not much else to say though: It works.

Live PageRank – 10 (so faronly installed it yesterday)

This addon seems simple enough. It gets the PageRank from Google and shows it in the tray.

NoScript – 10

NoScript ব্লক বিজ্ঞাপন এ সন্ত্রস্ত. প্রথমে তার একটি সামান্য জ্বালাময় থেকে আপনি আপনার পছন্দের সব সাইট শ্বেততালিকায় আছে – but in the long run it is soooo worth it. 🙂

পুনরুত্থিত পেজ – 10

যদি আপনি একটি সাইট ব্রাউজ জন্য অত্যন্ত দরকারী এবং এটি ডাউন হতে হবে. সাইট যদি স্ট্যাটিক-বিষয়বস্তু ভিত্তিক তারপর এই এটা সহজ দ্রুত বিষয়বস্তু খুঁজে পেতে যদি তার অনলাইন ক্যাশে তোলে.

ট্যাব মিক্স প্লাস – 8

Awesome for if you have more than 7-or-so tabs.

ShowIP (using a version modified for work purposesdisplays company server’s canonical name when browsing) – 10

I cannot imagine the hell I’d have to go through to identify a server without this plugin. Okay, I can. Used to have to do this all the time. I eventually scripted it but I can’t find the original script. Here’s my 60-second attempt at recreating what was in that script:

$ cat /etc/hosts | grep `dig A $hostname @mycachingnameserver | grep . | grep -v "^;"`
$ dig -x `dig A $hostname @mycachingnameserver | grep ^$hostname | grep A | \
  awk '/[.]/{print $5}'` @mycachingnameserver | grep . | grep -v "^;"

Web Developer – 9

I used this once to diagnose some issues with a page. I don’t do much web development so I’m going to remove this one. Its no comment on its capabilities since I believe this is a top notch add-on if you’re doing a lot of web development work.

Tuesday, February 17th, 2009 | Author:

Some of you may already know that I built a home server not too long ago. I documented some of the very important parts of how it was built though I was planning on releasing all the documentation all at once. I was using Arch Linux and I hadn’t nearly finished everything, especially the documentation. উদাহরণস্বরূপ, it was supposed to be a media server. After some disk shuffling, it was supposed to end up having a RAID-র1 for the boot and RAID 10 for the rest (the media part).

This didn’t work out at all.

I got as far as having an efficient (এবং ভালfirewalled) routing gateway server. I was finally satisfied that the customised local routing* was working correctly and I was confident that my tests with DHCP meant I could disable the DHCP service on the flimsy ADSL router and have all my flatmates start using the server as the Internet প্রবেশপথ. Instead: I was logged in to the server from the office, I’d just installed Apache2**, and I was about to consult with a colleague regarding getting nice graphs put together so the flatmates could all see who was using up the bandwidth***when I noticed a little message indicating that the root filesystem had been remounted read-only due to some or other disk failure.

And then I lost my connection to the server.

And then I gained a foul mood.


When I arrived home, I found that, as I had guessed from the descriptive message given at the office, the (খুব) old 80GB IDE disk that I was using for the root filesystem had failed. Unfortunately, the server would never boot again and there was little chance of prying everything off onto another disk to continue where I’d left off.

I’m buying a replacement (সময় SATA) HDD this next weekend just after pay dayand I’ve changed my mind about documenting my progressand backing up my configurations:

Release Early. Release Often.

* ISPs in South Africa charge less (easy price comparison) forlocal-only” (within South Africa) traffic on ADSL but only if you use an ADSL account that CANNOT access web services outside of South Africa. This means that if you want to take advantage of the reduced costs but still be able to access the Internet at large, you need to set up some sneaky routing.

** one-command-install: ~$ yaourt -S apache

*** Internet Access in SA is expensiveyou get charged about R70 ($7 / £4.9 / €5.46) per GB when using ADSL, or about R2 per MB if using GPRS / 3G.

Wednesday, February 04th, 2009 | Author:

Before everyone panics and gets all freaked-out, everyone’s fine. We’re dinged up a littlebut nothing more serious than bruises. bleh.

Two friends and I were involved in a car accident this morning at about 01:25 am. We had an awesome evening at Gandalfs (lots of gorgeous foosball action) and we were on our way to the first drop-off point in Plumstead. I was the passenger in the front and passenger 2 was in the back seat.

We were travelling down Main Road (South) in Claremont, probably about 150m or so past Stadium on Main, where a sedan taxi (as opposed to the regularkombi“-type taxis South Africa is famous for) made a u-turn in front of us. Our driver didn’t have enough time to react and we collided after our wheels locked.

Passenger 2 has a bad bruise on her left cheek, having collided with the back of my seat. Our driver has a swollen knee as a result of her kneecap having hit the dashboardand an insurance beaurocracy to go through. I have a sore red line from my left shoulder to my right waist as a result of the seatbelt‘s welcome-yet-cursed restraint. I also suspect my neck might soon start to pain as a result of whip-lash. The driver of the taxi reported that he had a sore or bruised shoulder but wasn’t in any major pain.

I took lots of photos on my P1. Honestly, this phone is a major painbut it works okayand the I like the 3.2MP camera part. I lost my stylus in the crash as well. I’m sure its in the car somewhere. I’ll be uploading the photos when I get a chance (done) – and I’ll be editing this post to add lots of appropriate link bait (done) – but that will have to wait as well.

Our driver expressed great regret later this morning at not having made the effort to go to speak to the taxi driver herself. She was in quite a state of shock on the scene and I don’t think she would have been able to make for nice conversation anyway. So, I’m going off to the doctor in a short while to go have a professional give me a thumbs-up. And then I’m going to sleep.