User login

how to

Use Git to commit to CVS, such as for maintaining a Drupal module

UPDATE: See http://more.zites.net/git_drupal_contrib_cvs

Kathleen says this is complicated and not necessary - http://drupal.org/node/288873

HOWEVER-- if you ever want to let other people contribute to your project the normal way (if CVS can be considered in any way normal), then you will want the synch anyway.

Install and enable pspell for Apache with PHP5

This is a package requested by, at the least, the Coder Tough Love Drupal module.

Searched around for a fix to the error message on the coder tough love settings page that there was nothing to configure because it didn't have the pspell package installed, nothing at results for ubuntu pspell, enable pspell, php5-pspell, enable pspell linux said exactly what to do.

Naturally...

sudo apt-get install php5-pspell
sudo /etc/init.d/apache2 restart

is all you need on Debian / Ubuntu.

Move spreadsheet rows or columns with drag & drop in OpenOffice on Mac OS X

fn control option are the keys to hold down while dragging and dropping to move and insert rows or columns in Open Office Calc on a Mac!

Auto-expand abbreviations in Vim

vim autocomplete, or really, autoexpand abbreviations

All about shortcuts as well as abbreviations: http://www.linux.com/archive/articles/54936

To set abbreviations only for insert mode (which seems a little safer) add to your .vimrc file (or in Agaric's case, an included .vimrc-agaric file with all our Drupal and other development-specific additions) abbreviations in the format iab abbr abbreviation.

Check to ensure at least one parameter passed in to bash script

bash script check for existence of any argument

if [ $# -ne 1 ]
then
echo "USAGE: scriptname arg1 arg2"
return
fi

Include another file in your Vim configuration file

To store your Vim settings in a different file (Agaric does this so that we can put all our "custom home" configuration type files easily in version control together) use the source command.

In .vimrc to include other file:

source /path/to/file/morvimconfig

In ben-agaric's case, the entire .vimrc file is only:

source /home/ben/customhome/.vimrc-agaric

Checking the difference between a file modified locally and the repository with git

[done this before, never made a note of it]

git see difference between current and repository file

git diff

It's really that easy.

Additions in your local working copy are represented by + signs, subtractions by your local working copy are each preceded by a - sign.

http://media.pragprog.com/titles/tsgit/chap-005-extract.html

PHP function to format seconds as hours:minutes:seconds

Could not find a built-in PHP function to convert seconds to minutes and such, so here's a utility function candidate. Seems it should be easier...

Access the http port on VirtualBox guest from host, such as to use Mac web browser to see site developed in Ubuntu virtual machine

Accessing web server on Ubuntu VirtualBox guest from Mac OS X host

Search words:
port sharing virtualbox
virtualbox localhost
virtualbox localhost ubuntu mac os x webserver
virtualbox localhost:8080
guestport hostport virtualbox
mac os x virtualbox port forwarding
VirtualBox 3.0 VBox 3

Ebony-II:~ ben$ VBoxManage setextradata "buntu" "VBoxInternal/Devices/e1000/0/LUN#0/Config/guestssh/Protocol" TCP
VirtualBox Command Line Management Interface Version 3.0.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Sharing folders on VirtualBox from Mac host to Linux guest

Not sure if it was necessary, but it didn't work for me until I used lowercase for the VirtualBox name of the shared folder (the folder itself was still capitalized).

su root

mount -t vboxsf -o uid=ben,gid=ben,umask=022 notes /home/ben/Notes

exit

That is what worked, here are some things that didn't work, for this folder only

virtualbox shared folder location in guest machine

Syndicate content