Huge Discounts on Mobiles, Books, Cameras, Computers etc: @Flipkart
Flipkart.com

Monday, June 08, 2015

Windows 8.1 Pro on a USB Drive

Xubuntu and Kodi on i3 NUC was nice. But I often run into issues and is quite time consuming to get things straight (perhaps because I am not a Linux expert too!). Anyway, everything was configured, up and running with Xubuntu 14.10 and the new 15.04 release came and messed things up. The sound doesn't work after the upgrade, I see only a Dummy Output! Searching on forums, I see many people reporting this issue, but no solution than to downgrade. Also had some HDMI sync issue every time I start my home theater receiver (keep the NUC running 24x7) too and was getting tired of linux on NUC! Intel provide very few drivers for linux. So it was time to give Windows a try :-)

Usually windows is very easy to setup, but I had a major challenge! I don't have a hard disk and Windows doesn't support installing to USB drives (or even portable HDD connected via USB). Btw, if you want to create a bootable Windows installer on USB, use the rufus utility and the Windows install ISO. It is like the LiLi for windows :-)

Thanks to Google, found that there is a Windows to Go option, though officially supported only for Enterprise edition. You can get it to work for other editions using a utility called WinToUSB. Though it seemed to save the day, Windows 8.1 Pro was not booting up, it was stuck on the logo with the progress spinning for ever! Finally got it to work using the VHD (vs Legacy) option supported by WinToUSB while creating the usb installer.

Now I got Windows on my NUC and everything works quite well, especially with all the wonderful intel drivers! Kodi works quite well too (Note: use WASAPI instead of DirectSound for clean unadulterated sound)

Note: You need to activate the windows with a valid key


Clone your bootable usb drive in minutes!

I have an Intel i3 NUC which runs Xubuntu full install on a Sandisk Extreme 16GB USB 3.0 stick. It doesn't have a hard disk :-) Everything was working fine (mostly use it to share hdd, printer etc and also as a media player - Kodi/XMBC), until it ran out of space trying to upgrade from Ububtu 14.10 to 15.04. So I bought a new Sandisk Ultra Fit 64GB USB 3.0 and was finding it hard to setup everything from scratch and reconfigure/customize it. I wanted to give Kubuntu a try, but install failed as it was not able to partition the USB drive (don't remember, but I think I was able to boot and install Xubuntu into same drive). I didn't want to waste anymore time and just wanted to get things going quickly. Was looking for easy ways to clone and found this!

There is a command called dd and using it I could clone my usb disk and boot from the new one in about 10-15 minutes!

The syntax is as follows:
dd if=/dev/sdc of=/dev/sda
Make sure you give the whole device (sdc vs sdc1) and not a partition. Also double check the source and target device names (sda/sdb/sdc) before you start the command.

Couple of things to keep in mind:

  • Target has to be same size or larger than source. If larger you can resize partitions later
  • boot record will be copied only if you clone whole device vs a partition
  • You can use the UI (eg: Disks) or sudo fdisk -l to find out the device names
  • You can optimize transfer by setting block sizes, eg: sudo dd if=/dev/sdx of=/dev/sdy bs=8M

Source:

Target:

You can see that after the operation, I have the same partitions from the 16GB drive on my new 64GB one. To resize existing partition, I removed the swap, resized main (leaving some space for swap at the end) and then created swap at the end. This was done using GParted.


Hope it saves many hours or days of yours, have fun!

Thursday, April 16, 2015

Getting started with ElasticSearch

Elasticsearch is a search server based on Apache Lucene. It provides a distributed, multitenant-capable full-text search engine with a RESTful web interface and schema-free JSON documents. Elasticsearch is developed in Java and is released as open source under the terms of the Apache License. Elasticsearch is the second most popular enterprise search engine, at the time of this post.

Elasticsearch can be used to search all kinds of documents. It provides scalable search, has near real-time search, and supports multitenancy. Elasticsearch is distributed, which means that indices can be divided into shards and each shard can have zero or more replicas. Each node hosts one or more shards, and acts as a coordinator to delegate operations to the correct shard(s). Rebalancing and routing are done automatically. Notable users of Elasticsearch include Wikimedia, GitHub, Stack Exchange, Netflix, The Guardian etc

But Elasticsearch is not just for mega-corporations. It has enabled many startups like Datadog and Klout to prototype ideas and to turn them into scalable solutions. Elasticsearch can run on your laptop, or scale out to hundreds of servers and petabytes of data. No individual part of Elasticsearch is new or revolutionary. Full-text search has been done before, as have analytics systems and distributed databases. The revolution is the combination of these individually useful parts into a single, coherent, real-time application. It has a low barrier to entry for the new user, but can keep pace with you as your skills and needs grow.

You can find a very useful Getting Started Guide here:
http://www.elastic.co/guide/en/elasticsearch/guide/master/getting-started.html

