Wednesday, February 25, 2015

A Cool Way To Identify Song Name From Tune Using PC Online

Few days back I heard a famous soundtrack while watching a Korean drama. I heard it before, but I didn't know the soundtrack name. I liked it so much that I thought this time I needed to find the track name and listened to the whole music. So I started looking for online music identifier. Top search results returned mainly IOS or Android apps. There were some services also that can be used in PC, but you need to sing the song or hum the tune in microphone to match the results with their online music databases. I am a terrible singer. And I didn't want to go through the trouble of configuring stereo mix to put music from my computer to microphone. So I was looking for a online music community where I can upload part of a song or tune and somebody can identify it. And I wanted a community that is active enough to get a quick response. Looks like WatZatSong is just like that.

I registered and uploaded the mp3 tune and it was identified within 15 minutes. The tune was a famous one Chariots Of Fire by Vangelis. So it may have been identified quickly. But I checked the community. Looks like they have enough active users who are willing to listen to tunes uploaded by other users and identify them. If the song you are looking for is kind of well-known, you can expect somewhat quick response. So if you are trying to find the original song or music name by a partial tune that you have got from some other medium like tv series or movie or advertisement, you can try this service.

Friday, February 20, 2015

How To Find Out Size Of A Key In Redis

Redis can do special encoding for some data types to save space while storing data in memory. So if you want to know the actual memory space occupied by a key value in redis server, use the following command:


For example, look at the following command and output:

redis localhost:6379> DEBUG OBJECT sample_key
Value at:0x7f36f2980900 refcount:1 encoding:raw serializedlength:4 
lru:582042 lru_seconds_idle:1423688

Here serializedlength is 4. That means the value is taking up 4 bytes of memory in redis server after it gets serialized and stored. This command can be pretty useful if you want to check some particular type of keys take up how much memory generally when their data gets stored in redis.


Sunday, February 15, 2015

How To Force Shutdown Samsung Galaxy Tab

I just faced this problem with my Samsung Galaxy Tab 3. I installed few Flash supported browsers for Android like Phantom Browser and Dolphin Browser. Then I opened several videos in multiple tabs. And my Galaxy Tab started hanging intermittently. I tried to shutdown my tab, but it didn't work. Generally you need to press and hold power button for about 3 seconds to get the shutdown menu. As it didn't work, I tried installing few Android Shutdown apps from Google Play Store to shut it down programmatically. But those apps needed root access that I don't have and don't know how to get that permission.
But there's a way around. Just press and hold the power button for about 10-15 seconds. Then Galaxy Tab will be rebooted. After rebooting, your Galaxy tab will start normally and you can try shutting it down by pressing power button for a few seconds. It should work now.

Saturday, February 7, 2015

How To Monitor Involuntary Context Switches In Linux

As you know, high involuntary context switches is a sign that your application has more threads to run than number of virtual processors available in your machine. Monitoring non voluntary context switches in Linux is easy. Just use "pidstat -w" command. You will see similar output as below:

Keep an eye on cswch/s and nvcswch/s columns. cswch/s indicates number voluntary context switches per second for a particular process, whereas nvcswch/s shows number of involuntary context switches per second for a process.