Blog

log4net.config filtered logging for only one class

I found this technique useful because I have so much output sometimes that it is difficult to find the specific area that I am working in.  So by putting a DenyAllFilter at the end of your filter chain, you can narrow what you have to hunt through when looking for debug output.


How to: find and replace in files, inline and on command line

Here is a quick and dirty way to change a bunch of files, be careful :)


$ find . -name trac.ini | xargs -d'\n' sed -i "s/smtp_enabled = false/smtp_enabled - true/g"

UPDATE:

Here is a much cleaner way to do the search / replace part:

$ replace foo bar -- *


How to: set your default remote Display

on your computer, do "xhost +"(less secure) or "xhost +<remote host>" (more secure)

then on other host do: echo "export DISPLAY=<your host>:0.0" >> ~/.bashrc


How to: call ms sql server stored procedure from jdbc

Recently, I needed to call a stored procedure with parameters for some debugging purposes. I use DbVisualizer, an awesome product, and with the SQL Commander utility I can write sql to any db that supports JDBC which is awesome because most do. Here is how you can call a stored proc from straight SQL over JDBC:


{call pr_MyProcedureName @VarEndYear = 2007, @VarStartyear = 2005}


How to: restore recursive driectory execute permissions

Recently, a colleague did a "chmod -R 644" on a web directory and all the sub directories lost the execute bit, rather than simply doing a recursive chmod +x on everything, a little googling and a little spice e voila, le executionaire directoriamont fixurature:

find . -type d -exec chmod +x {} \;


Drupal svn source control notes

Here are some commands we used to get a drupal site version controlled:

svnadmin create /var/svn/repos/blowfish
sudo chown -R www-data:www-data /var/svn/repos/blowfish

svn co https://skullsquad.com/svn/blowfish
cd blowfish
mkdir trunk
mkdir branches
mkdir tags
svn add trunk branches tags
svn commit -m "initial svn repo layout"
cd trunk
mkdir files
mkdir modules
mkdir themes
svn add files modules themes
svn commit -m "initial drupal layout"


How to: tell what vesion of version of mono-addins

pkg-config --modversion mono-addins


Update to javascript preserve new lines (e.g. in Trac)

We've use and love Trac here at Skull Squadron, however we sorely miss our carefully entered newlines and have always wanted to preserve our precious whitespace.

Because I'm not an awesome python programmer, it was easier for me to just put a post render, client-side javascript fix to simply convert the newlines which were preserved in sourcecode into <br/> tags.


Submit Ticket ConsoleBufferAppender log settings

If you want to configure your logging such that it will add the last N entries into tickets submitted into Trac, add this appender to your log4.net.config file:


How to: get your bluetooth mouse working in Ubuntu 8.04

This thread on the Ubuntu forums worked for me: http://ubuntuforums.org/showpost.php?p=4618441&postcount=3