quando avrò tempo aggiungerò qualche dettaglio
funziona tutto egregiamente
(qualcosina in Ruby e forse in seguito qualcos'altro..)
export PS1="\[\033[01;34m\]\$(~/.rvm/bin/rvm-prompt) \[\033[01;32m\]\w\[\033[00;33m\]\$(__git_ps1 \" (%s)\") \[\033[01;36m\]\$\[\033[00m\] "
ruby-1.9.2-p0@d7track ~/myapp (master) $
ruby@gemset indirizzo (branch) $
git clone git://github.com/jimeh/git-aware-prompt.git ~/.bash
# from https://github.com/jimeh/git-aware-prompt
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
export DOTBASH=~/.bash
source $DOTBASH/main.sh
export PS1="\[$txtblu\]\$(~/.rvm/bin/rvm-prompt) \[$txtgrn\]\w\[$txtcyn\]\$git_branch\[$txtrst\]\$ "
export SUDO_PS1="\[$bakred\]\u@\h\[$txtrst\] \w\$ "
$(function() {
$( ".tabs" ).tabs({ cookie: {
expires: 1,
path: window.location.pathname
} });
});
# config/ldap.yml
development:
base: ou=people,dc=test,dc=com
attribute: uid
group_base: ou=groups,dc=test,dc=com
required_groups:
- ["moreMembers", "cn=users,ou=groups,dc=test,dc=com"]
uid=gmgp,ou=developpers,ou=people,dc=test,dc=com
LDAP: LDAP search: uid=gmgp
LDAP: Authorizing user uid=gmgp,ou=developpers,ou=people,dc=test,dc=com
LDAP: LDAP search: uid=gmgp
LDAP: LDAP search: uid=gmgp
LDAP: LDAP search: uid=gmgp
LDAP: User uid=gmgp,ou=people,dc=test,dc=com is not in group: cn=users,ou=groups,dc=test,dc=com
#devise_ldap_authenticatable-0.4.6/lib/devise_ldap_authenticatable/ldap_adapter.rb
27 class LdapConnect
28
29 attr_reader :ldap, :login, :login_dn
54 def dn
55 DeviseLdapAuthenticatable::Logger.send("LDAP search: #{@attribute}=#{@login}")
56 filter = Net::LDAP::Filter.eq(@attribute.to_s, @login.to_s)
57 ldap_entry = nil
58 @ldap.search(:filter => filter) {|entry| ldap_entry = entry}
59 if ldap_entry.nil?
60 @ldap_auth_username_builder.call(@attribute,@login,@ldap)
61 else
62 @login_dn = ldap_entry.dn
63 end
64 end
84 def in_required_groups?
85 return true unless ::Devise.ldap_check_group_membership
86
...
99 admin_ldap.search(:base => group_name, :scope => Net::LDAP::SearchScope_BaseObject) do |entry|
100 unless entry[group_attribute].include? @login_dn
101 DeviseLdapAuthenticatable::Logger.send("User #{@login_dn} is not in group: #{group_name }")
102 return false
103 end
104 end
105 end
$ [sudo] gem install taps $ [sudo] gem install hoptoad_notifier$ taps server [OPTIONS] local_database_url login password $ taps server sqlite://development.sqlite3 pippo pippo
== Sinatra/1.0 has taken the stage on 5000 for production with backup from Mongrel$ taps pull [OPTIONS] local_database_url remote_url$ taps pull mysql://root@localhost/nome_db_destinazione http://pippo:pippo@localhost:5000$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
# For RVM
rvm: bash curl git
# For JRuby (if you wish to use it) you will need:
jruby: aptitude install curl sun-java6-bin sun-java6-jre sun-java6-jdk
# For Ruby (MRI & ree) you should install the following OS dependencies:
ruby: aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
ruby-head: git subversion autoconf
# For IronRuby (if you wish to use it) you will need:
ironruby: aptitude install curl mono-2.0-devel
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.'&& return' come da istruzioni modifcanso come if [...] then ;
code
fi$ type rvm | head -n1
rvm è una funzione
rvm install 1.9.2
rvm 1.9.2 --default # per rendere definitivo il cambio
rvm info
rvm system --default # per tornare a ruby standard
$ script/generate mailer Notifier
exists app/models/
create app/views/notifier
exists test/unit/
create test/fixtures/notifier
create app/models/notifier.rb
create test/unit/notifier_test.rb
class Notifier < user =""> user)
def notification(user)
recipients "myname@gmail.com"#user.email
from "myname@gmail.com"
subject "New account information"
body (:user => user)# "account" => recipient
content_type "text/html"
end
end Hi <%= @user.username %>,
Thanks for joining our service! Please check back often.ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => "smtp.gmail.com",
:port => 587,
:authentication => :plain,
:domain => "myname@gmail.com",
:user_name => "myname@gmail.com",
:password => "mynamepassword",
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
script/console
Loading development environment (Rails 2.3.5)
>>
>> Notifier.deliver_notification User.first
>> #TMail::Mail port=#TMail::StringPort:id=0x..fdb3d0cc4>
bodyport= #TMail::StringPort:id=0x..fdb3cf9d2
>>