I had a problem where a Rails application communicated with a third-party API (Dropbox) to do some actions. The request would take significantly more time than a regular request, lasting for more than 15 second easily (fetching numerous directories and files).
Your browser won’t timeout on such requests, but in my case, Varnish was. It would serve me with the following message:
Clearly this is a safeguard of Varnish. It’s easy to fix this with a settings change in your ‘vim /etc/varnish/default.vcl’ file.
December 29, 2011 at 2:45pm
0 notes
I’ve been using Linode to host my websites for the past 2+ years and I’m thoroughly impressed by the service. I can’t recommend them enough — it is easily the best web hosting service I’ve used to date.
Couldn’t agree more.
December 28, 2011 at 8:31am
0 notes
Wkhtmltopdf is an open source project that uses the WebKit rendering engine to convert HTML to native PDF code. This is the muscle behind the PDFKit gem and other projects like WickedPdf. In this article I am only going to focus on PDFKit with Rails. But many topics will apply to both PDFKit and WickedPdf since they use wkhtmltopdf on the backside.
Great guide for starting with PDFKit.
From time to time, I run an Ubuntu virtual host on my Mac OSX machine (in VirtualBox) for testing and trying. It took me a while to figure out, how to setup this virtual machine so it has access to the Internet as well as local access to my host.
For referencial purposes, here goes:
In your VirtualBox preferences, add a ‘host-only network’ (vboxnet0).
Adapter Settings:
DHCP Server:
Make sure you have your VirtualBox instance set up with two networks interfaces: NAT (1) and Host-only (2). Default settings are ok.
On your Ubuntu guest:
And then restart your networing.
Additionally, I configure my local Linux machine as a headless OS, as a result I only access it through SSH.
And reboot
November 23, 2011 at 2:35pm
0 notes
In the modern era, software is commonly delivered as a service: called web apps, or software-as-a-service. The twelve-factor app is a methodology for building software-as-a-service apps that:
- Use declarative formats for setup automation, to minimize time and cost for new developers joining the project;
- Have a clean contract with the underlying operating system, offering maximum portability between execution environments;
- Are suitable for deployment on modern cloud platforms, obviating the need for servers and systems administration;
- Minimize divergence between development and production, enabling continuous deployment for maximum agility;
- And can scale up without significant changes to tooling, architecture, or development practices.
Source: http://www.12factor.net
Quick note to self.
If you deploy a Rails application (with Capistrano for instance) to a Passenger / nginx server, you have to make sure you don’t deploy the app as user ‘root’ (I hear people say ‘never ever use root!’ … oh well).
Why not?
Passenger will run your Rails application as the user who owns the config/environment.rb file (see help). If the owner of this file is ‘root’, the user is switched to the default Passenger user, which is by default ‘nobody’.
This might result in insufficient permissions for actions like writing to a database file or when compiling assets.
Gitlab might finally be the front-end for a self-hosted git server. I’ve lost countless hours trying to install Gitalist and had too many ugly systems installed. But, no more, I hope.
(Gitolite support will be available in v 2.0)
2.