SbF₅
At which I operate a blog because my server is otherwise idle
RSS
  • Terms of Use

How I set up nginx

By cduan On April 21, 2012 · 1 Comment · In Uncategorized
This is how I set up nginx. The post is mostly here so I remember what to do the next time around.
Read Full Article →

Ruby which-like command (rwhich)

By cduan On February 6, 2011 · Add Comment · In Uncategorized
Here is a Ruby script to find libraries (like the ones used with require). It is like the Unix which tool.
Read Full Article →

Bug fix for FastRI

By cduan On February 6, 2011 · Add Comment · In Uncategorized
I recently installed FastRI to speed up retrieving Ruby documentation. Following the directions on the website, I installed it from the source tarball rather than as a rubygem. Then, when I tried it, I received this error: sbf5:~/fastri-0.3.1> qri /usr/lib/ruby/1.8/rdoc/ri/ri_paths.rb:61: uninitialized constant Gem::Version (NameError) from /usr/lib/ruby/1.8/rdoc/ri/ri_paths.rb:57:in `each' from /usr/lib/ruby/1.8/rdoc/ri/ri_paths.rb:57 from /usr/local/lib/site_ruby/1.8/fastri/util.rb:38:in `require' from [...]
Read Full Article →

Produce entropy for /dev/random in Linux

By cduan On April 4, 2010 · 1 Comment · In Uncategorized
I was generating GnuPG keys, and got the following message: Not enough random bytes available. Please do some other work to give the OS a chance to collect more entropy! (Need 274 more bytes) We need to generate a lot of random bytes. It is a good idea to perform some other action (type on [...]
Read Full Article →

User Home Directories in Nginx, Part 3

By cduan On April 2, 2010 · Add Comment · In Uncategorized
I recently upgraded to the newest version of Nginx, and discovered that the technique I described in my previous two posts no longer works. The good news is that it no longer works because some of the bugs in Nginx were fixed, and the reason I needed that complicated workaround solution was because [...]
Read Full Article →

Autoloading Classes when Deserializing YAML Objects (or, What Is This YAML::Object?)

By cduan On February 16, 2010 · 1 Comment · In Rails
Rails will automatically load Ruby files from your /app, /lib, and other directories when you use the appropriately named constant. For example, if you use the name RailsExampleObject in your code, Rails will automatically look for a file called rails_example_object.rb and load it. However, this autoloading of classes fails when deserializing objects from YAML. This [...]
Read Full Article →

Fun with XeTeX and Fonts

By cduan On May 7, 2009 · 3 Comments · In Uncategorized
XeTeX is an improvement upon the famous typesetting system TeX. XeTeX provides Unicode support and native support for standard fonts. Unfortunately, XeTeX is fairly poorly documented. Here are some interesting findings I have come across (some particular to XeTeX, others just general ideas for TeX and LaTeX).
Read Full Article →

Encrypting Files with openssl

By cduan On April 15, 2009 · 3 Comments · In Uncategorized
Here is how to encrypt and decrypt files using public-key encryption and openssl. I prefer this over GPG because openssl is installed everywhere (including OS X by default) and it requires no specialized subsystem (keyrings, etc.). Just two key files and the document to be encrypted.
Read Full Article →

Choose a Random SQL Table Row Efficiently

By cduan On April 13, 2009 · Add Comment · In Uncategorized
How do you select a random row from a SQL table? I can find three popular solutions on the web. The first is to sort the table randomly and take the first value. The second is to select a random number between 1 and the number of rows in the table, traverse that many rows [...]
Read Full Article →

How I Set Up a New Web App

By cduan On April 5, 2009 · Add Comment · In Rails
Create the directory, and run git init Add the repository to gitosis, add users, add webadmin with readonly access Initialize the Rails project, with rails . Initialize Capistrano, with capify . Add the .gitignore file Rename config/database.yml to config/database.[USER].yml, and softlink database.yml to that file, modifying it as necessary Modify the file config/deploy.rb; see other [...]
Read Full Article →
← Previous Entries
  • Categories

    • Rails
    • Uncategorized
  • Archives

    • April 2012
    • February 2011
    • April 2010
    • February 2010
    • May 2009
    • April 2009
    • January 2009
    • November 2008
    • October 2008
  • Calendar

    May 2012
    S M T W T F S
    « Apr    
     12345
    6789101112
    13141516171819
    20212223242526
    2728293031  
  • Meta

    • Log in
    • Entries (RSS)
  • Terms of Use
Build a website with PageLines