Thursday, April 9, 2009

HOWTO : SVN over HTTPS

Create the repository

$ svnadmin create /home/svn/repo/svn

Install RPM mod_dav_svn

$ yum install mod_dav_svn

Config who can access the repository and their permissions (r or w) /home/svn/conf/users-access-file

[/]
gulden = rw
other = r
[/privaterepo]
*=

  • "gulden" user can access the the "/" repository with read and wright (rw) permissions
  • "other" can access the the "/" repository with read (r) permission
  • No one can access the "/privaterepo" repository

Create the Users password file

$ htpasswd /home/svn/conf/passwd gulden

Edit Apache configuration file: /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so


ServerName myhost.com
ServerAlias svn.myhost.com

Order allow,deny
Allow from all
DAV svn
SVNParentPath /home/svn/repo
# our access control policy
AuthzSVNAccessFile /home/svn/conf/users-access-file
# try anonymous access first, resort to real
# authentication if necessary.
Satisfy Any
Require valid-user
# how to authenticate a user
AuthType Basic
AuthName "My Subversion repository"
AuthUserFile /home/svn/conf/passwd




Checkout a project

$ svn co https://svn.myhost.com/svn/foo/trunk

Monday, March 9, 2009

HOW TO syntax highlight blogger : widget

For those who need syntax highlight in their blog, to several programming languages, can use the widget "Blogger Widget SyntaxHighlighter" and is powered by SyntaxHighlighter 1.5.1
Give it a try.

Saturday, March 7, 2009

Rails: Where to put our initialization stuff

In our applications we sometimes need to initialize global vars or rails predefined values. Whenever we want to do that, we just need to create files in the directory

config/initializers/

instead of messing with the environment.rb file.

Source: Ryan's Scraps: What's New in Edge Rails: Stop Littering In Your Environment File

Wednesday, February 18, 2009

Check out the new outstanding web site of MentesVirtuais




The new web site of mentesvirtuais it's really nice and causes a great impact.

Mentes Virtuais creates and develops solutions and products of excellence for an increasingly global and competitive market, on the areas of Telecommunications and Information Technology.



Thursday, February 12, 2009

qmail-toaster + spamdyke: test behaviour

If you want to test or check the spamdyke behaviour you only need to activate the debug:

Edit /etc/spamdyke/spamdyke.conf


log-level=debug


Then run the following command


$ /usr/local/bin/spamdyke --config-file /etc/spamdyke/spamdyke.conf /var/qmail/bin/qmail-smtpd /home/vpopmail/bin/vchkpw /bin/true


To send an email enter the SMTP commands:


mail from: youremail@mail.com
rcpt to: to_address@mail.com
data
subject: TEST MESSAGE
data
Put some content here...
.



You will see debug lines that shows you all the steps of spamdyke.

Wednesday, February 11, 2009

RubyonRails: How to Integrate Comatose CMS & FCKEditor tutorial in your rails application

Steps

Install CMS Comatose plugin

$ script/plugin install http://comatose-plugin.googlecode.com/svn/trunk/comatose
$ script/plugin install git://github.com/darthapo/comatose.git (For Rails 2.X)

$ script/generate comatose_migration
$ rake db:migrate


Dependencias


$ ruby script/plugin install git://github.com/rails/acts_as_list
$ ruby script/plugin install git://github.com/rails/acts_as_tree


Install FCKEditor Plugin


$ script/plugin install git://github.com/davividal/fckeditor.git


Install views in our project

$ rake comatose:admin:customize

Edit "app/views/comatose_admin/_form.rhtml"

replace:


<%= f.text_area :body, :rows=>20, :tabindex=>2 %>


with:



<%= fckeditor_textarea('page', 'body', :width => '100%', :height => '500px') %>


Add FCKEditor javascript file to

app/views/layouts/comatose_admin.rhtml

<%= javascript_include_tag :fckeditor %>

Configure FCKEditor to accept other other Files Types like "PDF".

/vendor/plugins/fckeditor/app/controllers/fckeditor_controller.rb
MIME_TYPES = [
"image/jpg",
"image/jpeg",
"image/pjpeg",
"image/gif",
"image/png",
"application/x-shockwave-flash"
]

Comatose Configurations in config/initializers/comatose.rb

Comatose.configure do |config|

config.admin_title = 'Administration'
config.admin_helpers = []
config.admin_sub_title = 'Administration Pages'
config.content_type = 'utf-8'
config.default_filter = ''
config.default_processor = :liquid
config.default_tree_level = 3
config.disable_caching = false
config.hidden_meta_fields = 'filter'
config.helpers = []
config.includes = []

# These are 'blockable' settings
config.authorization = Proc.new { true }
config.admin_get_author = Proc.new { request.env['REMOTE_ADDR'] }
config.after_setup = Proc.new { true }


# Includes AuthenticationSystem in the ComatoseAdminController
#config.admin_includes << :authenticated_system

# Calls :login_required as a before_filter
#config.admin_authorization = :login_required

end