Dreams of Thought

Are dreams thoughts… or are thoughts dreams..

RSS Feed

Archives for technology

Useful vim commands

2 Comments

I use vim at work for most of my text editing purposes. Vim is a very powerful editor. However, it comes with a somewhat steep learning curve. The best place to learn it would be the vimtutor program. It’s got a pretty good “for dummies” approach which is useful if you haven’t used an editor even remotely powerful as this one before. If you’re short of time, the best way to learn it is to just jump in and start using it. Since it’s been around a long time, it has pretty much most features a developer needs. So if you have a need and don’t know how to get it done with vim, then use this site.

To start off using vim, let me give you a very quick and dirty first few steps. To open a file, simply use vim <filename>. You most likely have vi pointing to vim. Plus, most of these commands work with other vi’s anyway. So I’ll be using vi instead of vim henceforth.

Now that you have a file open, you would like to enter some stuff in? The basic thing you need to know about vi is that it has many modes. From the default mode(command mode) you need to press ‘i’ to enter the insert mode. In this mode you can type stuff in and it will show up on the screen. The command mode is where you issue commands to vi (But you can’t enter text). To go back from the insert mode to command mode press the escape key.

Now that you’ve typed some random stuff in, escape to the command mode. Now try pressing ‘:w’ i.e. (shift+;)w. W is for “write”. This saves the file and leaves you still in the editor. If you want to get out of the editor, you type in one more command ‘q’ so it becomes ‘:wq’. In case you want to get out of it without saving, use ‘:q!’. The other way to save and quit is to go to the command mode and hit shift+z+z.

With vi, the traditional way to navigate (in command mode) is to use l,k,j,h keys(right,up,down,left). That’s like the a,w,s,d in gaming. It’s a timesaver for people who are comfortable with it. Vim allows you to use the arrow keys as well, which is a real convenience.

That covers the bare minimum basics for us.

Once you start using vi you start looking for ways to accomplish tasks using it. There is a whole lot of material out there in the World Wide Web which will help you out. Google is your friend, use it :)

I will tell you some of the frequently used options/shortcuts I use with vim.

Going to a specific line : Type in ‘:25′ to go to line number 25 (in command mode). You can open a file at a specific line by typing

$ vi +25 FILENAME

This will open the file and take you to line 25. Now that you’re there, perhaps you would like to delete the next 5 lines? No problem – just hit d5d. The 5 in the middle says 5 and dd is for deleting lines. You will find this a common pattern with most vi commands. Just hitting dd will remove a single line. Similarly you can do d5w to remove 5 words and dw to remove a single word.

Copy paste is a walk in theĀ  park. Hit y7y to copy 7 lines. Now press p to paste. That’s it. Cut paste? Hit d7d and then press p to paste after navigating to where you want to paste it.

The other approach to doing all this is to send a command. Hit ‘:201,225y’ to copy lines from 201 to 225. Similarly ‘:201,225d’ deletes lines from 201 to 225. To jump to a line you can use ‘:25′. This jumps to line number 25.

One useful shortcut when you don’t want to remember the line numbers is the use of markers. I can mark any 2 lines , say line numbers 201 and 225, and perform an action on them by using the name of the markers. Go to line number 201 and hit ‘ma’. This will mark that line with the marker ‘a’. Do the same with line 225 and mark it with ‘b’. Instead of uisng ‘:201,225d’ to delete lines 201 to 225, now you can use the a and b markers to delete the lines thus – “:’a,’bd”.

That was just a small snapshot of the commands that I use on vi. You can use a lot other features, like for instance macros, and enhance your editing experience. This should help you get started though. Let me know if this has been useful. Good luck and happy hacking :)

Filed under Linux, technology
Jun 4, 2009

The most difficult captcha there is

5 Comments

I was browsing through the site of a celebrity recently and came across the contact page. I was shocked to find the captcha there. Take a look yourself and be amazed : http://www.gulpanag.net/contact_gul_panag.php

