Brad Lucas

Programming, Clojure and other interests

Simple Emacs Mark Completed Function

October 23, 2008

I’ve been in the habit of keeping track of things in todo lists using Emacs’s outline-mode. This works great to organize things but I needed a better way to mark completed items. I have the files in source control so I could delete them and still know of them using a diff with a previous version but this is clumsy. Otherwise, I could mark items with a date or a DONE but this gets ugly. instead I have this simple emacs function that takes the current line as moves it to the bottom of the file with the date prepended.

Simple.

(defun mark-completed ()
"Move the current line to the bottom of the file and prepend the date."
(interactive)
(save-excursion
(progn
(move-beginning-of-line nil)
(kill-line 1)
(end-of-buffer)
(if (not (eq 0 (current-column)))
(newline))
(insert-date)
(insert " - ")
(yank))))
Continue reading →

Bash Function To Download A Web Site

October 23, 2008

Remembering all the options for wget is the reason for the following function. Add it your .bashrc and then run ‘wget-site URL’ and you’ll get a copy of the site locally for offline browsing

function wget-site {
wget -v -m -w 2 -p -E -k $1
}
Continue reading →

This Driver Is Not Configured For Integrated Authentication

October 22, 2008

Scenario:

You are trying to access a SQL Server database. It has been setup for integrated authentication. You know this because when you login via a tool like DBArtisan you don’t need to enter a user name or password. Authentication is through Windows itself.

Step 1:

You figure out that you need a specific JDBC url.

For example,

Continue reading →

Zipexception Error In Opening Zip File

October 21, 2008

Scenerio:

Using ant to call a taskdef that I created. It should log but needed to get the task to see my log4j.properties files.

In the path definition i put a pathelement who’s location pointed directly at the log4j.properties file. This causes the problem as it seems that Ant tries to open any file on the classpath that isn’t a jar.

Solution

Continue reading →

Bash One-Liner To Unpack Directory Of Tar Gz Files

October 20, 2008

In the directory where you have a collection of tar.gz files.

for FILE in $(ls); do tar -zxvf $FILE; done
Continue reading →