If you are impatient, this You Tube Video helps you get started quickly: Getting started with ElasticSearch

Note: The syntax of the settings posted at 24:54 of the video doesn't work as there are some changes in version 1.5.1 I used. Refer this link for correct usage: Using Synonyms

I would suggest Sense plugin for Chrome to easily explore elastic search:
https://chrome.google.com/webstore/search/sense
https://www.found.no/foundation/Sense-Elasticsearch-interface/

Alternatives are RESTClient for firefox and Fiddler for pretty much any platform.

You can use the head plugin for Elasticsearch to monitor and manage the server,

You can find all the REST commands below for easy copy-paste if you want to follow the video and try hands-on.

Add Sample Data


POST /places/restaurant
{
    "name" : "Joes Italiana",
    "description": "Best pasta around",
    "address": {
        "street":"464 S Main St",
        "city":"Los Angeles",
        "state":"CA",
        "zip":"90013"
    },
    "location":[34.023954, -118.3927072],
    "tags":["italian","spaghetti","pasta"],
    "rating": "4.5"
}
    POST /places/restaurant
{
    "name" : "Jose's Taco Shop",
    "description": "Best Tacos in SoCal",
    "address": {
        "street":"950 Vine St",
        "city":"Los Angeles",
        "state":"CA",
        "zip":"90038"
    },
    "location":[34.088186, -118.326603],
    "tags":["mexican","tacos","burritos"],
    "rating": "4.0"
}
POST /places/restaurant
{
    "name" : "Berry's Burritos",
    "description": "Best Burritos in New York!",
    "address": {
        "street":"230 W 4th St",
        "city":"New York",
        "state":"NY",
        "zip":"10014"
    },
    "location":[40.7543385, -73.976313],
    "tags":["mexican","tacos","burritos"],
    "rating": "4.3"
}
POST /places/restaurant
{
    "name" : "Steve's Italian Restaurant",
    "description": "Great food, great atmosphere",
    "address": {
        "street":"46 W 46th St",
        "city":"New York",
        "state":"NY",
        "zip":"10036"
    },
    "location":[40.751624, -73.9783865],
    "tags":["italian","spaghetti","pasta"],
    "rating": "3.5"
}

Various forms of Search and Filter

POST /places/restaurant/_search
{
    "query":{
        "match_all": {}
    }
}
POST /places/restaurant/_search
{
    "query":{
        "query_string": {
           "query": "tacos"
        }
    }
}
POST /places/restaurant/_search
{
    "query":{
        "query_string": {
           "query": "tacos",
           "fields": ["tags"]
        }
    }
}
POST /places/restaurant/_search
{
    "query":{
        "query_string": {
           "query": "taco",
           "fields": ["name"]
        }
    }
}
POST /places/restaurant/_search
{
    "query": {
        "filtered": {
           "query": {
               "query_string": {
                   "query": "tacos",
                   "fields": ["tags"]
                }
           },
           "filter": {
               "range": {
                  "rating": {
                     "gte": 4.0
                  }
               }
           }
        }
    }
}
POST /places/restaurant/_search
{
    "query": {
        "filtered": {
           "filter": {
               "range": {
                  "rating": {
                     "gte": 4.0
                  }
               }
           }
        }
    }
}
 
POST /places/restaurant/_search
{
    "query": {
        "filtered": {
            "query": {
                "match": {
                   "address.state": "ny"
                }
            },
            "filter": {
               "range": {
                  "rating": {
                     "gte": 4.0
                  }
               }
           }
        }
    }
}

Clear Index

DELETE /places

Rebuild index with Synonym support

POST /places
{
"settings": {
"analysis": {
"filter": {
"synonym": {
"type": "synonym",
"synonyms_path": "synonyms.txt",
"ignore_case": "true"
}
},
"analyzer": {
"synonym": {
"tokenizer": "whitespace",
"filter": ["synonym"]
}
}
}
},
"mappings": {
"restaurant": {
"_all": {
"enabled": true
},
"properties": {
"address.state": {
"type": "string",
"analyzer": "synonym"
},
"location": {
"type": "geo_point"
}
}
}
}
}

Bulk Insert of Data 

POST /places/restaurant/_bulk
{"index":{}}
{ "name" : "Joes Italiana", "description": "Best pasta around", "address": { "street":"464 S Main St", "city":"Los Angeles", "state":"CA", "zip":"90013" }, "location":[34.023954, -118.3927072], "tags":["italian","spaghetti","pasta"], "rating": "4.5" }
{"index":{}}
{ "name" : "Jose's Taco Shop", "description": "Best Tacos in SoCal", "address": { "street":"950 Vine St", "city":"Los Angeles", "state":"CA", "zip":"90038" }, "location":[34.088186, -118.326603], "tags":["mexican","tacos","burritos"], "rating": "4.0" }
{"index":{}}
{ "name" : "Berry's Burritos", "description": "Best Burritos in New York!", "address": { "street":"230 W 4th St", "city":"New York", "state":"NY", "zip":"10014" }, "location":[40.7543385, -73.976313], "tags":["mexican","tacos","burritos"], "rating": "4.3" }
{"index":{}}
{ "name" : "Steve's Italian Restaurant", "description": "Great food, great atmosphere", "address": { "street":"46 W 46th St", "city":"New York", "state":"NY", "zip":"10036" }, "location":[40.751624, -73.9783865], "tags":["italian","spaghetti","pasta"], "rating": "3.5" }

