My list of firefox extensions

Firefox is my default browser and the add-ons make it even more powerful then it already is. I thought that it would be nice to share which extensions I’m using:

  • NoScript – Easily enable java/javascript/flash per domain.
  • Adblock Plus – Hide those frustrating flash ads etc.
  • ChatZilla – Open an IRC link to ask a tech question in seconds.
  • Firebug – Tweak your html, JavaScript and CSS at run-time.
  • YSlow – Measure the load times of the website your developing.
  • FoxyProxy – Easily switch between proxy servers or automatically per domain.
  • Web Developer – Show the lay-out of a website with/without CSS and w3c validate it in seconds.
  • Foxmarks – Synchronizes all my bookmarks between various computers at work and at home.

The best thing is is that most add-ons work perfect in both Linux and Windows so I have the same surf experience in both worlds.

So which add-ons do you recommend?

PowerShell PowerTab

Lately I found myself using the Microsoft PowerShell more often. But I am frequently missing intellisense. Especially when I want to access framework classes which I do not use that often. Luckily there is a very good extension script maintained by the powershell guy called PowerTab. It adds all the intellisense mumbo jumbo to the powershell and make it even more usefull then it already is.

Go to the PowerTab page

MonoDevelop 1.0 and Mono 1.9.1 on openSUSE 10.3

This weekend I moved from Ubuntu 7.10 to openSUSE 10.3 after using the distro in the vmware image that the mono-project hosts. I was impressed how quick it was installed and still impressed by the ease of use of its package management. I am now running the latest mono binaries (1.9.1) together with MonoDevelop 1.0. I needed to add the same repository for both and after upgrading most packages through yast I was finished.

I tried opening a visual studio 2008 solution which contains an .net 2.0 project with nunit tests. It is a library used by a service. Ofcourse the service won’t work but the library uses sockets, generics and multi-threading code and wasn’t sure that my unit tests would all be successful but they did!

Next test will be to see if the service can easily be ported and see if the nhibernate code will also work on mono and still get the same performance as the application on windows.

Log4net Separate configuration file and custom data

Separate configuration file for log4net settings

We always store the configuration stuff in the app.config or web.config files but at our current project we want to store settings that are different between environments outside of the default configuration files. Custom application settings and connectionstrings are stored in seperate configuration files and the log4net settings had to move too. Our configuration files are now named:

  • web.config/app.config
  • connectionstrings.config
  • appsettings.config
  • log4net.config

Getting log4net configured to read the settings from the log4net.config file was easy. It only needed the following attribute statement in the assembly info file:

[assembly: log4net.Config.XmlConfigurator(ConfigFile = “log4net.config”, Watch = true)]

Custom properties

We use the AdoNetAppender to log to the database but use several hosts to log to the same database table. We wanted to store additional information to each log message to identify which host is logging and which version it is running.

Code:

private void ConfigureLogging()
{
    System.Reflection.Assembly assembly;
    System.Diagnostics.FileVersionInfo versionInfo;
    string versionText;

    assembly = System.Reflection.Assembly.GetExecutingAssembly();
    versionInfo = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
    versionText = versionInfo.FileVersion;

    log4net.GlobalContext.Properties[“Host”] = System.Net.Dns.GetHostName();
    log4net.GlobalContext.Properties[“Version”] = VersionText;
}

Configuration:

Most appenders set the ConversationPattern parameter. To following conversation pattern uses the above custom properties. To use a custom property add %property{CustomPropertyName} to your conversation pattern.

<param name=”ConversationPattern” value=”%d [%property{Host}][%property{Version}][%t] %-5p %c – %m%n” />

The AdoNetAppender only needs additional parameter mappings. Make sure that the parameter names match the custom property names.

<parameter>
    <parameterName value=”@host” />
    <dbType value=”String” />
    <size value=”50″ />
    <layout type=”log4net.Layout.ExceptionLayout” />
</parameter>
<parameter>
    <parameterName value=”@version” />
    <dbType value=”String” />
    <size value=”23″ />
    <layout type=”log4net.Layout.ExceptionLayout” />
</parameter>

Et voila! We now get the hostname and version info logged too.

  • Recent Posts
  • Recent Comments
  • Archives
  • Categories
  • Meta