Why would anyone display the captcha as text ready for a bot passing by to read? (It’s even got a nice class – captchas – wrapping it) Is that some kind of a honeypot? Is that a dummy form? Does the site admin feel lonely because no one sends him/her mail and is hoping to at least read spam?

Jun 2, 2009

Mobile updates on Orkut?

4 Comments

A while ago I got a message on my mobile from “TM-Orkut”. It was a scrap written by a friend on my Orkut scrapbook. I suppose this means they’re trying out mobile updates. There’s nothing about this yet on the Orkut blog. Looking forward to this feature. Hope it comes soon.

In case you have any news, do leave them as comments :)

May 20, 2009

Enabled Google Analytics

0 Comments

I enabled Google Analytics a while ago. Reports are yet to come in. Cause.. no one has visited this blog yet.. heh heh :D

Filed under technology
Apr 10, 2009

BrandAdda release 1.0

0 Comments
Update : SmartCrowds had to close down. Brandadda.com is no longer online. Hi folks! :) On March 31, 2009 we opened up release 1.0 of our site to the world wide web. It was surely a proud moment for all of us at SmartCrowds who worked so hard towards it. If you haven't already, I urge you to check it out. Don't forget to leave the feedback at the bottom of the page in the feedback form. OK, What are we all about you ask? Most communication today associated with brands and consumers is one - way. Brands blast the airwaves with commercials and adverts. The consumer has rants which he blogs about or posts on different fora. How do we close the loop? How we do we make the communication more interactive? BrandAdda is our answer to this problem. Here you can air your views regarding what you love/hate about something and the brand reps will listen to you.. and respond! You are absolutely nuts about Apple's 1984 Mac commercial? Post a youtube link and let the world know. Wanna hear what the twitter world is talking about Apple? Hear Hear.. There are lots of things you can do on BrandAdda. We genuinely hope that this will address the big gap between customers and companies today. This release brings a lot of changes to the UI. Some features were taken out that seemed to be unused or confusing to the users. We added some features to make the whole experience much better for the user. Visually, I believe the site to be much more appealing than it was before. For me personally this release meant some long nights and weekends I was working while my friends were enjoying themselves. But I feel happy I made those sacrifices, because the end product is so awesome that it really makes me proud. I personally believe we've now got a product that can really take off. What it needs is for the people out there to know about it. Would appreciate it if you can help the word spread. If you are a registered user at BrandAdda you can invite your friends by email and get extra points for it :) Inspite of all the effort we put in, there might still be bugs and issues. Sorry for that. Please help us by reporting them on the feedback form at the bottom of the page. Well.. there goes the baby into the big bad world. Let's see how she does :) ps : The opinions here are my own. They have nothing to do with the company.
Filed under technology
Apr 4, 2009

Twitter maintenance

0 Comments

Nice maintenance message from twitter :)

twitter maintenance page

twitter maintenance page

Filed under technology
Nov 18, 2008

Hoax mail from “Microsoft”

0 Comments

Dear Microsoft Customer,

Please notice that Microsoft company has recently issued a Security Update for OS Microsoft Windows. The update applies to the following OS versions: Microsoft Windows 98, Microsoft Windows 2000, Microsoft Windows Millenium, Microsoft Windows XP, Microsoft Windows Vista.

Please notice, that present update applies to high-priority updates category. In order to help protect your computer against security threats and performance problems, we strongly recommend you to install this update.

Since public distribution of this Update through the official website http://www.microsoft.com would have result in efficient creation of a malicious software, we made a decision to issue an experimental private version of an update for all Microsoft Windows OS users.

As your computer is set to receive notifications when new updates are available, you have received this notice.

In order to start the update, please follow the step-by-step instruction:
1. Run the file, that you have received along with this message.
2. Carefully follow all the instructions you see on the screen.

If nothing changes after you have run the file, probably in the settings of your OS you have an indication to run all the updates at a background routine. In that case, at this point the upgrade of your OS will be finished.

We apologize for any inconvenience this back order may be causing you.

Thank you,

Steve Lipner
Director of Security Assurance
Microsoft Corp.