Synoym Search 

POST /places/restaurant/_search
{
    "query": {
        "filtered": {
            "query": {
                "match": {
                   "address.state": "new york"
           
    }
            },
            "filter": {
               "range": {
                  "rating": {
                     "gte": 4.0
                  }
               }
           }
        }
    }
}

Geospatial Search

POST /places/restaurant/_search
{
    "query": {
        "filtered": {
            "filter": {
               "geo_distance": {
                  "distance": "100km",
                  "location": [40.7894537,-73.9481288]
               }
           }
        }
    }
}

POST /places/restaurant/_search
{
    "query": {
        "filtered": {
            "filter": {
                "bool": {
                    "must": [
                        {
                           "range": {
                              "rating": {
                                "gte":"4.0"
                              }
                           }
                        },
                        {
                            "geo_distance": {
                              "distance": "100km",
                              "location": [40.7894537,-73.9481288]
                            }
                        }  
                    ]
                }
           }
        }
    }
}

Getting just Count

POST /places/restaurant/_count
{
    "query":{
        "query_string": {
           "query": "tacos"
        }
    }
}

Paged Data

POST /places/restaurant/_search?size=1&from=0
{
    "query":{
        "query_string": {
           "query": "tacos"
        }
    }

Saturday, April 11, 2015

Dash Cam G1WH Firmware Update


A Dash Cam is an invaluable asset when you run into an accident, like your insurance. It can provide critical information on how an accident happened and who is at fault. Apart from that, it may also record interesting things from the road like UFOs and funny moments :-)

There is a huge array of dash cams in the market with varying price and features. G1WH is a cheap Chinese cam which surpasses many leading manufactures in video quality, at half price or even less.




You can find heaps of reviews and praises online on this model:
http://thewirecutter.com/reviews/best-dash-cam/
http://www.techmoan.com/blog/2013/12/16/g1w-the-cheapest-dash-cam-thats-worth-buying.html
https://dashcamtalk.com/g1w/

There are currently 3 versions of G1W and mine is G1WH. It uses an all black case (more discreet) and has slightly wider angle of view (140 vs 120). All are based on the popular Novatek NT96650 processor and the Aptina AR0330 CMOS sensor.

I was having some issues with this though. The build quality is ok, but not the best. The mount tend to become loose easily and cam may fall off on receiving quick jerks. Also it is not recording reliably (switches off automatically after some time) and this can be fixed by turning off Motion sensor and reducing the G-Sensor sensitivity to Low/Med. Some people also had recording issues with some Class 10 memory cards, so a Class 6 branded (Samsung/Kingston/Sandisk) micro SD card is best suited. Also be warned that there are many fakes in the market (eBay/Amazon). Better to buy from gearbest.com or banggood.com.

There are many firmware updates and custom firmware available for the G1WH model. The updates provides you more fixes and even new features like entering your license plate number to be stamped with date, higher bit rate etc.

Here is supposedly the newest firmware for G1WH. The default language is Polish, but you can change it via the menu.
http://reliabledownloads.org/file/05JxN
Credits: http://vat19.pl/pl/blog/informacje/15-Firmware.html

It adds the following features:
  • Increased recording bitrate files (such as DVRs DOD) 
  • Polish language menu 
  • Added function car plate (not present in older versions) 
  • More stable operation 

My cam came with Firmware version 2014.0509, in case you screw up you can revert to it here:
http://reliabledownloads.org/file/05Jxn

NOTE: After updating firmware the menu button was not working for me. Same happened even after reverting to above 2014.0509. If same happens click on the camera button on the top (next to power) and then click Menu.

These are the instructions to update the firmware:
1. Download the firmware file to your computer
2. Unzip the file
3. Format your memory card in your computer (or unit)
4. Copy the bin file to the root of your memory card
5. Change the name of the firmware you would like to flash to FWDM800H (required as the G1WH will not update with bin files with names other then this)
6. Put card into camera
7. Power camera on (make sure the camera is plugged in)
8. The camera will update automatically.  The screen will stay off but the status light will be on; it will take 30-60 seeconds
9. After updating, format the card.

NOTE: Remove the firmware (.bin) from the memory card you would like to use or it will flash every time you start!


Monday, February 16, 2015

Open Command Window Here


