Posts

SCTE35 Parser

The SCTE (Society of Cable Telecommunications Engineers) defines the SCTE-35 as "SCTE 35, Digital Program Insertion Cueing Message for Cable, is the core signaling standard for advertising and distribution control (ex. blackouts) of content for content providers and content distributors"  SCTE-35 CUEs are signals that can be used to identify AD breaks, program chapters etc in a VOD, DVR or live streams contents. While creating the original content, encoders uses SCTE-104 messages to insert appropriate SCTE-35 info in the stream. This usually will be packaged as separate stream with other video, audio streams. The downstream packager can use this info to create appropriate SCTE-35 CUEs on the end user metadata, for example HLS manifest, DASH manifest etc.  Sample manifest with SCTE-35 cues: #EXTM3U #EXT-X-TARGETDURATION:10 #EXT-X-VERSION:3 #EXT-X-MEDIA-SEQUENCE:00001 http://server-host/path/file44.ts http://server-host/path/file45.ts SCTE 35 2016 SCTE STANDARD ©SCT

Bart Knols: Cheese, dogs and a pill to kill mosquitoes

Image
                       http://www.in2care.org/

Probability Density Distribution Graph for CPU usage analysis

Image
The normal distribution is useful to understand the probability density of a large sample data set. There are many real world application of this theory. The example in this article shows how this can be used for analyzing the CPU usage of a particular process or individual core or overall CPU usage over a period of time. There may be occasional spikes up to 100%, but that may not necessarily an indicator of an issue for the overall system as long as the normal operating mode is utilizing less than the threshold. A graphical representation of probability density distribution combined with cumulative distribution will help to visualize the overall usage. Probability density function is represented as  The above simplifies to:   - Standard deviation  - Mean This can be implemented in a programming language, I've used javascript and DyGraph chart library to create visualization of the data. Sample data set: var testData = [2,0,95.9,37.9,55.9,71.9,69.9,71.9,93.8,8,6,4,

HTTPS requests using org.springframework.web.client.RestTemplate

RestTemplate class is useful to make synchronous client-side HTTP access. It also allows you to make HTTPS calls with same interface. When you use HTTPS urls, the framework switch to a different path to take care of the SSL handshake behind the scene so that as a user you don't have to explicitly provide a truststore and keystore to support the protocol. Here are some helpful info to understand the SSL flow better in this case. CA Cert Validation when using org.springframework.web.client.RestTemplate This example uses org.springframework.web.client.RestTemplate to make http requests. This make use of the SSLSocketFactoryImp, and SSLContextImpl$DefaultSSLContext classes, through which get access to the default cacert store file (loaded through X509TrustManagerImpl). Code references: http://www.docjar.com/html/api/sun/security/ssl/SSLContextImpl.java.html  - (DefaultSSLContext-> getDefaultTrustManager) http://www.docjar.com/html/api/sun/security/ssl/TrustManagerFactoryI

IoT: Intel Edison as Bluetooth Low Energy (BLE) peripheral

Image
Intel Edison is one of the best IoT hardware suitable for rapid prototyping. If you are new to IoT world, you can easily setup a simple demo app by using Intel® Edison Kit for Arduino* Box (shown in the picture below). This setup is specifically to create Bluetooth Low Energy (BLE) peripheral with the Intel Edison board. 1. Intel Edison Setup For a new board set up you can follow the step by step instructions given here:  https://software.intel.com/en-us/assembling-intel-edison-board-with-arduino-expansion-board One of the issue I faced with this set up is that, when used the board with USB power mode I had trouble connecting to the box. So its advisable to use a standalone power adapter to avoid intermittent connectivity issues. Some times the Windows 7 will not let you manual/auto install a new build through the USB interface. So you could switch to MAC OS in order to complete the installation process, and then switch to windows if you prefer to. Make sure that the PC is up

Compile NodeJS from source on Debian (linux)

Steps wget http://nodejs.org/dist/v0.10.16/node-v0.10.16.tar.gz    /// Downloads the source tar -zxf node-v0.10.16.tar.gz  ///extract to local folder su   /// switch to root apt-get install build-essential   ///This command installs the c compiler and other essential build tools.  ./configure && make  /// builds the source

