Typo3 – AMenu is missing a bunch of entries

Was solved by
plugin.tt_news.amenuStart = 1.1.2000

Veröffentlicht in Ohne Kategorie | Getagged: | Kommentieren

VMware Server 2 – DNS stops working?

a few days ago, almost all services (that somehow require a working DNS lookup) spread across three virtual machines (1x Ubuntu; 2x WinXP) stopped working. After two fracking years!

Well, it took me about two days to figure out some kind of workaround (no real “solution” yet).

Before you continue

… you should check if you really have the same issue:

ping google.com
should give you host not found. If  you receive packets from Google you’re obviously fine – what are you doing here anyway?

Next test, if you indeed get a “host not found” result from ping command, your NAT by typing

ping 123.123.123.123
Please, change 123.123.123.123 to some IP address you know to be reachable ( and responds to ping (icmp packets) ).

Workaround

Plain simple: Modify the guests DHCP settings to get IP settings but use your preferred Nameserver.

Ubuntu (Debian should be the same):
vi /etc/dhcp3/dhclient.conf

edit the line
prepend domain-name-servers 124.124.124.124

124.124.124.124 should be your preferred Nameserver
restart network
/etc/init.d/networking restart

on a Windows Box it shouldn’t be hard to figure out, where to hack in the DNS settings :-)

Veröffentlicht in Ohne Kategorie | Getagged: , , , | Kommentieren

MySql Server has gone away – ActiveRecord

I recently experienced above line in my Daemon’s log file – which of course, broke the whole damn thing. It seems the Rails framework has some kind of countermeasure in place because this never happened there before. A short query to the almighty Google led to this snippet:

Thread.new { 
	  loop {
	    sleep 30.minutes
	    ActiveRecord::Base.verify_active_connections!
	  }
	}.priority = -10
Veröffentlicht in Database, Ruby | Getagged: , , | Kommentieren

ActiveRecord – Mysql Adapter – “Column Comments”

Upfront: extending existing Modules and Classes in Ruby is awesome.

for one of my recent projects I had to read the “comment” from an a MySQL table field. After a short look in ActiveRecords ConnectionAdapters for MySQL I realized the existing method uses

SHOW FIELDS FROM `table`

instead of the necessary

SHOW FULL FIELDS FROM `table`

which includes the required “comment” column.

First I added an attribute (accessor) to the MysqlColumn Class to store the comment.

module ActiveRecord
  module ConnectionAdapters
    class MysqlColumn
      attr_accessor :comment
    end	
  end
end

Next, the existing method, that loads and assings attributes like “fieldname”, “size”, “type” needed an upgrade. (Change SQL Statement & Assignment of “comment”)

module ActiveRecord
  module ConnectionAdapters
    class MysqlAdapter
 
      def columns(table_name, name = nil)
        sql = "SHOW FULL FIELDS FROM #{quote_table_name(table_name)}"
        columns = []
        result = execute(sql, name)
        result.each { |field| 
          c = MysqlColumn.new(field[0], field[4], field[1], field[2] == "YES") 
          c.comment = field[8] 
          columns << c
        }
        result.free
        columns
      end 
 
    end
  end
end

Notes:

  • For Rails Projects, I think, you need to place this in a .rb file in config/initializers
  • In my environment (sinatra) I had to add following requirement:
    require 'active_record/connection_adapters/mysql_adapter'
Veröffentlicht in Database, Ruby | Getagged: , , , , , , | Kommentieren

Aufgeräumt

  • Altes Zeug verworfen (ausgeblendet) – ein paar Artikel schon überarbeitet und wieder freigegeben
  • Hier kommen (vermutlich) in Zukunft nur noch ein paar Codeschnipsel.
  • Theme ist im Moment das Thematic Framework – ggf. leg ich noch n eigenes Stylesheet drüber.
Veröffentlicht in Blog & Private | Getagged: , | Kommentare geschlossen

Sinatra – Raw Post Data

puts @request.env['RAW_POST_DATA']
Veröffentlicht in Ohne Kategorie, Ruby | Getagged: , | Kommentieren

Ruby – Hash.to_xml

Hat mich gerade 2 Stunden gekostet. Ohne die ‘gem’Zeile funktionierts nicht.

require 'rubygems'
gem 'activerecord', '2.3.9'        # Wichtig!
require 'active_record'
 
v = {:param1 => "Test", :param2 => "Test2"}
xml = v.to_xml
puts xml
Veröffentlicht in Ohne Kategorie, Ruby | Getagged: , | Kommentieren

Umzug auf den VSERVER

So, zum Teil ist alles vom root auf den deutlich günstigeren vServer bei Hosteurope umgezogen. Soweit bin ich glücklich, und spar mir n batzen Asche.

Veröffentlicht in Ohne Kategorie | Kommentare geschlossen