When you are doing some hardcore development you may have to run many things in different console (CMD/Command Prompt/DOS) windows. Usually the fastest way is to go to Run, type cmd + Enter and cd to the desired location. There is an even better option. You can open CMD and cd to a folder just by right clicking on the folder and selecting a menu item. The trick is to use Shift + Right Click. This will give you additional options, and one of them is "Open command window here" (Windows 7).



Another very useful tip is to add your most frequently opened folders to favorites so that you see them in the left top of explorer and can open with a single click.


Friday, February 06, 2015

i3 NUC with Xubuntu intermittently freezing while running torrents

My NUC was flying and it was a great relief coming from a Raspberry Pi, which sweats if you do multitasking. I thought of setting up a torrent client on it. Suddenly it started freezing while I was watching a movie in Kodi (latest XBMC). It has never happened before. I checked CPU and RAM, both seem perfectly fine. I knew it was something to do with the torrent client.

Initially I thought perhaps multiple file access to the external HDD is the culprit and may have to eventually get an mSATA drive. USB devices are not very good with simultaneous access. Then I googled a bit to confirm my theory. But I was surprised to find out that the real culprit was the 1024 file descriptor limit in linux.

So I went to the /etc/security/limit.conf and added the following:
userId soft nofile 4096

And that fixed it. Now the torrents are downloading fine (earlier the torrent client used to freeze also). I can smoothly do other things like watching movies too.


Converting a USB printer to a network printer

I recently bought a NUC and has been doing cool stuff with it. I have a Brother HL 1110 mono laser printer which supports only USB. So here is how I made it a network printer.

The NUC has Xubuntu 14.10 (based on Ubuntu). So I setup Samba and enabled file and printer sharing. I use GADMIN-SAMBA for easy configuration via UI.

Here is my Samba configuration:

[global]
     netbios name = nuc
     server string = Samba file and print server
     workgroup = WORKGROUP
     security = user
     hosts allow = 127. 192.168.
     dns proxy = no
     map to guest = bad user

[nas]
     path = /mnt/NAS_HDD1/NAS/
     comment = No comment
     read only = no
     browsable = yes
     writable = yes
     guest ok = yes

[printers]
     path = /var/spool/samba
     printable = yes
     printing = CUPS|LPRNG|...

[print$]
     path = /srv/samba/Printer_drivers
     comment = Printer Drivers
     writeable = yes

From the remote windows machine I add a new printer, select 'Network' type and give the path as \\hostname\printername  eg: \\192.168.0.111\HL1110.

Even if the printer was configured fine, printouts were coming as blank initially.

Go to the Linux driver page of HL1110, and install all three (Driver Install Tool, LPR Printer Driver, CUPS Wrapper printer driver).
http://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=hl1110_us_eu_as&os=128

Make sure that you run sudo, else the driver won't be installed correctly.
sudo bash linux-brprinter-installer-2.0.0-1 HL-1110

If you want to print from a mobile device or even remotely, add this printer to your Google account via Chrome:
https://support.google.com/cloudprint/answer/1686197?hl=en



Wednesday, January 21, 2015

Canon CanoScan LiDE70: Unable to connect to Twain Source

Though there are many decent apps like Cam2PDF/CamScanner etc which uses the phone camera to scan a document, nothing can replace a proper conventional scanner, especially if you are serious and want high quality.

Multi Function Printers (Scanner + Printer) are a waste of money. Instead get a slim flat bed scanner and a compact mono laser printer. Laser printers lasts much longer, especially if you print only occasionally. Inkjet printer head and cartridges dry up and get useless pretty quick, if used scarcely. I have a Canon CanoScan LiDE70 scanner and a basic Brother 1110 mono laser printer, going strong since years!


Usually Windows picks up drivers automatically for both devices. Recently I was trying to setup the scanner in a new laptop with Windows 7 64bit and ran into following error, when using the Canon Toolbox utility: Unable to open TWAIN source. Please check connection. Then re-start Toolbox!


Googling around a bit discovered that it is because the Toolbox software is not able to find the installed driver. You can fix this easily by adding the driver folder to the path.
eg: C:\Windows\twain_32\CNQ2411

So go to Computer -> Properties -> Advanced system settings -> Environment Variables -> System variables -> Path -> Edit and add the above to the end
eg:


Click all OKs and close the Properties, close and reopen the Toolbox utility. It should work fine now!


TIP: If the Toolbox is still not working, try going to 'Devices and Printers', right click CanoScan and 'Start scan' option.

Wednesday, January 07, 2015

NUC Setup for XBMC

After using Raspberry Pi as a media player for almost an year, took the plunge and upgraded to an Intel i3 NUC (Next Unit of Computing). For those who doesn't know, NUC is a very compact computer, which can be used as a light weight PC (can be attached behind a monitor using VESA mount) or as a dedicated device (eg: Media Player, Streamer, NAS etc).

