RSS
 

What are the common myths about Arvind Kejriwal?

01 May

View Question on Quora

 

Day 3, 250km from Narsignpur via Seoni to Nagpur by NH26 and NH7

24 Apr

Started after breakfast at 12.30 noon after finishing some office Skype calls and some commits. Joined back to NH26 that was going via Seoni to Nagpur. Another route which is NH26B was not recommended by people there. Early the stretch is good till we reach the reserve forest area and Ghats. The road changes from NH26 to NH7 and then to single lane all along the poonch forest tiger reserve area. The traffic is not heavy but the road is bad so average speed drops to ~30kmph all through. There are 2 tolls at ~Rs.60.

There are no fuel stations even here until a city is reached at the other side of the forest. There are some dhabas inside the forest and also at the other corner. The RTO had a major checking at the forest exit which has caused a traffic jam. The first is not dense, just bushes and trees but mostly dry. There were no spotting of anything along the route. The ghat route before the forest had slowed down the car to the speed limit of 50. There we few very long zig zag turns along that section and speed should be dropped in that section. The ghats still had very good condition 4 lane roads. Only the forest area has single lane no divider road.

Strangely, both Airtel and Vodafone are giving a fair EDGE network in the forest area for the most part through for some distance there is no network at all.

We reached Nagpur at about 8pm.

 

Day 2, 400km from Dabra to Jhansi via Sagar to Narsignpur by NH26

22 Apr

The road from Jhansi to Narsignpur via Sagar was mostly vey good. The last distance of about 80km was very bad/no road. The route has bridges which were in constructions and even the road was in repairs. The route later was using bypass of narsignpur so we had to get off the highway to enter the city. The city is very long and took more than 45 mins to reach the railway station where we found the hotel to stay the night. the rent we found on a very cheap loading was 850 for two rooms. The other prices were 950 AC per room which we though was expensive. the food also was moderately good and also the people. there is a train track going near the hotel. the market in Narsignour was open till 10pm when we packed our dinner.
The fuel stations all around is very few. We ran out of fuel and had to buy fuel roadside point at Rs.90 per litre. That took use closer to the next fuel station in Sagar city, off road. This fuel station was inside the city and not on the highway. We had to ask around in tea shops to know the exact turn to take for the fuel point. Cars are very few on the NH26. Mostly trucks. Therefore petrol is not a important selling commodity here. Its now understood that we have to do a tank full at the time of leaving every city. This will give us a good range of about minimum 500 ams on a Santro 32 litre tank. The NH26 was also giving good average. Till now we have done about 700 kms from Gurgaon and spent (20+20+5) litres – giving 15.5km/litre. This milage includes the 100km stretch which was between Gwalior and Jhnasi where the car was going around 20kmph on a no road terrian. Filled one again in Sagar a tank full of 27 litres.
The internet facility is very doggy here. Airtel occasionally gives 3G but very unstable. Reliance is giving EDGE but also unstable, just like Vodafone. this made this town for a monday morning a very bad choice. We are now planning to leave this town and reach Nagpur quickly so there we can get better internet facilities which as the critical for this trip.
We reached Narsignpur past sunset at about 9pm.

 

Day 1, 400km from Gurgaon via Palwal, Mathura, Agra, Gwalior to Dabra

21 Apr

Started at 7am from Gurgaon and used Sohna to reach Palwal, NH2. From there, the road till Agra was good. The yamuna expressway was far away to try. Some 10km before reaching agra, there was a sign pointing to Gwalior. This was a mistake. The connection from NH2 to NH3 is bad road due to construction, industrial area. The connection itself took more than 1 hour. NH3 started good and till Gwalior is was very good, capable of 80~100kmph divided road.

Road from gwalior to Jhansi is the worst road seen on the first day. First, there is no connection from NH3 to NH75 which goes to Jhansi. The entry to Gwalior is from North West corner and the NH75 is on south west corner. All this link has to be made through the city center. Time took to pass through Gwalior city was nearly 1 hour. There is a bypass under construction which will allow skipping the city altogether by linking NH75 with NH3. Anyway, the road of NH75 is also mostly bad. There is no road, no service lane between Takenpur and Dabra. Its also very dusty all along.

