Fortytools-Blog mit News für Handwerker und Dienstleister

Hier finden Sie aktuelle Informationen, Tipps und Tricks rund um Büro, Verwaltung, Einsatzplanung und mehr!

Tech

Currently, there is a very annoying bug in Rails (at least in 3, dunno about 2) which completely messes up your nice i18n setup in production environments. If you have set cache_classes set to true, all i18n strings in your model classes will fall back to the default locale (EN that is) because the i18n subsystem is not yet initialized when classes are loaded eagerly.

See this bug for reference. Although it is already fixed, it seems like it did ...

Weiterlesen

A few days ago, I quickly wanted to protect something on a development system with a password. Nothing very secure, nothing sophisticated. Usually one solves this by putting some rules into .htaccess. Done. But unfortunately, there was no Apache. And I didn’t really feel like fiddling around with roles and tomcat-users.xml…

So being quite naive I thought “you cannot be the only one with this problem, Google should find something”. Surprisingly enough, it didn’t (or my Google skills are way off). Hence I ramped my own:

package com.fortytools.servlet;

import java.io.IOException;

import javax.annotation.Nonnull;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import ja...
Weiterlesen

Currently, there is a lot of buzz around about NoSQL databases. Bold claims are made about NoSQL databases like they “typically scale horizontally”, are “generally designed for horizontal scalability” or “provide developers with levels of […] and scalability not easily attainable using traditional relational databases”. It seems that a NoSQL database inevitably is highly scalable.

This is wrong and misleading. I think, people seem to mix up two completely unrelated things here. For me, the term “NoS...

Weiterlesen

When I tried to setup up a Hudson job for continuously running our unit and Cucumber tests, I came across several difficulties (e.g. producing proper output which is readable by Hudson). These ultimately lead to writing a custom Rake task for properly setting up and running the tests.

The task requires the ci_reporter plugin to generate JUnit output from the unit tests (Cucumber supports this out of the box). Additionally, everything required for gathering code coverage data is included as well.

Put this into lib/tasks/hudson.rb:

require 'ci/reporter/rake/test_unit'
require 'rcov/rcovtask'

namespace :hudson do
 def report_path
   "hudson/reports"
 end

 task :all => [:report_set...
Weiterlesen

Wouldn’t it be nice if Hubot would tell you if a jenkins build was successful or not? Here is how we did it by extending the jenkins script at https://github.com/github/hubot-scripts/blob/master/src/scripts/jenkins.coffee

Add a callback-method so jenkins can trigger an action

jenkinsCallback = (req, res, robot) ->
   room = "room@your.jabber.server"
   job = req.body.job
   user = robot.userForId 'broadcast'
   user.room = room
   user.type = 'groupchat'

   url = process.env.HUBOT_JENKINS_URL
   getreq = robot.http("#{url}/job/#{job}/api/json")...
Weiterlesen

Today I had some fun when I was deploying my rails application to jenkins. When I tried to

rake test

I got an exception saying

You must establish a database connection before using acts_as_authentic

So I thought: Hey, then I will

rake db:schema:load

first. But I got the same error message again.

After doing some research I discovered that authlogic was expecting the users table to exist. So I created a dummy users table with the dbconsole:

CREATE TABLE users (email varchar(255);

Now I was able to load the schema. Funny. Not.

Weiterlesen

Of course, everyone has really good test suites, don’t you? So when we use invalid syntax, the test suite will catch it. But there is a better, faster, more thorough way to detect these errors.

We have a build step on our continous integration server that checks all ruby source files in the project for syntax errors in under five seconds. It is run before the test suite. Because the earlier you catch a bug, the lower the costs of fixing it.

If you use git, I also recommend a pre-commit hook that checks all staged ruby source files before you can commit them - so the bugs are caught even earlier.

We achieve this using a

Weiterlesen

When I performed a

bundle update zurb-foundation

lately (I updated from 4.1.1. to 4.2.1), I got the error message that a foundation import was missing.

After digging around a bit and reading https://github.com/zurb/foundation/issues/1840, I changed

@import "foundation/foundation-global";

(e.g. in app/assets/stylesheets/_settings.css.scss to

@import "foundation/variables";

and everything worked fine again

Weiterlesen

I had some trouble dealing with submodules. This is what I experienced, learned, and did to solve the issue.

Using a custom SSH URL

Let’s see if our repository has submodules:

$ git submodule
9d83ae91cffb5840a5ff722e9f1dabc2d74c96ae vagrant/cookbooks (9d83ae9)

Yes, it does. Take a look at the submodule details which are stored in .gitmodules; it should look like this:

[submodule "vagrant/cookbooks"]
   path = vagrant/cookbooks
   url = git@github.com:AcmeCorporation/FlagshipProduct-cookbooks.git

Unfortunately, that’s not the URL we want to use but instead we have a dedicated alias in ~/.ssh/config:

Host github
   HostNam...
Weiterlesen

Here at fortytools we are slowly getting ready to migrate our Ubuntu 12.04 LTS machines to the shiny new Ubuntu 14.04 LTS release. I know that you are supposed to wait until the first ‘dot release’, so 14.04.1 or something similar scheduled for late Q2-2014. However if you use the 'do-release-upgrade -d’ you will be able to update to the latest development version.

Upgrading to the latest Ubuntu will also give you the new Apache 2.4 (previously it was Apache 2.2). This turned out to cause some problems.

So, after the upgrade was through (which took roughly 1 hour), heading over to this blog showed me the blog without any assets (images, styles or anything served from assets.fortytools.com). Poking around the Apache configuration a bit, I quickly tur...

Weiterlesen

Testen Sie 30 Tage kostenlos und unverbindlich! Fortytools ist die smarte Software für Dienstleister und Handwerker.

Sie können Fortytools 30 Tage kostenlos und unverbindlich testen. Dabei stehen Ihnen alle Funktionen uneingeschränkt zur Verfügung.
Heute kostenlos testen!
Nutzerbewertung: 4,8 von 5 Sternen

Fortytools läuft komplett im Internet-Browser: Keine Software-Installation, keine Probleme mit Updates. Einfach Einloggen und fertig. Von jedem internetfähigen Gerät.

Kostenlos und unverbindlich
Professionelle Rechnungen schreiben
Kunden-Daten verwalten
Mitarbeiter-Daten verwalten
Aufgaben- und Terminplanung
Professionelle Angebote schreiben
Einsätze planen und Zeiten erfassen