Browsed by
Month: October 2011

And the name of the city is Madurai

And the name of the city is Madurai

It is two and half years since I have started staying out of my home town. Basically my city is famous for its cultural enrichment due to the temples and monuments here. It is the second largest city in Tamilnadu. But yet it is lagging in terms of faster development when compared to Coimbatore. But I hope this is the right time to pick up.

Till now it was a helm of local political rowdies. Now they are all taken away from here. I haven’t seen any posters/banners around the city now. It is a very good change. Yesterday I was roaming around the city. I am seeing many changes and more improvements on infrastructure development. And there are many car showrooms opened in the city. But still the roads are not that much vast anywhere. It needs more bridges at many places. The city limit is extended currently. The total city is stimulated to celebrate the upcoming festival Deepavali. Planning to get into the crowd today also. I met a lot of friends on the past two days. Still there are more people to meet.

Here really we don’t have much places to roam around other than old monuments. There is no entertainment other than theaters. I am looking for a change in it. It is really the right time for investors here.

Everybody have a dream of staying in their native itself. Yes, me too. Thinking of the day to come sooner.

One word – One day

One word – One day

I thought of writing a lot of blog posts but I am not able to sit and do it. So I was thinking of writing something very short as I can do it daily. Here after I am going to write to express the biggest moment of the day in a single word!

I was always on Facebook

I was always on Facebook

In the recent vodafone advertisement we can hear the line “He is always on facebook”. Facebook team is making so much effort to make people to spend more time on their portal. They analyses people mind where they will waste time very easily and implements it exactly. It was the same case for me before 15 days. Nowadays I am not using it frequently. Accessing hardly on weekly once or twice for ten minutes. To ensure the constraint I have wrote one batch script. No more time wasting on Facebook hereafter.

I am using Windows 7. If you want to enable this in your system just copy the below scripts to your system and schedule it accordingly.

————————————————–
echo |type c:\Windows\System32\drivers\etc\hosts|findstr /v facebook > C:\Windows\System32\drivers\etc\hosts
ping 1.1.1.1 -n 1 -w 60000 > NUL
echo 127.0.0.1 www.facebook.com>> c:\Windows\System32\drivers\etc\hosts
————————————————–

Save it in your C: on any name of your wish with .bat extension. In the given example I have given access to facebook for 10 minutes which is 60000 milli seconds. You can change the timings accordingly to your need.

The first line deletes all the lines which contains the keyword “facebook”. And in the second line the script waits for ten minutes by pinging a non available IP Address. It is the available way of making wait for a batch script. In the third line, I am adding facebook.com to the restriction list by redirecting it to the localhost(system local URL).

There I had an issue that, for the 10 minutes waiting period the command prompt will be the foreground process. It means we need to minimize the window for that 10 minutes which disturbed me. SO I thought of making it as an invisible process(background process). So I have used an existing VB Script(source:Google) to make it invisible for that period.
—————————————————-
Set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run chr(34) & “C:\goawayfacebook.bat” & Chr(34), 0
Set WshShell = Nothing
—————————————————-

Now schedule the VB script for the time you need using SCHTASKS command or using Task Scheduler.
And forget the problem with facebook!

Batch script for taking periodic mysql dumps

Batch script for taking periodic mysql dumps

This batch script will be useful when you want to take periodic mysql dumps and archive it.
Change the folder names accordingly if you want to use it.
——————————————————————–
cd wamp\bin\mysql\mysql5.5.8\bin
mysqldump -u root -p password –result-file=”c:\backup%DATE:~4,2%%DATE:~7,2%%DATE:~10,4%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%.sql” <database_name>
cd C:\Program files\Winrar
Winrar       a       c:\RARbackup%DATE:~4,2%%DATE:~7,2%%DATE:~10,4%%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%.rar C:\*.sql
cd /
del *.sql
——————————————————————–
Further add this to windows task scheduler or use AT command which is similar to crontab in linux.
Use it as,
AT 2:00 /every:M <script_path>
This will run at 2 AM on every Monday.
Issue with wordpress

Issue with wordpress

For the past one week I was not able to post anything to post because of the issue with my wordpress.
It gives this, when I try to post.
——————————————————–
501 Method Not Implemented
GET to /blog/wp-admin/post.php not supported.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
——————————————————–
Atlast the issue is resolved after turning off mod security by editing php.ini. My host did that since I don’t have access to that file.
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
This may work sometimes. But not sure on all the cases for this particular issue.
Options All Mulitviews
<Limit POST GET OPTIONS>
Order Allow,Deny
Allow all
</Limit>
Self social media policy

Self social media policy

I was thinking about this for a long time. I may be not be only one thinking about this. Yes, the thing is to get rid of social networking or atleast restrict access to facebook.com. It is very easy to restrict access by editing /etc/hosts file in the system. But I don’t want to do this. That is very simple to do. I want to have time specific restriction to it.
I mean, I want to access facebook.com for 15 minutes in two days. My system should allow me to access the site in between 9 – 9:15 PM on alternative days. There is a lot of browser plugins to implement this. But I want to have it independant of browser and I don’t want some other softwares utilizing my CPU cycles. I am using Windows 7. So I am trying to implement it by any alternative ways. I have written batch script. I don’t want the window to be minimized all the time. To make it invisible I need to write another vb script. So currently I am trying to write on windows service using python or C#. Let me post the final output once it is done completely. Definitely it will be useful for many people who are all affected with faceboophobia.