Internet on EDGE is easy to find on Airtel, Vodafone and Reliance networks all through the route. The city Dabra is where we stayed the night has 3G good speed. Reliance and Vodafone are on EDGE on the town.

Food points with spicey food is all around in the Dhabas. The issue is to find woman toilet. Petrol pumps have marks for toilets but these toilets were never found operational. For best chance, one should try a neat restaurant/Dhaba in a city or town where you may get better washroom facility. The restaurants dont object using their washroom only. But on a drive, its still better to rest for 15 min tea break too. We liked one NH3 roadside dhaba in Dholpur, very good family hut, very cool on a summer afternoon.
In Dabra we took a very basic over night lodging at Rs.550 for two room. At 6.30pm at dusk, we choose not to do a night drive to reach Jhansi and retire here. Asked around and found this Swayamvar Lodging, not good place to stay, bad tasting water, dirty washrooms, dirty bedding too but fine staff. The service given at the price o Rs.550 for two rooms is acceptable.

Having breakfast now, will start in about 15 mins to cross Jhansi and try to reach Sagar.

Today, on day 2, we are planning to reach Narsignpur, Maharashtra (400km) or any closer to Nagpur by evening. Reaching nagpur would only be possible if we can get a good road along.

 

Using PHP Yii migrations to remind main.php config changes

16 Apr

Yii migrations originally allow you to patch database on test or production systems along with code. So db alter statements can be part of the commit if one used git or svn. I have used migrations from day ZERO so entire database structure is only part of the migrations which can be forwarded or moved backward.

In this time, since I do my deployments remotely using git checkouts, migrations save the time for all db patches. But yet, Yii config changes are not done in anyway. I was thinking to create a system which atleast alerts all the config changes (if not creating them itself) when its deployment time.

