/* Browser specific (not valid) styles to make preformatted text wrap */
pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
# generates a random date
# you can simply call it like random_date to generate a simple random date
# otherwise you can pass hash values to generate like
# random_date :year => your_year, :month => range_of_month,
# :day => range_of_days, :format => format_string (same as Date#strftime)
# :return_date => true/false (will return a date object if true)
def random_date(options={})
options[:year] ||= Time.now.year
options[:month] ||= rand(12)
options[:day] ||= rand(31)
options[:format] ||= "%Y-%m-%d"
options[:return_date] ||= false
str = "#{options[:year]}-#{options[:month]}-#{options[:day]}".to_date.strftime options[:format]
date = "#{options[:year]}-#{options[:month]}-#{options[:day]}".to_date
options[:return_date] ? date : str
# if the date is invalid let's re-try we'll probably get a valid date the next time around
# we're passing format because the format needs to stay consistent
rescue ArgumentError
random_date :format => options[:format]
end
// edit httpd.conf or some included apache configuration file...
<VirtualHost *:80>
ServerName local.mysite.com
DocumentRoot /usr/local/Sites/local.mysite.com/public_html
ErrorLog /usr/local/Sites/local.mysite.com/logs/error_log
CustomLog /usr/local/Sites/local.mysite.com/logs/access_log combined
ScriptAlias /cgi-bin/ "/usr/local/Sites/local.mysite.com/public_html/cgi-bin/"
</VirtualHost>
<Directory /usr/local/Sites/local.mysite.com/public_html>
AllowOverride all
Options MultiViews Indexes FollowSymLinks Includes +ExecCGI
Order allow,deny
Allow from all
</Directory>
// then...
$ sudo sh -c 'echo "127.0.0.1 local.mysite.com" >> /etc/hosts'
$ lookupd -flushcache
$ sudo apachectl configtest
$ sudo apachectl restart
// to give apache access to a folder in your home dir...
$ sudo gpasswd -a apache yourgroup
// otherwise make sure that the directory containing your HTML files and each of its parent directories has chmod o+x set on it
# an easy way to email yourself a task in bash
# the following example will email you a a dir list
ls | mail -s "My Directory Listing" me@myemailaddress.com