I've been trying to understand how to setup systems from
the ground up on Ubuntu. I just installed redis onto
the box and here's how I did it and some things to look
out for.
To install:
| Your name and email address were configured automatically based | |
| on your username and hostname. Please check that they are accurate. | |
| You can suppress this message by setting them explicitly: | |
| git config --global user.name "Your Name" | |
| git config --global user.email [email protected] | |
| After doing this, you may fix the identity used for this commit with: | |
| git commit --amend --reset-author |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| # read more at https://terrty.net/2014/ssl-tls-in-nginx/ | |
| # latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf | |
| # security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net | |
| # your nginx version might not have all directives included, test this configuration before using in production against your nginx: | |
| # $ nginx -c /etc/nginx/nginx.conf -t | |
| server { | |
| # public key, contains your public key and class 1 certificate, to create: | |
| # (example for startssl) | |
| # $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null |
| # This will move all images and other Dragonfly assets from your local server file system to Amazon S3. | |
| namespace :dragonfly do | |
| task :migrate_to_s3 => :environment do | |
| # Adjust this line to meet your needs: | |
| { Product => [:image_uid, :other_uid], Page => :image_uid }.each do |klass, col| | |
| puts "Migrating #{klass.table_name}..." | |
| Array(col).each do |col| | |
| klass.where("#{col} != ''").find_each do |instance| | |
| begin |
When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.
There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the