I gave a lightning talk at Steel City Ruby Conf 2012 today on writing a decent README. Instead of putting the slides up somewhere, I thought I would write up a more detailed post of the talk’s points.
Active Record, PostgreSQL and Sequence Naming
If you use PostgreSQL to back your Active Record models, you should check the current names for your tables and their sequences. Prior to Active Record 3.2.7, renaming a table did not rename the associated sequence for the table’s primary key.
A demonstration may be in order.
RC File for Your Windows Command Prompt
I had trouble today with my Windows %HOME% changing and throwing off
Vagrant’s awareness of what boxes are installed.
This may be your problem if Vagrant on Windows was working happily for
you and then barks about no boxes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | |
%HOME% was different depending on whether I logged into Windows while
on my Active Directory managed network or while I was offline. When on
the AD network, %HOME% is set by policy to a mapped drive. When offline,
%HOME% is my Windows %USERPROFILE%. I installed Vagrant and some base
boxes while off my AD network and everything worked as expected. Base boxes
were added to %USERPROFILE%/.vagrant.d/. Back in the office and logged in
on the AD network, Vagrant was no longer aware of the base boxes because
%HOME% now pointed at my personal mapped drive.
Creating a batch file to set %HOME% to %USERPROFILE% solved the problem.
1 2 3 4 | |
For UNIXy goodness, name it cmdrc.bat, place it in %USERPROFILE% and then add the following to the registry so that this file is run whenever a command prompt opens.
1 2 3 4 | |
One Unity Launcher
T’was decided that the default behavior for Unity’s launcher will be to appear only on the primary monitor in Ubuntu 12.04. For some reason, when I upgraded to 12.04 (beta) today, my setting was for the launcher to appear on ALL desktops. Not a fan of it on all desktops.
For those who want to change this setting, you’ll need to install the Compiz configuration manager.
1
| |
Once installed, run it.
- Hover the Dash Home (Ubuntu icon on launcher)
- Type in
compizand click on theCompizConfig Settings Managericon that appears. - Select
Desktopon the left. - Click on
Ubuntu Unity Pluginon the right. - Select the
Experimentaltab and scroll all the way down.
The setting for where launchers appear is Launcher Monitors. As of
today (2012/04/05), you can select either Primary Desktop or All Desktops.
Give Your Gems Some Context for SELinux
Are you deploying your Ruby app to Red Hat or CentOS? Is Passenger complaining about not having permission to load the gems you have bundled with your app–e.g. failed to map segment from shared object: Permission denied–despite all the basic filesystem permissions looking correct? Would you like to avoid the nearly ubiquitous advice to disable SELinux, thus turning off the security that comes out of the box with SELinux enabled?
1
| |
chcon:: Changes the security context for those executables and libraries.-R:: (recursive) All the files here, please.-h:: Affect symbolic links instead of any referenced file.-t httpd_sys_content_t:: Set the TYPE in the security context.
We deploy with capistrano, so I have added this as a task called after
bundle:install vendors my gems to <appdir>/shared/bundle.
1 2 3 4 5 6 7 | |