After learning about UrAI.com from a blog I frequently read: Modeled Behavior, I decided to run my own blog through the system and see what it says.
jackpo.org is probably written by a male somewhere between 66-100 years old. The writing style is academic and happy most of the time.
Now really? I had no idea I was such a cherry person.. and age 66 – 100? WTF…
In general, I have the belief that most ethics courses whether they be medical ethics or business ethics tend to be taught from too theoretical of a standpoint. Scenarios are often defined to have black and white answers, and thus the students never actually deal with true moral dilemmas until they are actually on the job. This is especially true for those who spend their lives in consulting and/or academia, with no real understanding of the pressures that actually happen in an operational environment. Having gone through some particularly stressful board meetings, I was quite excited when I heard about a new PBS production that will attempt to showcase some of the moral complexity involved:
Everyday we hear about business people who gamble on ethics to meet business goals. The ongoing stream of scandals begs the question, “Why does this keep happening?” From an Emmy-winning team of producers, “In Search of the Good Corporate Citizen” weaves together expert panel discussions with personal accounts from real-life white-collar criminals and whistleblowers.
Unable to catch the show on the air, I contacted Light On Production to try and get a copy of the DVD. After several phone calls, Denny Swenson, the producer of the show sent me a *free* copy of their first show, “Hitting the Numbers”!
I think the show is quite well done, and the stories that they showed were truly remarkable. The show leveraged a small panel to discuss each story after they were presented. The panel was moderated by Thomas Donaldson from the Wharton School of Business and was composed of:
- William W. George, the former chairman and CEO of Medtronic
- Ben Heineman, General Counsel of General Electric
- Donna C. Boehme, former chief compliance officer of BP
Given the show was filmed in 2008, one can reasonably assume that Boehme did not lose her job over the oil scandal. However, just from the body language of the panelists, it was quite obvious that they were quite dismissive of the idea of having a chief compliance officer and frankly I am as well. Perhaps such a role is indeed necessary in many large institutions, but it was not clear from the panel discussions how a CCO as described by Boehme would have in anyway contributed to ethical behaviors in an organization. What was truly disappointing with this panel was that they never really acknowledged how much pressure there was in middle management and how sometimes the decisions are actually not that black and white. Even with Donaldson offering up truly gray and realistic scenarios, the panel always converged on black and white solutions. I would assume that the panelists themselves were at least somewhat worried about their professional image if they had mention doubts. Perhaps true ethical discussions involving business executive can never happen in front of a camera?
Once in a while, I catch the startup bug due to people like Sean Burgess. So this post is based on hours of frustration that I had from setting up multiple osx machines to deploy rails. Much of this is for my own reference and borrows heavily from these sites and my own attempts on 4 different macs:
1. Preparing System
In general, just easiest to start from scratch if you haven’t used ports in a while (or have never used it). Also make sure that web sharing is OFF under System Preferences as we are going to install the apache version from macports instead.
sudo rm -rf \ /opt/local \ /Applications/DarwinPorts \ /Applications/MacPorts \ /Library/LaunchDaemons/org.macports.* \ /Library/Receipts/DarwinPorts*.pkg \ /Library/Receipts/MacPorts*.pkg \ /Library/StartupItems/DarwinPortsStartup \ /Library/Tcl/darwinports1.0 \ /Library/Tcl/macports1.0 \ ~/.macports
1.1 Download and Install Xcode & Macports
Download Page: http://www.macports.org/install.php
1.3.1 Update macports
sudo port -v selfupdate port upgrade outdated
2. Apache, php5, mysql & PhpMyAdmin
2.1 Install Apache, php5, PhpMyAdmin and misc
sudo port -v install phpmyadmin php5 php5-mysql apache2 mysql5-server mysql5 memcached libmemcached wget sqlite3 +apache2 +pear
2.2 Make apache, mysql autoload on startup
sudo -u mysql mysql_install_db5 sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist sudo port load memcached
2.3 Activating PHP5
cd /opt/local/apache2/modules sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
2.4 Add index.php to the dir_module directive
Open /opt/local/apache2/conf/httpd.conf in your favorite text editor.
<IfModule dir_module> DirectoryIndex index.html index.php </IfModule>
2.5 Add mod_php and phpmyadmin
Also, at the end of the httpd.conf file, add the following lines so that Apache includes the mod_php and phpmyadmin file
#Include PHP configurations Include conf/extra/mod_php.conf
# Local access to phpmyadmin installation Include conf/extra/httpd-phpmyadmin.conf
Set up your PHP configuration files
cd /opt/local/etc/php5 sudo cp php.ini-development php.ini
Setup the MySQL default socket to use the CentOS MySQL socket location by editing php.ini
2.6 Building my.cnf and changing the MySQL default socket to conform to CentOS (optional)
Open /opt/local/apache2/conf/httpd.conf in your favorite text editor. Add a new mimetype so that Apache will direct files ending in .php to the PHP module for processing. Add the following within the block. Without this, all you’ll see is the text of your PHP scripts
sudo cp /opt/local/share/mysql5/mysql/my-medium.cnf /etc/my.cnf sudo mkdir /var/lib/mysql/ sudo chown -R _mysql:_mysql /var/lib/mysql
Change the TWO lines in /etc/my.cnf that says
socket = /opt/local/var/run/mysql5/mysqld.sock
socket = /var/lib/mysql/mysql.sock
2.7 Create the phpmyadmin configuration file
create a file /opt/local/apache2/conf/extra/httpd-phpmyadmin.conf containing this text:
AliasMatch ^/phpmyadmin(?:/)?(/.*)?$ "/opt/local/www/phpmyadmin$1" <Directory "/opt/local/www/phpmyadmin"> Options -Indexes AllowOverride None Order allow,deny Allow from all LanguagePriority en de es fr ja ko pt-br ru ForceLanguagePriority Prefer Fallback </Directory>
2.8 Setup aliases to control the two services
sudo ln -s /opt/local/apache2/bin/apachectl /usr/sbin/apache2 sudo ln -s /opt/local/share/mysql5/mysql/mysql.server /usr/sbin/mysql.server sudo apache2 restart sudo mysql.server restart
2.9 Setup the mysql root password
Set the MySQL root password. Where is your new desired root password. You will be prompted for your existing password (“Enter password:”); since it’s empty, just press Return.
mysqladmin5 -u root -p password <new-password>
Then log into the mysql connection and use these commands (replacing your root password of course) to update all the root accoutns
mysql -u root -pmysql>
UPDATE mysql.user SET Password = PASSWORD('->
WHERE User = 'root';mysql>
2.10 Test the PHP server
Make an index.php in /opt/local/apache2/htdocs and put the following in it:<?php phpinfo(); ?>
2.11 Install and Test phpmyadmin
First make these changes in /opt/local/www/phpmyadmin/config.inc.php$cfg['blowfish_secret'] = WHATEVER YOU WANT THIS TO BE
You should see quite a bit of information regarding your php installation.
3. Ruby, Rubygems, Rails, other gems
3.1 Install Ruby from macportssudo port -v install ruby$ ruby -v ruby 1.8.7 (2010-08-08 patchlevel 302) [x86_64-darwin10]
3.2 download rubygems from http://rubygems.org/pages/downloadcd /tmp wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz tar -xvf rubygems-1.3.7.tgz cd rubygems-1.3.7 sudo ruby setup.rb
3.3 Install rails, rake, rspec etc.sudo gem install rake rails thin tzinfo capistrano ruby-debug rspec mysql sqlite3-ruby
4. ImageMagick, Rmagick and mini_magick (Optional)
lets install ImageMagick with support for JPEG, TIFF, WMF, PDF, and PNG images, and for Postscript and TrueType fonts.sudo port -v install tiff -macosx imagemagick +q8 +gs +wmfsudo gem install mini_magick rmagick
Test rmagick$ irb -rubygems -r RMagick >> puts Magick::Long_version This is RMagick 2.13.1 ($Date: 2009/12/20 02:33:33 $) Copyright (C) 2009 by Timothy P. Hunter Built with ImageMagick 6.6.3-0 2010-08-19 Q8 http://www.imagemagick.org Built for ruby 1.8.7 Web page: http://rmagick.rubyforge.org Email: firstname.lastname@example.org => nil
5.1 Install Passenger gemsudo gem install passenger
5.2 Check Passenger pathpassenger-config --root-> /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15
5.3 Build passenger for apache
and don’t worry about the other steps, we will cover them directly in the guide
5.4 Enable Passenger on apache:create /etc/apache2/extra/httpd-passenger.conf and change wherever necessary for your directories.LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2/mod_passenger.so PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.2.15 PassengerRuby /opt/local/bin/ruby PassengerMaxPoolSize 6 # maximum global rails servers PassengerMaxInstancesPerApp 2 # maximum rails servers per application RailsFrameworkSpawnerIdleTime 1800 RailsAppSpawnerIdleTime 600 PassengerPoolIdleTime 600 PassengerMaxRequests 1000 # after 1000 requests will restart server, to skip memory leak ðŸ™‚ # Enabling NameBased Virtualhost NameVirtualHost 127.0.0.1:80 # my rails app virtual host 1 <VirtualHost 127.0.0.1:80> ServerName my-rails-app.local DocumentRoot "/Users/jackpo/rails/my-rails-app/public" # change this to match your folder RailsEnv "development" <Directory /Users/jackpo/rails/my-rails-app/public> # change this to match your folder # MultiViews must be turned off Options -MultiViews AllowOverride All Order allow,deny Allow from all </Directory> # logs are optional, change this to match your folder CustomLog "/Users/jackpo/rails/my-rails-app/log/access_log" combined ErrorLog "/Users/jackpo/rails/my-rails-app/log/error_log" </VirtualHost>
5.5 Enable Virtual host on apache:
Edit /opt/local/apache2/conf/httpd.conf and add this new line at the bottom:# Include Passenger ModRails config file Include conf/extra/httpd-passenger.conf
5.6 Add your .local domain to /etc/hosts/
edit /etc/hosts and Add this line to that file and change to the name of your choosen application
You might add as many as you want, each line for each that ServerName on your VirtualHost blocks127.0.0.1 my-rails-app.local 127.0.0.1 myapp-xyz.local
5.6 Restart Apachesudo apache2 restart
go to your browser and open the url of your application http://my-rails-app.local
If it works, congratulations. If it didn’t.. uh.. try and google. I maybe able to help, but I don’t have that much time!