Categories
Computergeekery Tips trivial shennanigans

Staircase affect with vim pasting

Gentoo Forums :: View topic – vim pasting “stairway” [SOLVED]

Found on the Gentoo forums, and excellent tip on how to avoid that annoying staircase affect when you paste multiple lines into the VIM editor.

Add the following to your .vimrc file

nnoremap :set paste!

Categories
Tips trivial shennanigans

Sun CEO Says ZFS Will Be ‘the File System’ for OSX

Slashdot | Sun CEO Says ZFS Will Be ‘the File System’ for OSX
Being pretty interested in RAID and Macs, I find this very interesting. ZFS sounds like a pretty neat piece of work. Being able to transparently add dives for more space, and determine which parts of the filesystem need more performance, ro more redundancy. sounds pretty nifty to me.

Categories
Computergeekery Tips trivial shennanigans

HOWTO Find broken symbolic links – Gentoo Linux Wiki

HOWTO Find broken links – Gentoo Linux Wiki

I was trying to find some broken links. however, although using
find . -type l

shows all links, it does nto use the cool flashing RED that BASH can do to shwo a broken links. So doing a quick Google turned me to this Gentoo howto: Nice n easy!
find . -type l | (while read FN ; do test -e "$FN" || ls -ld "$FN"; done)

Categories
Computergeekery Tips

useful SED line

I wanted to comment out a few lines in a config file. This was a result of getting to single user mode on a Tru64 box, because some SCSI drives had gone missing!

Anyway Sed to to the rescue! How do I look for a string then comment out that entire line? Not beign that familar with SED I struggled but:

sed 's/.*sda6.*/#&/g' test

Works nicely!!

The “&” means the entire match, so “#&” means comment out that line! Trying to match the entire line did confuse me, as trying to use a wildcard gave me errors. Until it dawned on me… “*” means “more than one of the previous character. so “.*” means more than one of any character i.e. wildcard!

Cool!

I’ve since been told that there’s a far easier way of doing this.  e.g. using the “find” function then an upper case “I”nsert, which means insert at the beginning og a line, rather than at the current location in the buffer.