The code below does exactly that. It will check for particular keys in params and fail the migration till the main.php config is patched as required. This is a great way to be reminded about patching config using the db migrations system. The migration PHP file has no db call but that does not matter,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class m130416_101234_checkconfig_subsection_pricing extends CDbMigration
{
	public function up()
	{
	    $rt = include(dirname(__FILE__) . "/../config/main.php");
	    $rt = $rt['params'];
	    if(!isset(!isset($rt['someparam1']) ||
	              !isset($rt['someparam2']) )
	    {
	        echo "Config section for section pricing not set yet";
	        return false;
	    }
	    return true;
	}
}
 
No Comments

Posted in php, yii

 

The games politicians play and fool the stupid citizens

10 Apr

Every news that brought to us by all the media, the newspaper, the television, the websites, the spokespersons, public rally speeches, the road shows is manufactured lies. Even half truths is a lie. And then you don’t see anything said by anybody is what really happened. This is the world of communication we have chosen to live in. Yes, all this is chosen by us citizens.

Had we been more aware, smarter, active in our civic duties, everything would change so fast that you would need any social super heros at all. All of us citizens have the hero powers, just if we devote out personal time for our neighbourhoods. Nothing dramatic. Just take responsibility of our own neighbourhoods, where we live, where we play, we relax, we call home.

The information given to us is always, always, always a big black lie to make us look the wrong way. When one politician says one thing, agrees to someone, angers with other, all that is part of a very large politician game, and all politicians, statewide or central, all of those are part of the same team. Mind it, they are all in the same team. The opposite side is us. They pretent so beautifully and lie to us all that they have agendas for betterment of people, yet everyday they only choose new ways to fool us more. And all the planning is done collaboratively with all parties together. A citizen can never see the other side if he is just watching TV or reading newspapers. To see the other side, you would need leg work. And that leg work, we all, including me, are shy of, scared of.

So you see, if you want news to be served to you on your own sweet luxury, you will get all rotten food, served in a nice dish, coloured and flavoured to your liking.

Its you, who is stupid, they are just making money from your and my stupidity. I have stopped blaming them. I blame you just as much I blame myself.

 

Yii logs and server logs

19 Oct

Yii application.log file is a very good option to monitor for contexts and call stacks. In these terms it beats standard server log file. But there is one thing to always remember about Yii log file. It is that,log file is appended within the application space and at the end. Which means, the file is only written at the end of all other code. If your application had any fatal error, execution won’t return to Yii since its also the same application. So, the Yii log file won’t even mention anything of the entire request. Tis makes impossible to even know what went wrong. In such cases, only web server logs report what the fatal error was. Though server logs don’t report call stack, but then fatal errors are very rare anyway.

In practise, I tail both application.log and error.log at the same time in the same command.

 
 

Who is responsible for this?

15 Oct

Our satisfaction levels are very low. We feel so happy watching the Indian movies, Indian television and Indian cricket. None of which is any better than junk grade. We cannot even identify quality in any of this. The actors or cricket players or politicians or local MP or the neighbourhood telephone guy or the restaurant or the hospitality of hospitals. The are just more services given in a very bad manner these days. And that is not limited to certain sectors or region. It’s all over the country. Very few offer quality service in levels that are appreciated.
So if this is the state of of fairs in this country, I constantly wonder how can we blame the government for the corruption. The government is from our own people. The service providers are employes from our own neighbourhood. More such employees find ways to fake bills to save income tax. More such shop owners fake receipt booklets to save paying state or central taxes. Most big telecom companies skip registering most of their infrastructure to save more tax or fees. Big property developers even take cash for their transactions to make most of the transaction in black money. Doctors prefer cash or even refuse anything else to keep their books unwritten.
All this actually has nothing to do with the government of this country. All this is a perfect democracy and the government is just us in spotlight.
If people do not realise their own actions in their own country we are all taking it to doom. Everyone will have to become a responsible citizen. Everyone will have to make sure his actions are counted first by himself/herself. Everyone will have to first understand what actions mean and their larger consequences. They will all have to understand they own this country. Not by state language or religion. They all own it and share it and are responsible for it. That is the only real revolution that can really help change this country into something each of us will be proud to announce.

 

fixing phraseanet thumbnails and indexing

30 May

Phraseanet is a the open source digital asset management solution. It is written iin PHP and availabe on github. I had a recent time consoming problem regarding how to generate the thumbnails of pictures that were getting uploaded. Also had the search system which won’t search the newly uploaded files. Took some time to understand and read docs. Community of phrasea is very less. Therefore, asking a question in the forum may not find an answer.

The solution to these problems is konsole komander.

konsole kommander is accessible as php bin/console

Thumbnails and indexing is a task. Therefore first get the task list.

php bin/console task:list

All these tasks are deamons, means they keep running and monitoring the database. I have not yet found a way to run them as single time scripts which quit at end.

 

php bin/console task:list

1       tostart Write meta-datas
2       started Subviews creation
3       started Indexation

To generate thumbnails

php bin/console task:run 2

To generate the search index

php bin/console task:run 3

A working stable phrasenet install will allow these commands. All the action links in UI actually just flag the database for the task to pickup. No web php script actually does any thumnail generation or indexing.

 

 
 

GpsMid is a good free GPS navigation for android

11 May

Gpsmid is a open source project from the j2me era. I used it for few years on my Sony Ericsson k790 phone using bluetooth Holux m241. Then  when I switched over to android Arc, I got the beta apk for my phone. GpsMid is a touch friendly application and neat interface. It supports both internal GPS as well as bluetooth GPS. It works good enough for android phones and required a manual download of map data in form of jar file. the map data is actually OpenStreetMap vector data therefore very light. Whole India OSM vector data is available in 30meg. The map data itself can be made using a available java application Osm2GpsMid. The map data is automatically updated by the changing OSM data. It can do routing and searching. Gpsmid also has functions to realtime online edit OSM data but I often use it offline. India OSM data is not amazing but very good for all metro cities.