Reset OSX to factory setting without Disc

Use the following steps to reset. Reboot the device Press Command+S during startup until command window shows up Run the following Commands mount -uw /  rm /var/db/.AppleSetupDone shutdown -h now After the reboot, the system will be ready to setup new.

Install PostgreSQL in Fedora 20

Install Postgres #> sudo yum install postgresql-server postgresql-contrib #> sudo postgresql-setup initdb #> sudo systemctl enable postgresql #> sudo systemctl start postgresql Install PgAdmin3 #> sudo yum install pgadmin3 Change/Update Password #> su - postgres -bash-4.2$ psql postgres=# \password postgres Enter new password: **** Enter it again: **** Create user #> su - postgres -bash-4.2$ psql postgres=#CREATE USER myNewUser WITH PASSWORD 'password'; Create DB  #> su - postgres -bash-4.2$ psql postgres=# CREATE DATABASE mydbname OWNER postgres; Update the authentication method to md5 (required to connect through pgAdmin3 tool) #> vi /var/lib/pgsql/data/pg_hba.conf Change the following from peer to md5. #> # "local" is for Unix domain socket connections only      local       all                     all                     md5 RESTART the postgreSQL service Open pgAdmin3 and try to connect with a vali

Compile NodeJS from source on Debian (linux)

Steps wget http://nodejs.org/dist/v0.10.16/node-v0.10.16.tar.gz    /// Downloads the source tar -zxf node-v0.10.16.tar.gz  ///extract to local folder su   /// switch to root apt-get install build-essential   ///This command installs the c compiler and other essential build tools.  ./configure && make  /// builds the source

Universal Plug and Play (UPnP) with NodeJS

Image
Introduction UPnP architecture allows devices to device communications among home entertainment devices, consumer electronics devices, wireless device etc. This uses UDP port 1900 and TCP port 2869. Participating devices use Simple Service Device Discovery protocol ( SSDP ) to discover other devices. Enable UPnP in Windows 7 Window 7 support UPnP for sharing videos, photos, and files to other supported devices including Smart TVs, SetTopBox devices etc. Go to Control Panel\All Control Panel Items Network and Sharing Center Choose home group and sharing options Create a homegroup Select the options you wish to enable and click Next Write down the password and 'Finish' Now your pc is set up as a UPnP enabled devices Install NodeJS  The sample code discussed here require nodejs to run. You may find the installation details here (NodeJS) . Search This sample I used is inspired from this github - https://gist.github.com/chrishulbert/895382. This is goo

Web Workers

NB: This is not about web developers or software engineers; though there are some similarities in behaviors of these two.  Web Workers are new set of APIs introduced with HTML5 specifications. This enables web pages to run (long running) scripts in the background threads. Web workers brings following advantage in HTML/ Java Script world.  Running tasks (specially time consuming jobs or repeated jobs like status check etc) behind the scene while UI is interactive to the users. A task parallel programming approach which enable the developers to make use of increasing usage of multi-core processors in the PC/laptop world. Not implemented through loops; but uses message notification mechanism to communicate to and from the main UI thread. Creating a worker    Spawning a working in JavaScript is simple; just need to call the "Worker()" constructor with a URI of script to execute in the worker thread. var worker = new Worker("worker.js"); There are two ma

Cross Domain RESTful Service in WCF

Image
I had to write a REST API last week, which needed to be accessible from webpages hosted in multiple domains. I thought of writing down one of the technique I followed from the web standard. So, I am going to explain how to create a WCF service, make it RESTful and how to structure it in a way such that you can use/call it from webpage hosted in any domain. Most common examples of this usage is google map, bing map APIs.  Common web standard to make sync/async calls to the service is to use XMLHttpRequest object directly and get the result back in the response text; then use the result accordingly in the page logic. You may use JSON formated request/response in the service to make it easy to use in the web page; specially because almost all the browser has the native support of JSON in JavaScript.   A limitation associated with XMLHttpRequest object is that it will not allow you to access a webpage/service from a different domain other than the host of currently served page. W