I have used other media players like ASUS, Kaiboer etc before, but have been disappointed by lack of software/firmware updates and how quickly they get dated when new codecs come etc. So decided that will go for only more customizable and versatile platforms only. Raspberry Pi + RaspBMC is a great media player which is really value for money. Though the specs are low, it supports hardware decoding and hence most of the videos work just fine. Low price is the main attraction and there is a great community support. But of late I see my pi sweating a lot when decoding 1080P movies with AAC 5.1 audio. Other Audio codecs like MP3, AC3, DTS  and even AAC 2.0 with 1080p works fine.

Though the Celeron NUC is powerful enough, I wanted to be future proof and have plans to multi-task my NUC. So went for i3 based D34010WYKH, with just 4GB RAM and an 8GB USB3 mem stick as extras. Advantages of a NUC (mini PC) over a PC is its size and much lower power consumption. It mainly uses the laptop/notebook version of hardware to achieve this. Without further adieu, lets dive into the details of the setup.

1) Hardware
D34010WYKH
4GB RAM Kingston (1.35v)
No HDD
USB3 8GB stick
Rii8 keyboard

2) Software
First thing you have to do is to upgrade the BIOS of the NUC. It is quite easy, download the new bios, copy it to a USB drive, start the NUC and press F7. Detailed instructions are available in above link.

Since I would be mostly using it as a media player, free linux is a much better option that paying for a Windows license. A linux distro with a decent UI system is a better option than going too light like OpenElec or Ubuntu Server. So I chose Xubuntu 14.10. Xubuntu is basically Xfce + Ubuntu. Download latest Xubuntu 64 bit iso, use something like LiLi to create a bootable USB installer. Once you install Xubuntu, you need to install the latest Intel HD4400 Graphics driver for ubuntu.

But the intel graphics driver installer won't work as it currently supports only upto Ubuntu 14.04 and above Xubuntu uses 14.10. So you should either downgrade the version or just temporarily tweak it in the file /etc/lsb-release and rerun the installer.
eg:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.10
DISTRIB_CODENAME=utopic
DISTRIB_DESCRIPTION="Ubuntu 14.10"

change to
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=utopic
DISTRIB_DESCRIPTION="Ubuntu 14.04"

Note: always a good idea to create a copy of any file you change as backup. Easy to revert if you screw up.  Eg: cp /etc/lsb-release  /etc/lsb-release.backup

Once you do this, you can install VNC (eg: Vino VNC), FTP etc on the server to make it easily accessible over the network. 

But there is a bug with intel graphics. It doesn't seem to redo HDMI handshake when you switch display. For example: I use an HK receiver which is connected to a JBL 5.1 system and a projector. It has an HDMI switcher (4 in, 1 out) and I use other sources like the old pi, a TV Tuner DVR etc. Also I leave the NUC always on, but switch off the receiver. Due to this bug, I had to restart my NUC every time I start the receiver or switch sources. Then I found a hack that just restarting the XServer would do the resync. So created the below script and created a keyboard shortcut to run it, so that I can execute by pressing a key on my full keyboard remote (Rii8)

restartX.sh
#!/bin/bash
echo "Restarting X "
echo 'YOUR_SU_PASSWORD'| sudo -S /sbin/restart lightdm



Once all the above setup is done, you can install latest XBMC following the instructions here:
http://kodi.wiki/view/HOW-TO:Install_Kodi_for_Linux#Ubuntu

I created a shortcut for XBMC and kept it in the desktop. I just launch it whenever I need XBMC, you may also launch it via a keyboard shortcut.

I also use the NUC as a print server by connecting a cheap USB mono Laser printer (Brother HL1110) to it. Initially I thought of setting up a full fledged NAS, but later realized it is more flexible to just replicate only part of the disk (I use two external 2 TB USB 3.0 portable HDDs). This way I can detach the disk and carry it around when I go for trips, and I just backup only my personal photos, videos etc and leave all the movies and other junk just in one disk. I use luckyBackup for syncing contents between the disks.

Tuesday, January 06, 2015

Changing Title of Command Prompt

Sometimes it is annoying when you can't easily distinguish which is what, when you work with multiple Command Prompt consoles in Windows. For eg: may be you are working on multiple nodejs applications and all your command prompts show the title as : "C:\windows\system32\cmd.exe - node app.js".

You can easily fix this using the TITLE command in DOS. In the console, just type "TITLE My App1" and press enter. Voila, you would see that the command window title now changed to "My App1". So next time you start nodejs, it would be "My App1 - node app.js"

Ain't that a cool way to be easily organized and avoid the frustration?!


More info:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/title.mspx




Tuesday, July 01, 2014

How to find Serial Number?


Wonder how you can find a machine's serial number via a simple command? Especially helpful if you want to use it in a script or want to find the serial number of a remote machine. Or may be you just don't want to get under the desk to find it from behind the machine! It is as simple as this:

Windows:
wmic bios get serialnumber

Linux:
dmidecode -t system | grep Serial

Note: The above command should be run from a shell. Eg: Type cmd in Run ( Win+R) for Windows.



