On the banking/fiat currency system
The few who understand the system will either be so interested in its profits or be so dependent upon its favours that there will be no opposition from that class, while on the other hand, the great body of people, mentally incapable of comprehending the tremendous advantage that capital derives from the system, will bear its burdens without complaint, and perhaps without even suspecting that the system is inimical to their interests.
The Rothschild brothers of London writing to associates in New York, 1863
August 10, 2007 No Comments
Indeed
“I must Create a System or be enslav’d by another Man’s”
William Blake
August 10, 2007 No Comments
apache mpm-worker or mpm-prefork
PHP5 requires prefork. mpm-worker is more efficient, prefork is for nonthreadsafe libs. apt-get wouldn’t let me install mod_php unless i changed to prefork.
http://www.gra2.com/article.php/improving-performance-rails-apache2
mod_fcgid is a possibility, but I did not want to go there.
August 10, 2007 No Comments
apt-get/dselect reference
dpkg -l
list all installed packages
August 10, 2007 No Comments
simple postgresql cli commands:
psql -d dbname -u
\? help
\d = describe
\d tablename
dump a database:
travis@debian~ $ pg_dump -d dbname -u > out.sql
prompts for user/pass
August 10, 2007 No Comments
how to cleanup stale activerecord session objects
rails 1.2 app was using a db backed session store and was kind of “neglected”:
cupid_production=> select count(*) from sessions;
count
--------
380754
(1 row)
http://www.realityforge.org/articles/2006/03/01/removing-stale-rails-sessions
http://robsanheim.com/2007/04/
http://groups.google.com/group/melbourne-ruby/browse_thread/thread/c5eecde3fb6a0b08
destroy_all is un-needed since we don’t have callbacks on the session table. use delete_all instead.
save into lib/tasks as session_cleanup.rake
desc "Clear database-stored sessions older than a day old"
task :session_cleanup => :environment do
CGI::Session::ActiveRecordStore::Session.delete_all ["updated_at < ?", 1.day.ago ]
end
setup to run daily via rake/cron
30 1 * * * cd /var/www/appname/current && rake session_cleanup RAILS_ENV=production
August 10, 2007 No Comments
mongrel issues with logrotate/ruby
i’m digging mongrel but it does not work with ruby Logger default rotation. requires logrotate to do the work.
added /etc/logrotate.d/PROJECT so logrotate will run it via cron.
rotates out apaches logs weekly, and all mongrel/rails logs weekly.
compress
missingok
weekly
rotate 52
"/var/www/PROJECT/current/log/access.log" "/var/www/PROJECT/current/log/error.log" {
olddir old
#delaycompress
notifempty
create 644 root root
sharedscripts
postrotate
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi
endscript
}
“/var/www/PROJECT/current/log/production.log” “/var/www/PROJECT/current/log/mongrel.log” “/var/www/PROJECT/current/log/statistics/*.log” {
olddir old
sharedscripts
postrotate
mongrel_rails cluster::restart -C /var/www/PROJECT/current/config/mongrel_cluster.yml
endscript
}
less than ideal if apache ran lots of other sites, could not restart apache so greedily. would need to run as a seperate logrotate task that manages all access.log/error.log across each application.
works for now with apache running just for this rails app.
http://www.redhillconsulting.com.au/blogs/simon/archives/000370.html
http://www.bjhess.com/bjhessblog/2007/08/01/rolling-your-rails-logs-with-logrotate
August 10, 2007 No Comments