Categories
bash debian vim

beeps

i hate beeps of all kinds. the new install was beeping when gdm started, then it was beeping for no reason when i hit capslock in the empty space, when man pages over the beginning or end of a manpage, etc. i needed this fixed. found a few things on the internet, but i feel my solution so far is incomplete:

add to /etc/modprobe.d/blacklist
blacklist pcspkr

add to .xinitrc
xset b off
xset b 0 0 0

add to .inputrc (this i knew already)
set bell-style visible

add to .bashrc
set visualbell
export PAGER=less
export LESS=”-Q”

add to .vimperatorrc
set visualbell

Categories
bash debian git Uncategorized vim

cryptsetup and quickfix

2 unrelated things which I fixed up today. First, a few days ago my Fujitsu P7320, which I am very fond of, had its HD fail. So it’s off being repaired, presumably returning with a fresh HD. I used it often to transfer files between my various machines using git – although git is a dvcs, i was also using it to sync machines, leading to lots of illogical commits, which I’m sure some purist would say is appalling, but it works and works fast, and so far I haven’t had trouble. But now that the Fujitsu is out, I needed to use a thumbdrive. Last time I used one for syncing, i lost it for some time, then weeks later found when the snow in my driveway melted. (Amazingly, it still worked.) But while it was lost I was always worried about whether there were any important passwords cc’s etc on the drive. I determined to never use an unencrypted thumbdrive again. So today I had to get it encrypted in a hurry, and I found the relevant commands and they were simple, so here they are:
[sourcecode lang=”bash”]
cryptsetup luksFormat /dev/sdX
cryptsetup luksOpen /dev/sdX thumbdrive
# enter password
mkfs.ext2 /dev/mapper/thumbdrive
mount /dev/mapper/thumbdrive /media/thumbdrive
# do whatever
[/sourcecode]

Much easier than I was expecting.

The second thing I rediscovered was quickfix on vim with g++. I was doing some simple editing of a single C++ file, and I wanted quickfix working again but I forgot everything. Here’s the lines from the .vimrc that make it go:

[sourcecode lang=”vim”]
set errorformat=%f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m
set makeprg=g++\ -Wall\ -pedantic\ %\ -lm\ -lgsl\ -lgslcblas\ -o\ %<
[/sourcecode]

That’s it. obviously later when using a makefile for real, I’ll have to modify the makeprg and make it.. just make.. but this works quick and dirty.

Categories
firefox vim

vimperator and Outlook Web Access Light

So one feature of vimperator which has made it indispensable to me is Ctrl-I on a web form textbox. When vimperator receives Ctrl-I, it opens a gvim instance on the textbox, you can edit in gvim, and then vimperator puts your result back into the textbox. Amazingly useful; it’s let me write better emails than I did when I was just typing into a textbox and trying to send off the email without any editing ability. Some websites use Flash or some other kind of textboxes though (such as Google Docs), but now I deal with them manually by opening gvim myself and pasting a tmpfile because I’m so used to the advantage of having gvim on textboxes.

Another nuisance has been editing emails using Outlook Web Access. Since I use Firefox, it forces me into Outlook Web Access Light, which is one nuisance (I bet if I just change the browser ID using a Firefox plug-in then I could get the full Outlook Web Access). But the main nuisance is that once I’m in OWA Light, then when I’m composing an email using Ctrl-I, then OWA Light likes to timeout after about 3 minutes and the textbox disappears, and so when I’m done composing another lovely epistle in gvim, then my writings disappear when vimperator doesn’t find the textbox that OWA Light helpfully closed. I needed a way for gvim to save a duplicate copy whenever I’m using OWA, and gvim being the incredible machine that it is, there’s a 1-liner in .vimrc that does the trick:

autocmd VimLeave  vimperator-exchange* :write! >> /home/me/vimp.exch.txt

That’s it. Whenever gvim is about to leave a file beginning with vimperator-exchange*, then it writes an extra copy to vimp.exch.txt so if OWA Light closed the box, I still have it.

There might be a more elegant way to do this; for a while I was trying to get a unique script id using but it wasn’t worth it. I like this solution now anyway.