Saturday, May 31, 2014

How to denote that your link opens in a new Window?

I like to know whether a link would open in a new window or not, before I click a link. I think it is a good practice (especially for accessibility) and I think all browsers should do it automatically. Though the recommended practice is not to open links in another window (as it breaks back button navigation), we may have to do it some times, especially when we link to external websites. Here is a really neat way to do it, without any code changes, just via CSS (easy to remove if you change mind later).

a[target]::after {
    margin-left: 5px;
    content: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODI2LjQyOSAtNjk4Ljc5MSkiPjxyZWN0IHdpZHRoPSI1Ljk4MiIgaGVpZ2h0PSI1Ljk4MiIgeD0iODI2LjkyOSIgeT0iNzAyLjMwOSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDZjIi8+PGc+PHBhdGggZD0iTTgzMS4xOTQgNjk4Ljc5MWg1LjIzNHY1LjM5MWwtMS41NzEgMS41NDUtMS4zMS0xLjMxLTIuNzI1IDIuNzI1LTIuNjg5LTIuNjg5IDIuODA4LTIuODA4LTEuMzExLTEuMzExeiIgZmlsbD0iIzA2ZiIvPjxwYXRoIGQ9Ik04MzUuNDI0IDY5OS43OTVsLjAyMiA0Ljg4NS0xLjgxNy0xLjgxNy0yLjg4MSAyLjg4MS0xLjIyOC0xLjIyOCAyLjg4MS0yLjg4MS0xLjg1MS0xLjg1MXoiIGZpbGw9IiNmZmYiLz48L2c+PC9nPjwvc3ZnPg==);
}

<a href="http://google.com/">Open in this window </a>
<a href="http://google.com/" target="_blank">Open in another window </a>

This is how it would look. Notice the icon towards the end of the second link. Many well known websites (eg: Wikipedia) do this.



Wednesday, April 16, 2014

How to add a custom system property to WAS (WebSphere Application Server) 7

Struggling to add a custom environment property to WAS? Tried editing startServer/setupCmdLine batch/script files and failed? Here is how you can do it easily from the Admin Web Console

Go to admin console:
eg: https://localhost:16316/ibm/console

In the admin console:
Application servers -> (server name) -> Server Infrastructure, Java and Process Management, Process Definition -> Java Virtual Machine -> Custom Properties.

Note: The exact sequence may vary depending on what version of Websphere you are using.

The entries you make here are system properties (not environment variables and not WebSphere variables). They can be accessed via System.getProperty().

More Info: http://pic.dhe.ibm.com/infocenter/rtc/v2r0m0/index.jsp?topic=%2Fcom.ibm.jazz.install.doc%2Ftopics%2Ft_s_server_installation_setup_WAS.html


YUM: Error: Cannot retrieve repository metadata (repomd.xml) for repository

Screwed up your yum? Here is a quick way to fix by cleaning it up:

View repolist:
yum repolist all

Clean cached package downloads/headers:
yum clean all

Disable a repo temporarily:
yum --disablerepo epel install htop

Disable a repo permanently:
Remove or comment it out in: /etc/yum.repos.d/

More info:
http://docs.oracle.com/cd/E37670_01/E37355/html/ol_creating_yum_repo.html
http://www.tecmint.com/20-linux-yum-yellowdog-updater-modified-commands-for-package-mangement/
http://forums.fedoraforum.org/showthread.php?t=223472
https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-Managing_Yum_Repositories.html
http://www.centos.org/docs/5/html/yum/sn-yum-maintenance.html

Task Manager for Linux

New to Linux and missing a graphical task manager like the one in Windows?

Try Htop (Linux Process Monitoring)

Htop is an interactive and real time process monitoring application for Linux. It shows complete list of processes running and easy to use for normal tasks.

For RHEL, CentOS & Fedora 64-bit OS
## For RHEL 5, CentOS 5 & Fedora ##
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
# rpm -ihv rpmforge-release*.rf.x86_64.rpm

## For RHEL 6 and CentOS 6
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -ihv rpmforge-release*.rf.x86_64.rpm

Note: update above command to use the latest version of RPMforge.

Once RPMforge repository is installed. Now start installation with yum command.
# yum install htop


For more info, visit:
http://www.tecmint.com/install-htop-linux-process-monitoring-for-rhel-centos-fedora/
http://linuxlookup.com/howto/view_running_processes_linux_system

You can always see running processing in the console using the following command:
ps aux | less

The pstree command is similar to ps in that it can be used to show all of the processes on the system along with their PIDs. However, it differs in that it presents output in a tree structure that shows how processes are related to each other and in that it provides less detailed information about each process than does ps

Wednesday, May 08, 2013

Nexus 7 stuck at 0% battery?

I had this weird problem that the Nexus 7 always shows battery level as 0%. When connected to a charger, it doesn't say charging too. I could still use it fine for hours though!

