imdb-rightclick-hack

Was going through the image gallery present in IMDB. Noticed that I could not save the image I was viewing because right-click wasnt working.

There are two ways to save the image in Mozilla Firefox

  1. Click Tools -> PageInfo and in the Media Tab you can find the images and click on the image and click “Save As..”
  2. View the source of the page. Get the image location , copy the url and save the image.

Once one sees the source, one will findout that the contextmenu is being replaced. It looks something like

<img src="imagelocation.jpg" oncontextmenu="return false" />

If its possible for you to change this value in the contextmenu, you can directly get the right-click option enabled. Thinking about the post title, I should have named the title as “How to disable rightclick in Mozilla Firefox ?” . By the way, the code that works removing rightclick in imdb is

javascript:for(i=0;i<document.images.length;i++) if(document.images[i].oncontextmenu)document.images[i].oncontextmenu="";void(0)
 Continue reading 

flickr-hack

Was browsing thru flickr and suddenly thought of saving an image. When I right-click and do ‘Save Image As’, I get the image some spaceball.gif . This was one of the hack which I saw sometime ago for preventing users to directly download the image. I was struck with this idea, how to save the original image ? I got only one option

  • Grease Monkey Script

I started out writing the greasemonkey script and then it suddenly struck to my mind

  • Adblock Plus

Adblock Plus will do something related to my requirement . I just need to block the image from my view.As it is a gif , a transparent one, it wont  effect anything . Just right-click and block the image spaceball.gif and tadaaa.. you are done. From next time on, when ever you load a flickr page, you can directly save it with right-click and ‘Save Image As’ and you are done.

Assuming you are using Mozilla Firefox  and installed the plugin Adblock Plus 

DYK [Did You Know] ? Firefox Campus Edition 

Bash Cuts

‘It would be great if I had all the short-cuts all at one place ‘ ram thought 🙂 . Starting with BASH ( Shell ) which many use… This list will be useful for people starting to use BASH.

Ctrl + A = Home Key = Move to start of line
Ctrl + E = End Key = Move to end of line
Ctrl + I = Tab Key = Auto complete
Ctrl + N = Down Arrow = Next Command
Ctrl + P = Up Arrow = Previous Command
Ctrl + M = Enter Key = Execute Command
Ctrl + O = Execute Command and restore the previous command.

Ctrl + R = Reverse Search
Ctrl + S = Forward Search or Suspend # varies with terminal type.
Ctrl + Q = Release Suspend

Ctrl + U = Remove from start of line till position of cursor
Ctrl + K = Remove from position of cursor till end of line
Ctrl + H = Back Space
Ctrl + W = Remove one word [delimiter=space]
Ctrl + Y = Paste that was cut using Ctrl + U | Ctrl + W

Ctrl + L = Clear Screen
Ctrl + T = Swap the letters behind the cursor
Ctrl + F = Move one character forward
Ctrl + B = Move one charecter backward

Ctrl + D = EOF / Logout / eXit (Oops !)

Ctrl + G = Bell

Ctrl + C = suspend a program
Ctrl + Z = stop a program [ works in a program whose parent is the bash shell ]
fg = bring the process / program to the foreground
bg = bring the process / program to the background

Ctrl + J = Execute Command ~ Ctrl + M
Ctrl + X * 2 = toggle between position
Ctrl + V = Some one fill this !

Please add any more short-cuts. The list will be available at http://students.iiit.ac.in/~sairam/

Vimming

Was coding, and got a different kind of doubt. If I want to search for 2 words both at a time, say, PrimeNo & TotalNo. I found out that oring the two will do it. But we have to escape the | . ` /PrimeNo\|TotalNo` in vim will do it. 🙂

Found a new vim trick :).

That was some time before and today , the 4th of September, found a nice one this time. What will you do if u have a link in your file that you are vimming [the file you opened using vim], What a normal person will do is he would copy the link and paste it in the browser, else, you can just go to that line containing the link and just say `gx` in escape mode, I found this accidentally when pressing :noh , got :no , and then it gave some aliases which are there by default, and this is one of it.

And also one thing about recording in vim, I tried to read about recording in ranta’s page, but I had a doubt when to use it,

and found a incrementer/decrementer in vim :D, just go to a number and press Ctrl+A [Escape Mode] will increase the number and Ctrl+X[Escape Mode] will decrement the number.

i recently knew that recording is easy,good,helpful ,briefly, press `qa` in Escape mode to start recording, this will store all the actions we do within the register `a`, do something and then `q` to stop recording, and executing the contents of the register `a` is by [count]@a .count is no. of times we want it to repeat that action which is commonly used in vim.

.vimrc

+set ai
+set autoindent
+set cindent
+set ci
+map <f5> $vypr|^vyphr|YPVr-jYpVr-j

thinking of writing some pages on pdf/swf/algos 😀 .Jus writing them as found them and may come in handy sometimes.