SlideShare a Scribd company logo
1 of 32
Download to read offline
What to do when
                                  things go wrong
                       Tips and tricks for the desperate souls
       http://www.slideshare.net/dorneles/what-to-do-when-things-go-wrong


                                       Dorneles Treméa
                                        Enfold Systems
                                             X3ng
                                             APyB

                                              1
quarta-feira, 25 de novembro de 2009
Agenda

                     • Shell
                     • Buildout
                     • ZMI
                     • Debug

                                         2
quarta-feira, 25 de novembro de 2009
.profile
                        # ~/.profile: executed by the command
                        # interpreter for login shells.
                        # This file is not read by bash(1), if ~/.bash_profile
                        # or ~/.bash_login exists.

                        # if running bash
                        if [ -n "$BASH_VERSION" ]; then
                            # include .bashrc if it exists
                            if [ -f ~/.bashrc ]; then
                            . ~/.bashrc
                            fi
                        fi
                                                3
quarta-feira, 25 de novembro de 2009
.bashrc
                        # ~/.bashrc: executed by bash for non-login shells

                        # set the env variable used by python
                        export PYTHONSTARTUP=$HOME/.pythonrc

                        # Append to and update the history commands
                        shopt -s histappend
                        export PROMPT_COMMAND='history -a'

                        # Don't put duplicate lines in the history
                        export HISTCONTROL=ignoreboth
                        export HISTSIZE=50000
                                               4
