bash

Posted by acrollet
Updated 27.i.2010 to reflect mig5's corrections
Posted by acrollet

I recently had to update a number of drupal installations, some of them quite old. Here is a bash "few-liner" to migrate an install to CVS, making it much easier to update in the future.


cd your_drupal_dir
# replace DRUPAL-6-12 with the appropriate version tag
cvs -z6 -d :pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal checkout \
-r DRUPAL-6-12 new_drupal
rm -rf new_drupal/sites
mkdir old_drupal
for i in `ls drupal`; do mv $i old_drupal; mv drupal/$i .; done
# if you have drush
drush updatedb
# make sure everything's working, then rm -rf old_drupal

Standard disclaimers apply, hope this helps some people!

Posted by acrollet
Not too much to share today - just a couple neat little things I ran across over the past couple of days, to wit:
1. if you give chown a user with a trailing colon, it will automatically use that user's default group. ex:
  1. root@rollett:~/blog# touch t
  2. root@rollett:~/blog# ls -l t
  3. -rw-r--r-- 1 root root 0 Feb 23 22:21 t
  4. root@rollett:~/blog# chown www-data: t
  5. root@rollett:~/blog# ls -l t
  6. -rw-r--r-- 1 www-data www-data 0 Feb 23 22:21 t
2. Pinfo is a more user-friendly info file reader/browser. The jk keys do what any God-fearing vi user would expect them to.
@rant: I don't want to learn emacs keystrokes just to read info that should have been in the man page! durn kids these days...

that's all for today!
Posted by acrollet

This is the first of a series of at least two posts about how I've configured the excellent Gnu Screen to fit my needs and make me more productive.

Posted by acrollet
A co-worker sold me on the utility of having a program like Yojimbo. However, I'm too cheap to shell out the $39 for a license, and I prefer to have vi key bindings, and complete keyboard control. I found an excellent post at make-believe.org which describes a system for note-taking using a little bash magic for searching and command line tab completion, and vim for editing. I liked it a lot, but decided to add tagging to the system. Read on to find out how I did it.

host:~ $ note testnote
Posted by acrollet

While I was working on a website migration for work, I found myself wanting a way to preserve formatting without keeping really poorly formatted html. (probably made by Word, a lot of blockquotes instead of list tags, etc.)