Thursday, January 28, 2010

Splitting a File into Smaller Pieces

On occasion, there will be a need to split a file up into smaller pieces for easier transportation. Be it email, FTP, CD's, or any other method. Here's how to do it with the split command.


$ split -b 1024m large_file.tbz chunk-



This will produce the following files:


-rwxr--r-- 1 owner group 1073741824 Jan 28 19:00 chunk-aa
-rwxr--r-- 1 owner group 134987776 Jan 28 19:00 chunk-ab


And to assemble them back into one piece, it's just as easy:


$ cat chunk-* >> large_file.tbz


--DRH

Wednesday, September 30, 2009

Putty + Vi + 10 Key = Trouble

So here's my situation. And don't lynch me for this one either. I just recently learned how to use VI. Shocking, isn't it? I never had time to learn it, as system administration was only a part of my job description. even though I'm the only sys admin on site. Nano was my choice of editing text files as I didn't need anything elegant for a quick modification of a conf file.

I chose to learn vi so I could develop websites on a terminal without firing up a VNC session - and wasting screen real estate in the process. Vi with syntax highlighting just can't be beat. A quick trip through vimtutor, a couple of Googles for setting up my .vimrc file, and I'm in business. But, I digress.

The Problem

When on a Windows computer, I use Putty to access my Linux computer. The number pad works just fine on the command line. It was only when I started using Vi that I noticed when you attempt to use the keypad, Vi interprets them as a different series of keystrokes. Not being able to use the 10-key is a big problem in my book.

The Solution

So, here's the solution. In Putty settings, go to Terminal - Features. Check the Disable application keypad mode and apply the setting. The 10-key in Vi now works as expected!

My .vimrc file

For those that are interested, these are my basic Vi settings.

~/.vimrc

hi Comment   ctermfg=darkcyan
set ruler
set showcmd
set tabstop=4
set linebreak


Enjoy!

-- DRH