quarta-feira, 25 de novembro de 2009
.bashrc (2)

                        # user@server, relative path, current time
                        export PS1='[e[32m][u@h] [e[33mw]n
                        [e[1;34m][t][e[0m] $ '

                        [dorneles@plonessa] ~/in/the/main/room
                        [16:31:45] $



                                              5
quarta-feira, 25 de novembro de 2009
.inputrc
                        # ~/.inputrc: when a program which uses the
                        # readline library starts up, the key bindings
                        # and variables are set

                        # this makes the "delete" key work
                        # rather than just entering a ~
                        "e[3~": delete-char

                        # these allow you to use ctrl+left/right arrow
                        # keys to jump the cursor over words
                        "e[5C": forward-word
                        "e[5D": backward-word
                                               6
quarta-feira, 25 de novembro de 2009
.inputrc (2)
                        # these allow you to start typing a command
                        # and use the up/down arrow to auto complete
                        # from commands in your history
                        "e[B": history-search-forward
                        "e[A": history-search-backward

                        # this lets you hit tab to auto-complete a
                        # file or directory name ignoring case
                        set completion-ignore-case on


                                               7
quarta-feira, 25 de novembro de 2009
.pdbrc

                        # Enable code completion
                        import rlcompleter, pdb
                        pdb.Pdb.complete =
                        rlcompleter.Completer(locals()).complete

                        # Print instance variables (usage "pi classInst")
                        alias pi for k in %1.__dict__.keys(): print "%1.",k,"=",
                        %1.__dict__[k]



                                                  8
quarta-feira, 25 de novembro de 2009
.pdbrc (2)
                        >>> class Foo(object):
                        ...    def bar(self):
                        ...       return True
                        ...
                        >>> import pdb; pdb.set_trace()
                        (Pdb) p Foo
                        <class '__main__.Foo'>
                        (Pdb) pi Foo
                        ...

                        Alternatively, you can also use `ipdb`.

                                                 9
quarta-feira, 25 de novembro de 2009
ipython / bpython


                        Do I need to say anything? :-)



                                           10
quarta-feira, 25 de novembro de 2009
.buildout/default.cfg

                        [buildout]
                        zope-directory=/home/user/cache/zope
                        download-cache=/home/user/cache/download
                        download-directory=/home/user/cache/download
                        eggs-directory=/home/user/cache/eggs




                                            11
quarta-feira, 25 de novembro de 2009
When buildout goes
                                wild...
                     • bin/buildout -U
                      • Avoid reading ~/.buildout/default.cfg
                     • bin/buildout -D
                      • Drops you in pdb at the point where the
                                   exception happened


                                                  12
quarta-feira, 25 de novembro de 2009
Environment Variables

                        environment-vars =
                            DISABLE_PTS True
                            TMP ${buildout:directory}/var/tmp
                            PYTHON_EGG_CACHE
                               ${buildout:directory}/var/.python-eggs



                                            13
quarta-feira, 25 de novembro de 2009
Buildout Extensions
                     • mr.developer
                     • buildout.dumppickedversions
                            [buildout]
                            extensions =
                               mr.developer
                               buildout.dumppickedversions
                            [sources]
                            my.pack = svn http://foo.com/my.pack/trunk

                                              14
quarta-feira, 25 de novembro de 2009
Problematic packages:
                       compatibility with 3.x
                        plone.recipe.zope2instance = 3.6

                        Products.CMFCore = 2.1.2
                        Products.Marshall = 1.2.1
                        Products.Archetypes = 1.5.13
                        Products.validation = 1.6.3
                        Products.LinguaPlone = 2.4
                        Products.TextIndexNG3 = 3.2.17
                        Products.GenericSetup = 1.4.5
                        Products.PortalTransforms = 1.6.4
                        Products.MimetypesRegistry = 1.6.4
                                              15
quarta-feira, 25 de novembro de 2009
Buildout Recipes:
                                           omelette
                     • collective.recipe.omelette
                            [omelette]
                            recipe = collective.recipe.omelette
                            eggs = ${instance:eggs}
                            products = ${instance:products}
                            packages = ${zope2:location}/lib/python ./
                            location = ${buildout:directory}/source


                                               16
quarta-feira, 25 de novembro de 2009
Buildout Recipes:
                                            ipzope
        •       collective.recipe.omelette
               [ipzope]
               # Put a copy of the following inside your $HOME/.ipython directory:
               # http://svn.plone.org/svn/collective/dotipython/trunk/ipy_profile_zope.py
               recipe = zc.recipe.egg
               eggs = ipython ${instance:eggs}
               initialization =
                   import sys, os
                   os.environ["SOFTWARE_HOME"] = "${zope2:location}/lib/python"
                   os.environ["INSTANCE_HOME"] = "${instance:location}"
                   sys.argv[1:1] = "-p zope".split()
               extra-paths = ${zope2:location}/lib/python
               scripts = ipython=ipzope
                                                 17
quarta-feira, 25 de novembro de 2009
Managing Zope
                     • Use the right user:
                               $ bin/instance start/stop/...
                               # bin/instance start/stop/...
                     • It’s different and in certain conditions it can
                             produce unexpected results: unattached
                             and zombie processes!


                                                   18
quarta-feira, 25 de novembro de 2009
Debug Modes
                     • Zope Debug
                      • $bin/instance debug
                      • $bin/instance fg
                        • Overrides settings from etc/zope.conf
                     • CSS/JS/KSS Debug
                     • Better behavior on Plone 4.0
                                            19
quarta-feira, 25 de novembro de 2009
Accessing Zope
                     • Unlock yourself
                      • $ echo foo:bar > parts/instance/access
                      • Update the (or create a new) Manager
                                   user in the acl_users folder
                           • $ rm parts/instance/access (important!)
                     • ZODB root
                      • http://.../aq_parent/manage
                                                    20
quarta-feira, 25 de novembro de 2009
Access Rules
                     • Plone used to ship with Extensions/
                             accessRule.py (dropped starting on 4.0)
                     • Environment variables
                      • HTTP_MANAGE
                      • SUPPRESS_ACCESSRULE
                     • http://.../_SUPPRESS_ACCESSRULE/manage
                                                21
quarta-feira, 25 de novembro de 2009
Different users in
                                  the same browser
                     • http://127.0.0.1/...
                     • http://127.0.0.2/...
                     • http://localhost/...
                     • http://new_alias/...
                     • Edit /etc/hosts and add as many host name
                             aliases as you need!

                                                22
quarta-feira, 25 de novembro de 2009
portal_setup
                     • It’s very important to sure to choose
                             the correct profile when importing
                             the selected or all the steps!
                     • Undo is your friend, for sure...
                     • If everything else fail, you still can try to
                             import the individual steps from the
                             correct profiles in the correct order

                                                23
quarta-feira, 25 de novembro de 2009
portal_workflow
                     • Make sure to always click in the mystical
                             ‘Update security settings’ button to update
                             the EXISTING objects after changing the
                             security related settings
                     • New objects will be always created with
                             the right permissions
                     • Avoid change individual object permissions
                             that are managed by workflows

                                                24
quarta-feira, 25 de novembro de 2009
Long running processes

                     • It can be tricky due the way how browsers
                             handle requests: timeout!
                     • Use REQUEST.RESPONSE.write instead of
                             print/return printed, this guarantee that the
                             browser receives a continuous stream and
                             don’t timeout


                                                 25
quarta-feira, 25 de novembro de 2009
Helpful packages

                     • Products.Clouseau
                     • Products.Gloworm
                     • Products.DocFinderTab
                     • Products.PDBDebugMode

                                              26
quarta-feira, 25 de novembro de 2009
Reloading & Freezing

                     • plone.reload
                     • mr.freeze
                      • non-debug: stack, pony
                      • debug: freeze, freeze [file] [line #]
                      • planned: reload code, reload zcml
                                           27
quarta-feira, 25 de novembro de 2009
Firefox Plugins
                     • Firebug
                      • Firecookie
                      • Firediff
                      • YSlow
                      • FirePython
                     • Web Developer
                                              28
quarta-feira, 25 de novembro de 2009
Validators

                     • http://validator.w3c.org
                     • http://jigsaw.w3.org/css-validator
                      • It helps to avoid headaches when
                                   turning off the debug mode



                                                   29
quarta-feira, 25 de novembro de 2009
And the thanks goes to...

                     • Alexander Limi
                     • Jarn (Plone Solutions)
                     • Enfold Systems
                     • Plone Foundation
                     • The fantastic Plone Community!
                                         30
quarta-feira, 25 de novembro de 2009
That’s it!

                     • Thank you!
                     • Dorneles Treméa
                     • dorneles@tremea.com

                                           31
quarta-feira, 25 de novembro de 2009
Ah... I almost forgot!


                        I'd like to see a Plone Conference
                        or Symposium (or whatever!) in
                        California! ;-)



                                         32
quarta-feira, 25 de novembro de 2009

More Related Content

What's hot

Concurrency in go
Concurrency in goConcurrency in go
Concurrency in goborderj
 
RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!Gautam Rege
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of GoFrank Müller
 
Minimal MVC in JavaScript
Minimal MVC in JavaScriptMinimal MVC in JavaScript
Minimal MVC in JavaScriptMosky Liu
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script ProgrammingLin Yo-An
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go ProgrammingLin Yo-An
 
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...Puppet
 
Doing It Wrong with Puppet -
Doing It Wrong with Puppet - Doing It Wrong with Puppet -
Doing It Wrong with Puppet - Puppet
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011tobiascrawley
 
Modern Objective-C @ Pragma Night
Modern Objective-C @ Pragma NightModern Objective-C @ Pragma Night
Modern Objective-C @ Pragma NightGiuseppe Arici
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual MachineRadu Murzea
 
Demystifying the Go Scheduler
Demystifying the Go SchedulerDemystifying the Go Scheduler
Demystifying the Go Schedulermatthewrdale
 
Inheritance compiler support
Inheritance compiler supportInheritance compiler support
Inheritance compiler supportSyed Zaid Irshad
 
VIM for (PHP) Programmers
VIM for (PHP) ProgrammersVIM for (PHP) Programmers
VIM for (PHP) ProgrammersZendCon
 

What's hot (20)

Concurrency in go
Concurrency in goConcurrency in go
Concurrency in go
 
RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!RubyConf Portugal 2014 - Why ruby must go!
RubyConf Portugal 2014 - Why ruby must go!
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Beauty and Power of Go
Beauty and Power of GoBeauty and Power of Go
Beauty and Power of Go
 
Minimal MVC in JavaScript
Minimal MVC in JavaScriptMinimal MVC in JavaScript
Minimal MVC in JavaScript
 
Vim Script Programming
Vim Script ProgrammingVim Script Programming
Vim Script Programming
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
The Puppet Debugging Kit: Building Blocks for Exploration and Problem Solving...
 
Doing It Wrong with Puppet -
Doing It Wrong with Puppet - Doing It Wrong with Puppet -
Doing It Wrong with Puppet -
 
Unit Testing Lots of Perl
Unit Testing Lots of PerlUnit Testing Lots of Perl
Unit Testing Lots of Perl
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
 
Vim Hacks
Vim HacksVim Hacks
Vim Hacks
 
C++ Core Guidelines
C++ Core GuidelinesC++ Core Guidelines
C++ Core Guidelines
 
Modern Objective-C @ Pragma Night
Modern Objective-C @ Pragma NightModern Objective-C @ Pragma Night
Modern Objective-C @ Pragma Night
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual Machine
 
Demystifying the Go Scheduler
Demystifying the Go SchedulerDemystifying the Go Scheduler
Demystifying the Go Scheduler
 
Inheritance compiler support
Inheritance compiler supportInheritance compiler support
Inheritance compiler support
 
Slides
SlidesSlides
Slides
 
VIM for (PHP) Programmers
VIM for (PHP) ProgrammersVIM for (PHP) Programmers
VIM for (PHP) Programmers
 
Sdl Basic
Sdl BasicSdl Basic
Sdl Basic
 

Similar to What to do when things go wrong

あなたの知らないネットワークプログラミングの世界
あなたの知らないネットワークプログラミングの世界あなたの知らないネットワークプログラミングの世界
あなたの知らないネットワークプログラミングの世界Ryousei Takano
 
One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009Philippe Gamache
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageRené Ribaud
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...Docker, Inc.
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...Christy Norman
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
Background Processing in Ruby on Rails
Background Processing in Ruby on RailsBackground Processing in Ruby on Rails
Background Processing in Ruby on Railsrobmack
 
Lets make better scripts
Lets make better scriptsLets make better scripts
Lets make better scriptsMichael Boelen
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlBruce Gray
 
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneruJak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneruVašek Boch
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101bokonen
 
Exploring Code with Pry!
Exploring Code with Pry!Exploring Code with Pry!
Exploring Code with Pry!Clayton Parker
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to youguestdd9d06
 
Im trying to run make qemu-nox In a putty terminal but it.pdf
Im trying to run  make qemu-nox  In a putty terminal but it.pdfIm trying to run  make qemu-nox  In a putty terminal but it.pdf
Im trying to run make qemu-nox In a putty terminal but it.pdfmaheshkumar12354
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell ScriptingRaghu nath
 

Similar to What to do when things go wrong (20)

あなたの知らないネットワークプログラミングの世界
あなたの知らないネットワークプログラミングの世界あなたの知らないネットワークプログラミングの世界
あなたの知らないネットワークプログラミングの世界
 
One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009One hour application - PHP Quebec Conference 2009
One hour application - PHP Quebec Conference 2009
 
Bash is not a second zone citizen programming language
Bash is not a second zone citizen programming languageBash is not a second zone citizen programming language
Bash is not a second zone citizen programming language
 
Paexec -- distributed tasks over network or cpus
Paexec -- distributed tasks over network or cpusPaexec -- distributed tasks over network or cpus
Paexec -- distributed tasks over network or cpus
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Background Processing in Ruby on Rails
Background Processing in Ruby on RailsBackground Processing in Ruby on Rails
Background Processing in Ruby on Rails
 
Unix tips and tricks
Unix tips and tricksUnix tips and tricks
Unix tips and tricks
 
Lets make better scripts
Lets make better scriptsLets make better scripts
Lets make better scripts
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Yapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line PerlYapc::NA::2009 - Command Line Perl
Yapc::NA::2009 - Command Line Perl
 
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneruJak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
Jak se ^bonami\.(cz|pl|sk)$ vešlo do kontejneru
 
2010 Smith Scripting101
2010 Smith Scripting1012010 Smith Scripting101
2010 Smith Scripting101
 
Exploring Code with Pry!
Exploring Code with Pry!Exploring Code with Pry!
Exploring Code with Pry!
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to you
 
Im trying to run make qemu-nox In a putty terminal but it.pdf
Im trying to run  make qemu-nox  In a putty terminal but it.pdfIm trying to run  make qemu-nox  In a putty terminal but it.pdf
Im trying to run make qemu-nox In a putty terminal but it.pdf
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

What to do when things go wrong

  • 1. What to do when things go wrong Tips and tricks for the desperate souls http://www.slideshare.net/dorneles/what-to-do-when-things-go-wrong Dorneles Treméa Enfold Systems X3ng APyB 1 quarta-feira, 25 de novembro de 2009
  • 2. Agenda • Shell • Buildout • ZMI • Debug 2 quarta-feira, 25 de novembro de 2009
  • 3. .profile # ~/.profile: executed by the command # interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile # or ~/.bash_login exists. # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f ~/.bashrc ]; then . ~/.bashrc fi fi 3 quarta-feira, 25 de novembro de 2009
  • 4. .bashrc # ~/.bashrc: executed by bash for non-login shells # set the env variable used by python export PYTHONSTARTUP=$HOME/.pythonrc # Append to and update the history commands shopt -s histappend export PROMPT_COMMAND='history -a' # Don't put duplicate lines in the history export HISTCONTROL=ignoreboth export HISTSIZE=50000 4 quarta-feira, 25 de novembro de 2009
  • 5. .bashrc (2) # user@server, relative path, current time export PS1='[e[32m][u@h] [e[33mw]n [e[1;34m][t][e[0m] $ ' [dorneles@plonessa] ~/in/the/main/room [16:31:45] $ 5 quarta-feira, 25 de novembro de 2009
  • 6. .inputrc # ~/.inputrc: when a program which uses the # readline library starts up, the key bindings # and variables are set # this makes the "delete" key work # rather than just entering a ~ "e[3~": delete-char # these allow you to use ctrl+left/right arrow # keys to jump the cursor over words "e[5C": forward-word "e[5D": backward-word 6 quarta-feira, 25 de novembro de 2009
  • 7. .inputrc (2) # these allow you to start typing a command # and use the up/down arrow to auto complete # from commands in your history "e[B": history-search-forward "e[A": history-search-backward # this lets you hit tab to auto-complete a # file or directory name ignoring case set completion-ignore-case on 7 quarta-feira, 25 de novembro de 2009
  • 8. .pdbrc # Enable code completion import rlcompleter, pdb pdb.Pdb.complete = rlcompleter.Completer(locals()).complete # Print instance variables (usage "pi classInst") alias pi for k in %1.__dict__.keys(): print "%1.",k,"=", %1.__dict__[k] 8 quarta-feira, 25 de novembro de 2009
  • 9. .pdbrc (2) >>> class Foo(object): ... def bar(self): ... return True ... >>> import pdb; pdb.set_trace() (Pdb) p Foo <class '__main__.Foo'> (Pdb) pi Foo ... Alternatively, you can also use `ipdb`. 9 quarta-feira, 25 de novembro de 2009
  • 10. ipython / bpython Do I need to say anything? :-) 10 quarta-feira, 25 de novembro de 2009
  • 11. .buildout/default.cfg [buildout] zope-directory=/home/user/cache/zope download-cache=/home/user/cache/download download-directory=/home/user/cache/download eggs-directory=/home/user/cache/eggs 11 quarta-feira, 25 de novembro de 2009
  • 12. When buildout goes wild... • bin/buildout -U • Avoid reading ~/.buildout/default.cfg • bin/buildout -D • Drops you in pdb at the point where the exception happened 12 quarta-feira, 25 de novembro de 2009
  • 13. Environment Variables environment-vars =    DISABLE_PTS True    TMP ${buildout:directory}/var/tmp    PYTHON_EGG_CACHE ${buildout:directory}/var/.python-eggs 13 quarta-feira, 25 de novembro de 2009
  • 14. Buildout Extensions • mr.developer • buildout.dumppickedversions [buildout] extensions = mr.developer buildout.dumppickedversions [sources] my.pack = svn http://foo.com/my.pack/trunk 14 quarta-feira, 25 de novembro de 2009
  • 15. Problematic packages: compatibility with 3.x plone.recipe.zope2instance = 3.6 Products.CMFCore = 2.1.2 Products.Marshall = 1.2.1 Products.Archetypes = 1.5.13 Products.validation = 1.6.3 Products.LinguaPlone = 2.4 Products.TextIndexNG3 = 3.2.17 Products.GenericSetup = 1.4.5 Products.PortalTransforms = 1.6.4 Products.MimetypesRegistry = 1.6.4 15 quarta-feira, 25 de novembro de 2009
  • 16. Buildout Recipes: omelette • collective.recipe.omelette [omelette] recipe = collective.recipe.omelette eggs = ${instance:eggs} products = ${instance:products} packages = ${zope2:location}/lib/python ./ location = ${buildout:directory}/source 16 quarta-feira, 25 de novembro de 2009
  • 17. Buildout Recipes: ipzope • collective.recipe.omelette [ipzope] # Put a copy of the following inside your $HOME/.ipython directory: # http://svn.plone.org/svn/collective/dotipython/trunk/ipy_profile_zope.py recipe = zc.recipe.egg eggs = ipython ${instance:eggs} initialization =    import sys, os    os.environ["SOFTWARE_HOME"] = "${zope2:location}/lib/python"    os.environ["INSTANCE_HOME"] = "${instance:location}"    sys.argv[1:1] = "-p zope".split() extra-paths = ${zope2:location}/lib/python scripts = ipython=ipzope 17 quarta-feira, 25 de novembro de 2009
  • 18. Managing Zope • Use the right user: $ bin/instance start/stop/... # bin/instance start/stop/... • It’s different and in certain conditions it can produce unexpected results: unattached and zombie processes! 18 quarta-feira, 25 de novembro de 2009
  • 19. Debug Modes • Zope Debug • $bin/instance debug • $bin/instance fg • Overrides settings from etc/zope.conf • CSS/JS/KSS Debug • Better behavior on Plone 4.0 19 quarta-feira, 25 de novembro de 2009
  • 20. Accessing Zope • Unlock yourself • $ echo foo:bar > parts/instance/access • Update the (or create a new) Manager user in the acl_users folder • $ rm parts/instance/access (important!) • ZODB root • http://.../aq_parent/manage 20 quarta-feira, 25 de novembro de 2009
  • 21. Access Rules • Plone used to ship with Extensions/ accessRule.py (dropped starting on 4.0) • Environment variables • HTTP_MANAGE • SUPPRESS_ACCESSRULE • http://.../_SUPPRESS_ACCESSRULE/manage 21 quarta-feira, 25 de novembro de 2009
  • 22. Different users in the same browser • http://127.0.0.1/... • http://127.0.0.2/... • http://localhost/... • http://new_alias/... • Edit /etc/hosts and add as many host name aliases as you need! 22 quarta-feira, 25 de novembro de 2009
  • 23. portal_setup • It’s very important to sure to choose the correct profile when importing the selected or all the steps! • Undo is your friend, for sure... • If everything else fail, you still can try to import the individual steps from the correct profiles in the correct order 23 quarta-feira, 25 de novembro de 2009
  • 24. portal_workflow • Make sure to always click in the mystical ‘Update security settings’ button to update the EXISTING objects after changing the security related settings • New objects will be always created with the right permissions • Avoid change individual object permissions that are managed by workflows 24 quarta-feira, 25 de novembro de 2009
  • 25. Long running processes • It can be tricky due the way how browsers handle requests: timeout! • Use REQUEST.RESPONSE.write instead of print/return printed, this guarantee that the browser receives a continuous stream and don’t timeout 25 quarta-feira, 25 de novembro de 2009
  • 26. Helpful packages • Products.Clouseau • Products.Gloworm • Products.DocFinderTab • Products.PDBDebugMode 26 quarta-feira, 25 de novembro de 2009
  • 27. Reloading & Freezing • plone.reload • mr.freeze • non-debug: stack, pony • debug: freeze, freeze [file] [line #] • planned: reload code, reload zcml 27 quarta-feira, 25 de novembro de 2009
  • 28. Firefox Plugins • Firebug • Firecookie • Firediff • YSlow • FirePython • Web Developer 28 quarta-feira, 25 de novembro de 2009
  • 29. Validators • http://validator.w3c.org • http://jigsaw.w3.org/css-validator • It helps to avoid headaches when turning off the debug mode 29 quarta-feira, 25 de novembro de 2009
  • 30. And the thanks goes to... • Alexander Limi • Jarn (Plone Solutions) • Enfold Systems • Plone Foundation • The fantastic Plone Community! 30 quarta-feira, 25 de novembro de 2009
  • 31. That’s it! • Thank you! • Dorneles Treméa • dorneles@tremea.com 31 quarta-feira, 25 de novembro de 2009
  • 32. Ah... I almost forgot! I'd like to see a Plone Conference or Symposium (or whatever!) in California! ;-) 32 quarta-feira, 25 de novembro de 2009