Borys Bradel's Home Page

New Website

This is my new website. It's hosted on GitHub, where I have a couple of web browser projects: VeryBasicBrowser and BasicBrowser.

My old website is at http://pages.ca.inter.net/~maxbradel/.

I have included a couple of blog posts from my old website that I still find useful.

My vim initialization file

The following is my vim initialization file, the ".vimrc" in my home directory:

set nocompatible " use Vim settings instead of vi

set backspace=indent,eol,start " allow backspacing over all

" following 8 lines from vimrc example (note, autocmd cannot have empty lines)

" filetype plugin indent on " autoindent files

" augroup vimrcEx " put in autocmd group for easy removal

" au!

" " jump to last known position at start

autocmd BufReadPost *

\ if line("'\"") > 0 && line("'\"") <= line("$") |

\ exe "normal g`\"" |

\ endif

colorscheme torte " this is a nice black-background scheme

syntax enable " syntax highlighting

set showmatch " paren matching when inserting

set autoindent " autoindent only works after plugin

set shiftwidth=4

set softtabstop=4

set hlsearch " highlight last search

set history=50 " keep 50 lines of history

set ruler " show cursor position all the time

" swap ; and : in command mode to avoid pressing shift too much

nnoremap ; :

nnoremap : ;

imap <TAB> <C-H>

source ~/keyboard.qwerty2colemakb

That's the entire file. The commands are commented and relatively self explanatory, except for the last two: "imap <TAB> <C-H>" and "source ~/keyboard.qwerty2colemakb".

The first of these commands maps the tab key to the erase-previous-character command, which is control-h. The second loads in a file with commands that map the qwerty keyboard to a modified Colemak layout. The layout is nice in that it avoids excessive hand movements. The best place to practice is at this site, which also shows a different good layout called Asset. For me, both Colemak and Asset are better than Qwerty and Dvorak. My modifications change the position of the non-alphanumeric keys to suit my typing habits. The modified layout has the following keys on the keyboard (from left to right):

1234567890'=

qwfpgjluy;,/\

arstdhneio-

zxcvbkm().

And the following when shift is held:

!@#$%^&*[]"+

QWFPGJLUV:{}|

ARSTDHNEIO_

ZXCYBKM<>?

Each key can be modified using the inoremap command, which indicates a mapping in interactive mode with no recursion. For example, "inoremap e f" changes an "e" to an "f".

Backup Strategy Summary

What is an effective backup strategy?

Since the answer I wrote is rather long, I will post a summary of the answer first. The summary contains the high and low level views of my solution, which although not perfect, is the only workable one I could find after searching for many years.

At the high level, backups require three essential components.

First, identify the data that needs to be saved.

Second, make backups once in a while.

Third, store the backups far away from the original data.

At the low level, the solution is to create a folder that contains all the material (which needs to fit on a cd/dvd if it is written to a cd/dvd, although this limitation can be overcome by spanning several cds/dvds) to backup (e.g. ~/b), write it out to cd/dvd and write a git repository of it to usb, and store these media in a safe place.

Sample commands for cd/dvd burning are

cd ~

mkisofs -r -iso-level=4 -m b/.git -o savedimg.iso b

dvdisaster -c -mRS02 -i savedimg.iso

/usr/bin/cdrecord speed=4 padsize=63s -pad -dao -v -eject -data savedimg.iso

Sample commands for cd/dvd reading, testing, and fixing are

dvdisaster -r -d/dev/cdrom -i image-new.iso

dvdisaster -t -i image-new.iso

dvdisaster -f -i image-new.iso

Sample commands for git repository creation are (assuming usb drive is connected)

cd /media/device

mkdir b

cd b

git --bare init

rm hooks/*

cd ~/b

git init

git remote add save1 /media/device/b (assuming usb drive is connected)

Sample commands for backing up to usb are

cd ~/b

git add .

git commit -m"auto backup"

git push save1 master

Sample commands for restoring to another system are (assuming usb drive is connected)

cd ~

git clone /media/device/b

Sample commands for undoing a deletion or change are (assuming usb drive is connected)

cd ~/b/whateve/dir/has/deleted/file

git checkout -- deleted.file

   

Copyright © 2008-2022 Borys Bradel. This site is only my possibly incorrect opinion.