Fixed it by securing the battery connector, shown in previous post.

So here are different fixes for you:
1) Take the back cover off and make sure that the battery cable is pushed all the way into the socket (worked for me)

2) Disconnect the battery cable carefully, hold the power button for about 10-15 seconds with the battery unplugged, this creates a static reset, using all of the electricity in the device and discharging it fully

All the best!

Sunday, March 31, 2013

Nexus 7 Dead - Won't Start

Bought a Google (Asus) Nexus 7 Tablet in March 2013, via a friend who came from US. I paid $299 (+ shipping & tax = $339). It is the 3G model with 32GB internal memory (there is no support for external memory, like Micro SD cards).

More info: http://www.google.com/nexus/7/

This is supposedly the most powerful 7" tablet around. Spec wise it is way powerful than the Apple ipad mini too. Here is a quick look at the technical details:

SCREEN
7" 1280x800 HD display (216 ppi)
Back-lit IPS display
Scratch-resistant Corning® glass


CAMERA
1.2MP front-facing camera


CPU
NVIDIA® Tegra® 3 quad-core processor


SENSORS
Microphone
NFC (Android Beam)
Accelerometer
GPS
Magnetometer
Gyroscope


OS
Android 4.2.2 (first to get updates)


MEMORY
16/32 GB internal storage
1 GB RAM


WIRELESS
WiFi 802.11 b/g/n
Bluetooth
NFC (Android Beam)
3G

One of the coolest features of Android 4.2.x is multi-user. Like Windows etc, multiple users can have personal profiles, enhancing customization, personalization and security. This is really cool if you share the device with others in the family.

One tablet, many users.

It’s your fully customized tablet. And theirs, too. With support for multiple users, you can give each person their own space. Everyone can have their own homescreen, background, widgets, apps and games – even individual high scores and levels! And since Android is built with multitasking at its core, it’s a snap to switch between users – no need to log in and out. Available only on tablets.
Nexus was not launched in India until recently. Now basic model of Nexus 7 is available for purchase from google store directly. Nexus 4, Nexus 10 or other models of Nexus 7 like 32 GB, 3G etc are still not available.

Nexus gives you the best return for the money spent. But it is not rock solid as an iPad. An iPad can take severe beatings and still works reliably. Most common Nexus 7 issues are start up issues. It usually happens when battery is drained completely. Easiest way to prevent is to charge when battery is low, instead of waiting for the device to shutdown automatically! 
It happened for me too. Nexus 7 switched off by itself, complaining low battery. Then it didn't start, even after charging overnight. Searched online for common problems and solutions. None of it worked. Finally saw a comment from someone in a forum that it could be because the battery connections came out (usually happens if you drop the tab). Split the Nexus 7 open and voila it fixed my problem. 
Here are the details:
Problem: Nexus 7 won't startup after auto shutdown
Solution:
1) First try a force reboot. Disconnect power cable and press down power button for 30 seconds. If lucky you will see the Google logo and your Nexus will start up fine! You can try again after charging for 2 hrs.
2) Connect power cable, immediately press Power + Volume Down buttons simultaneously for 30 seconds. It should boot into recovery mode with options to do factory reset etc.
If the above didn't help, you need to get your hands dirty. For me doing the above steps just turned screen on/off/flickering etc, but nothing came (no Google logo etc). Screen was just lit, nothing on it. While charging also screen would bleed light. 
So I carefully opened the back of Nexus 7, by wedging my nail thru it. If you don't have a strong nail, you can try a small knife or anything thin. Unhook the latches and remove the back cover. Examine the battery connector. For me it was loose and when I pushed slightly, it locked into the socket firmly with a click. Here is a picture of the same.

Put back the cover, pressed power button and it worked like a charm!

Wednesday, April 11, 2012

Migrating Contacts: Nokia to Android

I was trying to migrate all my Contacts from Nokia 5130 Express Music phone to Android Galaxy Spica (I5700) and found that it is not very straight forward. Latest Nokia Suite doesn't even allow you to export contacts (guess they are concerned about too many people leaving to Android and want to make the move as difficult as possible!).

After some research and digging around found how to do it. Here are the steps:

1. Install the older version of Nokia PC Suite which allows to copy contacts as VCF files
http://download.cnet.com/Nokia-PC-Suite/3000-2120_4-10824148.html

2. Connect your Nokia phone via USB cable (preferably) and open Contacts


3. Select all the contacts (Ctrl + A), right click and 'Copy' or Ctrl + C.

4. Go to windows explorer and paste into a new folder - each contact will appear as a .vcf file.

5. You need to merge all these into one file to easily import into Google Contacts. Open a command prompt (Run -> cmd), go to the above directory where you copied vcf files and run this command:
C:\Nokia_Contacts> copy /B *.vcf all.vcf


6. Now go to Google Contacts and select More -> Import
https://www.google.com/contacts/