—–BEGIN PGP SIGNATURE—–
Version: PGP 7.1

O61N09JLE94LTDLYEQGYL779BT77V3HNOBDRRHH429ANQMKHZJ2KJTN4SOIHO7Q69
P1T0FUAXM2NETPWIK57I76JW26P06ZMJVM3AALK2EHLW5FLLSD88MJ4CIQ44YUW7G
D6M4BT8E0NMNPMKGKBL44AWDDFFOV6FN3WZUJWQ5IYT3FDUPEE5VEQ9PBJYOSDOSF
2F0TAC0XCOBFL97K2ERH8UMJT6NWTACWT48EE7ODS6RDZP7ENZCRGMAOHYZGE1J70
I8HH2YHXADGTIHCFWLIVBAZCB3B5UQDWN0X==
—–END PGP SIGNATURE—–

This is a better crafted hoax than others out there :) Still quite a few flaws ;) So don’t go and “install” the “update”.

  1. Microsoft “company”
  2. OS Microsoft Windows

A typical update from Microsoft would be something like this : http://www.microsoft.com/downloads/details.aspx?FamilyID=e0bd6fbe-f46e-4961-9a79-49ec77d39439&DisplayLang=en

Oct 12, 2008

I want a new earphone and an mp3 player

0 Comments

Long time since my last post :D This time I’ve a question for the community.

I was thinking of getting myself a portable audio player and an earphone. Haven’t yet fully decided on what to buy though. I was thinking of getting a Sennheiser CX 300 or 400. No clue about the player though :(

I’m looking at spending a total of about 300 – 325 $ at the max. Highest priority is sound quality. A must – have is the ability to use it on my Linux machine, which means no restrictions like those on the iPod (can add music only with the iTunes?). I would mostly use it on trains or buses on long journeys (which is one reason I thought I would go for the Sennheiser canalphones). Support for OGG and/or FLAC formats would be nice. I don’t really care for video support, I just want the music :D

Any suggestions? :)

Filed under Questions, technology
Sep 12, 2008

Carl Icahn and Yahoo!

0 Comments

Saw an article on Wired about Carl Icahn and Yahoo! Basically Icahn wants to replace the current board of directors at Yahoo! with his own and pursue the Microsoft deal all over again. The New York Times has published the letter sent by Icahn to the chairman of Yahoo.

I doubt any good will come out of this. Personally, I think Yahoo! and Microsoft are incompatible companies and a merger between the two will only lead to disaster.

I don’t know what the problem is with this guy. Wikipedia says -

Icahn developed a reputation as a ruthless corporate raider after his hostile takeover of TWA in 1985.[1] The result of that takeover was Icahn systematically stripping TWA of its assets and selling them off.

http://en.wikipedia.org/wiki/Carl_Icahn

I hope Icahn doesn’t end up ruining Yahoo!. Somebody put some sense into him.

Filed under politics, technology
May 15, 2008

Why is there no broadband in India? :(

0 Comments

Happened to read this at Slashdot :

An anonymous reader notes that Comcast is offering a new 50-Mbps / 6-Mbps package for residential customers for $150, starting in Minneapolis-St. Paul and extending nationwide by mid-2010. The new service will use the DOCSIS 3.0 standard, which is nearing ratification. We’ve recently discussed Comcast’s BitTorrent throttling and promise to quit it, and their low-quality ‘HD’ programming. How attractive will $150 for 50 Mbps be compared to Verizon’s FiOS offerings?

http://tech.slashdot.org/tech/08/04/03/1427227.shtml

This is crazy!!! And totally unfair! :( Here in India the fastest “broadband” that we can get is a 2Mbps ADSL connection that comes to around 500 rupees (excluding tax). And just compare prices. Makes my heart break :( I’ve heard that broadband services are better and cheaper (than in the US) in some other countries (Korea? Japan?).

I wish affordable Broadband comes to India. It isn’t like there is no market here for proper broadband. The demand is there, the supply is absent.

Filed under technology
Apr 4, 2008