User login

command line

Quickly search for a git commit hash based on a key word

git log --pretty=oneline | grep 'award'

Extract and decompress with tar into a directory of another name

Can use

--strip-components=NUMBER
strip NUMBER leading components from file names on extraction

in conjunction with -C

but have to create the directory first anyway, so moving (mv)after the fact is probably easier.

Source

http://superuser.com/questions/146814/unpack-tar-but-change-directory-name-to-extract-to

See what's about to be committed when using git, and remove something before committing

git diff of files that have been staged ie 'git add'ed
git diff --cached

http://www.commandlinefu.com/commands/view/1242/git-diff-of-files-that-have-been-staged-ie-git-added

$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)

And just commit again.

Installing Cygwin for Drupal patch testing and development

Update: See Randy Fay's Cygwin quickstart tutorial, http://randyfay.com/node/70

Many Drupal things are best done in a UNIX-like environment. One solution is to run a Linux distribution like Ubuntu in a virtual machine, as is provided by http://drupal.org/project/quickstart. Another solution (on Microsoft Windows) is Cygwin, to bring the power of the UNIX command line to Windows.

Export and re-import a database with Drush and the command line

These are run from the project's web root, example/web, so that drush can run, but the database itself is stored outside the web root, example/db.

On the export side:

drush sql-dump > ../db/development.sql

On the import side:

drush sql-connect < ../db/development.sql

expands to:

mysql -hlocalhost -uexample -pyMsx2rIP drupal-example < ../db/development.sql

Remote drush commands

How we would probably want this to work is that "rake prod vlad:drush XXX" call "ssh prodservername drush -r /path/to/project/drupal XXX"

For instance: ssh prodservername drush -r /path/to/project/drupal enable bad_judgement

Do not overwrite files when copying from one server to another

If you are searching for a way to not overwrite files when copying files or directories recursively with scp, what you probably really want is rsync.

It will avoid copying files it does not need to copy, preserving existing files of the same name and path.

For example:

ben@ubuntu:~/code/data/drupal/sites/default/files$ rsync -av data.agaric.com:/sites/agaricdesign/www/sites/default/files/ .
receiving incremental file list
./
.htaccess
07-07 taking it all over.txt
...

Kerberos user creation and password changes for Agaric test sites

Everyday use

You can change your password at https://agariclabs.net/krb/passwd

Initial setup of a user via the command line

These commands can be run on Agaric's test server, simone.mayfirst.org.

First, to see if a username already exists, you can list them with listprincs:

sudo kadmin.local
listprincs

Then, if the user is not present, create the user.

Syndicate content