November 9, 2012

cURL command for status code output only

If you would ever need a cURL command to only get a no-fuss status code in the output, then here is my choice:

curl -s -o /dev/null -w "%{http_code}\n" [YOUR_URL]

Output will look like this:

$ curl -s -o /dev/null -w "%{http_code}\n"

That it :)

November 8, 2012

User-Agent lists for mobile and other devices

If you've been looking for some lists of mobile (and other) User-Agents for mobile site redirects and other useful stuff you might want to check out these links.

WURFL has a fantastic and up-to-date collection of devices and their User-Agents, you can both query their database of download an XML with the device list and the device specifications.

WURFL (Wireless Universal Resource FiLe)

Here is a sample WURFL database entry (this one is for the Samsung Galaxy Tab 8.9 / P7300), as you can see there is a lot of interesting information about the device specs and capabilities for displaying web content, video and audio streaming which can come in very useful if you're redirecting your site based on User-Agents. Most useful fragments marked in red.

<device id="samsung_gt_p7300_ver1" user_agent="Mozilla/5.0 (Linux; U; Android 3.1; it-it; GT-P7300 Build/HMJ37) AppleWebKit/534.13 (KHTML, like Gecko) Version/4.0 Safari/534.13" fall_back="generic_android_ver3_1" actual_device_root="true">
    <group id="product_info">
      <capability name="uaprof" value=""/>
      <capability name="model_name" value="GT-P7300"/>
      <capability name="brand_name" value="Samsung"/>
      <capability name="marketing_name" value="Galaxy Tab 8.9"/>
      <capability name="release_date" value="2011_december"/>
    <group id="wml_ui">
      <capability name="table_support" value="true"/>
    <group id="display">
      <capability name="columns" value="25"/>
      <capability name="rows" value="21"/>
      <capability name="resolution_width" value="800"/>
      <capability name="resolution_height" value="1280"/>
    <group id="image_format">
      <capability name="jpg" value="true"/>
      <capability name="gif" value="true"/>
      <capability name="wbmp" value="true"/>
      <capability name="png" value="true"/>
      <capability name="colors" value="65536"/>
    <group id="streaming">
      <capability name="streaming_vcodec_h263_0" value="30"/>
      <capability name="streaming_vcodec_h264_bp" value="1"/>
      <capability name="streaming_vcodec_mpeg4_sp" value="0"/>
    <group id="wap_push">
      <capability name="wap_push_support" value="true"/>
    <group id="mms">
      <capability name="mms_png" value="true"/>
      <capability name="mms_3gpp" value="true"/>
      <capability name="mms_max_size" value="307200"/>
      <capability name="mms_max_width" value="2048"/>
      <capability name="sender" value="true"/>
      <capability name="mms_max_height" value="1536"/>
      <capability name="mms_gif_static" value="true"/>
      <capability name="mms_wav" value="true"/>
      <capability name="mms_video" value="true"/>
      <capability name="mms_vcard" value="true"/>
      <capability name="mms_midi_monophonic" value="true"/>
      <capability name="mms_bmp" value="true"/>
      <capability name="mms_3gpp2" value="true"/>
      <capability name="receiver" value="true"/>
      <capability name="mms_vcalendar" value="true"/>
      <capability name="mms_mp3" value="true"/>
      <capability name="mms_amr" value="true"/>
      <capability name="mms_mp4" value="true"/>
      <capability name="mms_jpeg_baseline" value="true"/>
      <capability name="mms_gif_animated" value="true"/>
    <group id="sound_format">
      <capability name="sp_midi" value="true"/>
      <capability name="aac" value="true"/>
      <capability name="mp3" value="true"/>
      <capability name="amr" value="true"/>
      <capability name="midi_monophonic" value="true"/>
      <capability name="imelody" value="true"/>
      <capability name="midi_polyphonic" value="true"/>

Another great resource I found with some insightful information was on Zytrax, not all up-to-date but still great info about which is what and mostly for quick reference when you don't necessarily need the additional information from WUFL.

Check it out at:

Zytrax Mobile-ID list

Been gone

Haven't been posting since over a year now. Still glad to see so many page views and so many of you coming to visit, thanks! My absence and silence are not without reason of course. I changed my field of interest a bit due to changing jobs and responsibilities between 2011/2012, now dealing with a hell of a lot more servers, mostly Linux-based and doing a bit more tech support vs the previous project work and Windows servers as previously.

Now working for a major CDN and dealing with everything from HTTP(S) content delivery, live video streaming, on demand video, DDoS mitigation, application firewalls an more. So a lot of new, fresh ideas and a still a lot to learn. This year was very hectic and still trying to catch my breath from all the work and learning I had to go through.

Will try to be back more often (promises.. promises! :P) and stay informative. Maybe will post some basic stuff too which might be helpful for some.

Till then!