Posts

Showing posts with the label Linux

Create your own Chat system

Swami Nikhilaananda said: "Chat is cool, chaat is cooler" If you have used Pidgin, you would have seen the word XMPP. It will be really great if you have a look at this beautifully written article by Adarsh Ramamurthy on XMPP . In this post, we attempt to communicate between two computers via chat - And no, not using Google or Yahoo :-) I am using Linux on both machines. You can do the same thing with Windows. Step 1 , is to download the XMPP server. Let's call the machines as A and B. I stumbled upon ejabberd long back, and so used that. There are alternatives as well. On machine A, download and install ejabberd . I simply ran: sudo apt-get install ejabberd If everything went well, you will have it up and running, no sweat. Now, in step 2 , we will create two accounts. To do that, we will register them using the following commands. Oh, I am going to use Romeo and Juliet just for continuity from Adarsh's article. sudo ejabberdctl register romeo loca...

Comment & Uncomment multiple lines in Vim

Baba Gyani Triviani said: " When someone said 'No Comments' I just had to intervene. No comments? Have multi-line comments my friend! " Commenting and uncommenting multiple lines in Vim can be a little tricky. Here is a small snippet of code to show how you can do this. I have done this for just a few of languages. But you can extend this to any number as per your choice. Save the following into a file and call it vcomments.vim Once this is done, open your ~/.vimrc  file if it exists, or create a new one. There, put the following code. :source ~/ vcomments.vim :map <C-a>  :call Comment()  <Enter> :map  <C-b>  :call Uncomment()  <Enter> Where you can replace a and b of and by whatever is convenient to you. This just calls the functions when the Ctrl + <key>  combination is hit. To use it, just select the lines to comment by using Shift + v and moving cursor up or down to select lines. Then, hit the Ct...

Common VIM Mappings to make life easier

Swami Nikhilaananda said: " When you transition from a known to an unknown, the similarities allow the transition to become smoother " If you have not checked out the previous post about Vi(m) editor , now is the time to read it. Many times, we are used to common keyboard short-cuts like Ctrl + C to copy, Ctrl + v to paste, and so on. However, when we move to Vim, it is tedious to remember all the new shortcuts like y to yank (copy) and p to put (paste). To avoid that, I created a bunch of remappings to enable me to perform common tasks quickly using the same set of keyboard shortcuts that we are so used to. You can do it too. Just open your ~/.vimrc file. If it is not there, create it. Then, paste the contents below as is into the file. Save it and restart vim. These shortcuts will start working (in escape mode) set smartindent set tabstop=4 set shiftwidth=4 set expandtab set mouse=a se nu :map <C-a> GVgg :map <C-n> :enew :map <C-o> :...

VIM Editor [Some cool features]

Swami Nikhilaananda said: " There was a time when I thought Vim was just a bar of dish washing soap. " A text editor is one of the most important tools when writing code. There are tons of editors available. But from time immemorial two editors have always been very popular (and reasons for flame-wars) One is Emacs and the other is VI. Most Linux distributions come pre-installed with a VI called VIM - Vi Improved. However, the editor that comes pre-installed is not the full version. So, first step, go ahead and get the full package so that you can unlock all features.. VIM is also available on Windows. Download VIM here . Why VIM? Before I go to the cool features, I would like to clarify a couple of points. When there are so many awesome graphical editors out there, why should anyone even bother learning Vi? I had this exact question. I used to get annoyed with Vi in the beginning. The reason is simple. When you connect to other machines via ssh, you don't ha...

Installing Gnome3 and a couple of tweaks

Image
Baba Gyani Triviani said: " Life is always a trade off - You get something, at the cost of something else " Ubuntu is probably the most commonly used Linux distribution. Ubuntu used to be shipping with Gnome for quite some time; however the latest version had Unity. While Unity appeared to look quite fancy in the beginning, a couple of sessions later, I found it incredibly annoying. There are several annoying features that one can find by running a simple Google search. However, there is an alternative - Gnome3. Some people may prefer KDE for the beautiful environment considering it is quite familiar, being similar to Windows; Gnome though was my personal favourite (Though Linus Torvalds hates it) for being minimalistic and doing the job right. So, I decided to install Gnome, and found they have a new version Gnome 3. [Note: From what I understand, you will lose Unity for good - Point of no return] How to install Gnome 3: To install Gnome 3, first launch your termi...

Access Android wirelessly without USB

In this small tutorial, I will show you how to access the contents of your Android phone wirelessly. What I am using in this tutorial is a rooted Samsung Galaxy 3 running Froyo and a computer with Windows XP. Of course, there is Wi-Fi. If you want to know how to root a phone, you can read about it here . I then installed an app called SSHDroid. There is a free version as well as a paid version available. The free version is ad supported - so it won't work if you have ad blocker app active. If you do have one, then just disable ad blocker for some time. (Restart the phone after disabling ad blocker to ensure it works. It hadn't worked for me before) Turn on your Wi-Fi. Once you run SSHDroid, your phone is available to be accessed via Wi-Fi. Now you need to access it from your computer - There are various ways of doing this, including command line. I prefer to use WinSCP - The same tool that you use for iPods and iPhones after Jailbreaking. You can download WinSCP from here . I d...

SSH - Android and Linux

Swami Nikhilaananda said: " I did a very interesting experiment today - I love Android " I am no geek, but I really love seeing some fancy things happening. This is one of the things that I tried out and liked - maybe you guys might also like it. I downloaded an app called ConnectBot which is an SSH client for Android. You can see their page here , and find that on the Android market as well. After installing it, I found there are three options - SSH, Telnet and Local. Next what I did was, I went to my Linux (I use Ubuntu) and ran the SSH server. To do that, first ensure that you have it on your system. Just run the command sudo apt-get install openssh-server Then, I just went to the ConnectBot app and gave my username@IPaddress and said connect. It connected and asked for password - which I provided. Boom, I could browse through my computer through the command prompt - how cool is that? Geeks might not find this great - I was excited :-) There is also a Terminal Emulator pr...