Tuesday 29 January 2013

How do I solve following HTML5 video error: HTTP "Content-Type" of "text/plain" is not supported

Problem:

When trying to play a video using the HTML5 tag in a web page being programmed, the video plays fine when running the file locally in Firefox. However, when running the web page using Apache, an error like the following comes up in the console:

HTTP "Content-Type" of "text/plain" is not supported. Load of media resource http://127.0.0.1/path/to/video.webm failed.

The videos are encoded properly, so they are not the issue.

Solution:

This error is happening as Apache isn't reporting the MIME type of the video files correctly. To solve this, add the following lines to the relevant .htaccess file that covers (at the very least) the folders of the videos that will be played:

AddType video/webm .webm
AddType video/ogg .ogv
AddType video/mp4 .mp4

Notes:

Alternatively, the proper MIME types can be placed into the appropriate configuration file for Apache. This solution is particularly relevant if your web server is set up to ignore .htaccess files.

Monday 28 January 2013

Change Data Usage Cycle in Android 4.1.1

Problem:

How do I change the data usage cycle in Android 4.1.1? The option to change won't show.

Solution:

The first screenshot below illustrates the problem: it seems as though the option to change the billing cycle does not exist! Notice that mobile data is turned off at this point.

Turning on mobile data at first doesn't seem to fix the problem as seen in the screenshot below. The option to change billing cycles is still not there.

To work around this issue, try the following: exit the preferences to the home screen, and open the data usage preferences again. You should be able to see the option to change the billing cycle now.

Notes:

This seems to be a strange, intermittent problem with the interface. This solution was tested using Android 4.1.1 on a Galaxy Nexus. Your results may vary with other setups.

What's the font in the Google logo?

Question:

What's the name of the font used in the Google logo?

Answer:

The font is named "Catull". Find out more in the Wikipedia article for Catull here.

Use several wireless routers with only one DHCP server for a home network

Problem:

How do I connect more than one (D-Link) wireless router to make a single home network with only one router acting as a DHCP server?

(In other words, how do I make the other wireless routers in my home network act only as access points?)

Solution:

  • plug only one router into internet using the router's uplink/WAN port. This will be the primary wireless router and act as the network's gateway to the internet. This should preferably have a firewall and be the fastest router as all traffic from the network will be funnelled through it. This router should have several ethernet ports available to plug the other routers into it.
  • turn on the DHCP server in this router, and set the range to something that does not encompass the entire IP range (e.g. 192.168.0.100-192.168.0.255)
  • set the primary router's IP address to something outside of the DHCP server's range (like 192.168.0.1) -- this is to allow access to the web admin/setup application of the primary wireless router
  • plug the second (third, etc.) router into the primary router using one of the ethernet ports of both the primary and secondary (tertiary, etc.) wireless routers -- in other words, leave the WAN/uplink port of the secondary router empty
  • turn the DHCP server of all secondary wireless routers off
  • match the subnet of all secondary wireless routers to the subnet of the primary router (e.g. 255.255.255.0)
  • set the IP address of the secondary routers to something outside of the DHCP server's range (such as 192.168.0.2, etc.) -- this is to allow access to the admin/setup web applications of the secondary routers
  • (optional, but useful) set the SSIDs and authentication methods (like WPA2-only PSK) of all the wireless routers to the same as one another
  • (also optional) make sure the channels of the wireless routers are spread out as much as possible to minimize interference between them

Notes:

This has been tested with only D-Link routers, but should work for others, too. Again, while it's one of many solutions, it should be good enough for most home situations. The benefit of setting up the network this way (if necessary due to the nature of the location the wireless network is being set up, budget, etc.) is that all clients in the home's LAN should be able to communicate to one another if desired. (This can be useful for running local services, running a home file server, accessing networked printers, etc.)

As with any network, make sure that all machines connected to it are trusted and precautions have been taken to mitigate intrusions, viruses, anonymous logins, etc. This is beyond the scope of this reminder how-to, however a quick Google search should help with finding more information on this.

Reference:

The following reference probably explains this procedure better than this blog post. The blog post was written as a reminder to myself, in case the reference ever goes down. Hopefully this comes in handy for someone out there :)

Tuesday 22 January 2013

Some useful postfix commands

Intro

This is a partial list of useful commands related to postfix/sendmail for my own reference. It's posted here in case anyone else finds this useful, too.

Commands

  • List stuff in the mail queue:
    mailq

  • Read a message in the mail queue with example id 012345678F:
    postcat -q 012345678F

  • Delete a message in the mail queue with example id 012345678F:
    postsuper -d 012345678F

  • Delete ALL messages in the mail queue (warning - no confirmation nor undo!):
    postsuper -d ALL

Wednesday 2 January 2013

One workaround for Android not receiving MMS

Problem:

My Android (4.1) phone is often not receiving MMS messages in the Messaging app. It stays stuck on the "downloading" message. I have data turned on, so that's not the issue. I was also not roaming at the time. Sometimes Android would download the MMS messages, other times it would just remain on the MMS notification 'download'.

Workaround:

This workaround seemed to have success with my own device after several days of attempting other solutions (turning on/off background data, turning on/off wifi while 3G is turned on, etc.) Your mileage may vary, but hopefully it at least helps someone out there :)

  • in the Messaging app, go to the settings
  • scroll down to the "MULTIMEDIA (MMS) MESSAGES" section
  • uncheck "auto-retrieve"
  • when someone sends a MMS, click the "download" button that appears in place of the 'downloading ...' message
  • your message should now download, rather than forever remain on the "downloading..." message

Notes:

This was tested to work using Android 4.1.1 on a Samsung Galaxy Nexus while on the Fido network in Canada. Again, as many things can contribute to MMS messages not sending, your mileage may vary.

While this is not the ideal solution, most people will usually not be looking at a MMS message until they have the messaging app open in front of them, so hopefully this is an appropriate workaround for those who don't mind waiting a few seconds to manually download a MMS rather than have them automatically download.

By the way, if anyone at Google is reading this, hopefully this bug can be reproduced by your Android Messaging app team =) It's an intermittent bug and I have no idea how to reliably reproduce it, otherwise a bug report would have been filed by now! Have a great day!