Friday, April 16, 2010

Stop the Corruption! - Putty and Screen

I use putty to make ssh connections to my home server when I'm forced to use MS Windows, such as when I'm at work. The first thing I do after connecting is start up screen, which opens several pre-assigned applications in "tabs". Putty's default settings seem to cause screen corruption with some applications, notably newsbeuter, finch, links, mc and hnb.




Not pretty.

This is simply fixed with 2 settings in putty. First, in the putty configuration tool go to "Terminal" and check the box for "Use background colour to erase screen". Then select "translation" found under the "Window" section and change the character set to "uft-8" using the drop down menu.

Here are the results:



Tuesday, April 13, 2010

Vim - Cut and Paste a Block of Text Between 2 Files

Vim is my editor of choice, but I would never consider myself an expert. So when I wanted to copy text from one text file to another in vim, I was challenged. Although I was frustrated for a brief moment, I remembered uncle google and he helped me with my conundrum. So here is how you cut and paste a section of text from one text file to another using vim.

First open your first text file in vim. Scroll down to the first line of the block of text you wish to copy and press "ma" (that is m followed by a, without the quotation marks). "m" marks the beginning of your block. The "a" makes the assignment of copying the text to buffer "a".

Now scroll to the end of the block of text you wish to copy and press "y'a" (again without the quotes). The "y" yanks the text block. The single quote in the middle, I guess designates the end of the block and "a" again identifies the buffer being used.

Next open the second text file by typing ":split filename.txt" (Remember no quotes). This will open the second text file in a split vim session window. Scroll to the line where you would like the text pasted and press "p" (You should know, don't include the quotes). This will paste the block of text on the line below the current cursor position. Save and your done.

Please leave comments with other examples of cutting and pasting in vim.
Enjoy.

Friday, April 2, 2010

Newsbeuter and Google Reader



If you go to the newsbeuter website you'll be told that it's the mutt of rss feed readers. It is text based and highly configurable. Newsbeuter is fairly easy to set up and configure. Just install newsbeuter using your distros package manager. It should be available on most distributions Ubuntu, Fedora, Opensuse, Arch, Slackware, Debian, etc.

Now that it's installed, just type newsbeuter in the terminal to start it. There's probably not much to see as we haven't added any RSS feeds yet, but I usually start an application before configuring it because usually there are configuration files that are created when an app first starts up. Press "q" to quit.

To add feeds open the ~/.newsbeuter/urls file and simply add your feed urls to that file. Save and close and you're good as gold. You can edit the ~/.newsbeuter/config file to customize your keybindings and other settings. See the man page for configuration options.

I recently learned that you can use newsbeuter to view your Google Reader feeds. To do this make sure you have the latest version of newsbeuter and simply add the following to your ~/.newsbeuter/config file.

urls-source "googlereader"
googlereader-login "your-googlereader-account"
googlereader-password "your-password"

Save and start newsbeuter. You now have your Google Reader Feeds.
Please see the newsbeuter documentation site for more configuration options.
Enjoy.