Archive for August 26th, 2008

Ruby on Rails 1.2 and above automatically set a Content-type header including charset=UTF-8, which is well and good if you’re designing an application from scratch – JoelOnSoftware has a good introduction to character sets, for those who need a refresher – but breaks things in subtle ways if you are upgrading a legacy Rails 1.1 application. The (poorly documented at best) solution to this problem is to add a line to the config block of environment.rb to set config.action_controller.default_charset:

Rails::Initializer.run do |config|
  config.action_controller.default_charset = "iso-8859-1"
end
DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , ,

Comments No Comments »

It has been awhile since I created a custom service to use in a firewall policy on a Fortinet firewall and I was having trouble. I was thinking of the service as a NAT rule where you map the port one to one such as wanting to allow SSH you would have the firewall NAT through port 22 for each the incoming and outgoing. The FortiOS is more granular than that and allows you to specify the source port of the client instead of the port that is hitting the firewall. The source port is instead the source port of the client so it could be anything from port 1024 to port 655535. Visit Fortinet knowledge center for a step by step of how to create the custom service and assign it to a policy.

DeliciousStumbleUponDiggTwitterFacebookRedditLinkedInEmail
Tags: , , , , , ,

Comments No Comments »