Saturday, April 4, 2015

Avoid tracking your own page views

Are you interested in finding out the stats of your website? I am sure you do not need to count your own page views (if you like to see the true value). If you are using blogger, it gives a simple option for this. But unfortunately it did not work for me. It says " There was an error while fetching stats. Please reload page."
( you can try logging to your blogger account > Stats and click on "Don't track your own pageviews")



After some effort could find another solution that could fix my issue and here it is...

While been logged in to your account, open a new tab in the browser and enter

http://your_site.com/b/statsBlockingCookie?action=SET&callback=__gwt_jsonp__.P2.onSuccess

(make sure you replace the your_site.com with your site name)

You will get the following response
// API callback
__gwt_jsonp__.P2.onSuccess({"status":"yes"});

Restart your browser and you can see that your page views are not counted in stats :)

Wednesday, April 1, 2015

Want to map your keyboard with the keyboard for your VM?

Recently I had to work in VMs for few of my projects and the biggest burden is the changes in keyboard. I am using a Mac and wanted to use Windows on a VM for a project. It is really irritating when you have to work in both environments interchangeably. You will definitely press cmd + c to copy in your windows VM and wonder why cmd + v won't work :O

I could find a simple solution for this with the help of autohotkey.
So this is how I map the Mac keyboard to Windows VM. ( and I am using VirtualBox)


Map the hostkey of the VirtualBox to right command key.


Start VirtualBox
Select VirtualBox > Preferences from the top menu



Input > Virtual Machine
Search for 'host key combination' and set the right command key for the key combination



Setup the VM to have changes


Download autohotkey to VM
Create a file in VM with extension .ahk ( ie: script.ahk )
Following is a sample content for the file with some of the most useful key mappings

#SingleInstance force
#r::Send ^r ;reload
#z::Send ^z ; undo
#y::Send ^y ; redo
#f::Send ^f ; find inside apps
#c::Send ^c ; copy
#x::Send ^x ; cut
#v::Send ^v ; paste
#t::Send ^t ; new tab, Firefox
#s::Send ^s ; save inside apps
LWin & Tab::AltTab ; the motherlode, alt-tab!
#b::Send ^b ; bold / bookmarks in Firefox
#i::Send ^i ; italic
#u::Send ^u ; underline
#a::Send ^a ; select all

Save the content and save the file.
Right click on file and do 'run as administrator' and you are ready to go... :)


Add the script to the Startup Programs


Add your file to Startup folder and you will have no issue with VM restarts...
Start > Program Files > Startup

Hope you will find your life with VMs much more easier with this.