7. Select the merged vcf and now all your contacts will be imported into Google. Configure this id in Android sync and these contacts will soon appear on your new Android phone. 

Don't you just love that your contacts are available on the web any time and is not lost even if something happens to your Android phone?!! And next time you buy a new Android phone, all you need to do is just configure your gmail id!

Wednesday, February 08, 2012

Copying between computers?

Atleast once in a few years you would run into this scenario. You bought a new computer/laptop or at work you got a new system and now you have to copy over the whole data (100s of GBs) in a few days! Migrating to a new machine is not an easy task. It consumes a lot of time, energy and patience :-)

Every time I run into this issue, I try to discover the best way to do so. As years go by, technology improves and we have better and faster ways to do it. Find below various methods I tried and my take on the best approaches...

Disk Clone:
There are a lot of disk clone tools available which would replicate your disk as is. But it has drawbacks as well, what if you have an OS pre-installed. Also if your current disk has errors/bad sectors cloning could fail.

Backup/Sync Tools:
Each sync tool pose some challenge. For example, some tools copy into complex proprietary binary formats and you can't even browse or choose particular files from the backup. Also generally such tools take more time since it compresses and maintains logs etc. I tried SyncToy from Microsoft after evaluating many, but it was painfully slow!

Network copy:
This is pretty straight forward! Connect both systems on your home/office network and copy files thru network shares/mounts. This is quite time consuming and could choke your network.Also you can't pause/resume and might have to wait for hours (or days) before you can take away your laptop for example.

Peer-to-Peer copy:
New generation network cards are very smart. Earlier you had to use a twisted pair cable to network directly without a router. Now you can use your normal network cable and it would establish a P2P direct connection. This doesn't go thru your network and would be considerably faster. You would get an IP similar to 169.254.59.224..

Assuming you established the network, what is the best way to copy the large number (1000s) of files? You can create a network share and open it or map as a drive and use normal Windows copy. Bad idea, it would take a looooooot of time! Also make sure you turn off your antivirus and firewall (at your own risk) to speed it up a bit. I tried using some copy tools (Teracopy, ExtremeCopy, FastCopy.. etc) but ended up having weird errors from Windows like not enough server storage etc. I found that a better option (seems faster too) is to use FTP. You can download a free FTP server and client (I chose Filezilla) and this way you can copy either way easily. Filezilla supports sync browsing, directory comparison etc too. Expect around 8 MB/s.

Though FTP via direct networking was working pretty well, I still had to keep my both laptops connected for a long time! So finally I ended up using a big fast USB external drive. This option along with an enhanced copy tool like TeraCopy turned out to be the smartest option ;-) TeraCopy increases default file throttle like buffer, speed etc and handles errors (file exists, file in use etc) gracefully without interrupting overall copy process. But there could be cases where you left it overnight and after 10 minutes it paused with some prompt... lol! Though I have to copy twice (Machine1 -> USB HDD -> Machine2), in the process took a backup of my data too!! Also I achieved speed in the range of 15 MB/s. Double the speed of direct connection (half the time), so not a bad deal.


Another option you can try is to use a Firewire cable for direct connection. Firewire could be much faster than USB and you would be copying directly between machines!

Friday, June 18, 2010

Unlocking PSP 3003

  












Last week I had to help my nephew unlock his new PSP 3003. Here are the details, hoping it would help someone else too :)

First of all PSP 3003 is non-hackable (permanently). But still there are work arounds. There is a hack called ChickHen, run ChickHen and then load the cracked firmware in ChickHen (loading directly will brick your PSP), and after this you will be able to load games from ISO files. Else PSP will let you play games only from the UMD, meaning you will have to buy the original version of the games. If you unlock PSP, you can download games as ISO files, copy to your mem card and run from it.

Check here first whether your PSP model can be hacked and how:

Step 1 - Download & Install ChickHen
Follow the instructions here:

Step 2 - Run ChickHen
This is very tricky, it is quite hard to load the ChickHen. Most of the times, the PSP will just shutdown while loading ChickHen. I had to do the following to get it to load, after numerous unsuccessful tries:
1) Create two extra gifs (just copy any two gifs and rename to ChickHENe.gif, ChickHENf.gif), to the ChickHEN folder
2) I found this step from a video, couldn't find it in any website... 
   a) When you open the Images -> Memory Stick, wait till the thumbnail/preview come on the ChickHEN folder, before you open it 
      b) Open ChickHEN folder, scroll all the way to the bottom
    c) Keep doing left-right-left-right.... (flick the left and right controls) continously until it pause and loads ChickHEN

Step 3 - Download, copy and load cracked firmware (5.03 GEN-A/B/C)
Follow the instructions here:

Step 4 - Load the game ISO and enjoy!!!!

Note: This is not a permanent hack. If you shutdown (power off) your PSP, you will have to start again from Step 2 (Run ChickHen). So use stand by (instead of power off) and make sure you don't run out of battery completely ;-)