Archive for March, 2008

screen in FreeBSD default to csh as suppose to bash (preferred)

After changing bash shell to a new user using chsh, screen needs ~/.bashrc for environment settings, which need “ln -s ~/.bash_profile ~/.bashrc”.

run sql/queries (postgres) within bash

e.g.

for things-to-buy in $(psql -d database-name -U username -c “select item from glossaries where priority = ‘urgent’ “;

do

blah, blah, blah …

done

secure copy with failover - rsync & ssh

e.g. rsync -av –progress -e ’ssh -i /alternate/id/file’ sshusername@host:/directory/or/file /destination/directory/or/file

- should the copy process terminated through the half way, just run the exact command again and it will continue from the file is failed previously, without copying again starting all over again.

iTerm resize the window itself when using screen

Bookmarks –> Manage Profiles –>  Terminal Profiles –> Default

check “Disable session-initiated window resizing”.

how to search search & delete line in vi editor

the below command in vi editor will remove the whole line that contains the word “search-keywords” on the entire file.

:g/search-keywords/d

Next Page »