All posts in 'English posts'

RFC3339 revisited

13-Nov-08

Not just for ruby but also the corresponding formats for Java public static final SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat("yyyy-MM-dd’T’HH:mm:ssZ");public static final SimpleDateFormat RFC3339_FORMAT = new SimpleDateFormat("yyyy-MM-dd’T’HH:mm:ssZ"); and for Oracle SELECT to_timestamp_tz(’1979-21-09T06:54:00+01:00′,’YYYY-MM-DD"T"HH24:MI:SSTZH:TZM’) FROM dual /select to_timestamp_tz(‘1979-21-09T06:54:00+01:00′,’YYYY-MM-DD"T"HH24:MI:SSTZH:TZM’) from dual / Oracle

Read the complete article »

Turn off RoRs automatic timezone conversion for columns

I couldn’t find this in the documents, but Geoff Buesing showed me the hooks to turn off Ruby On Rails’ automatic timezone conversions for some columns of a model or a complete model: # Turn it off for just some columns class Picture < ActiveRecord::Base def self.skip_time_zone_conversion_for_attributes [:created_at, :published_at] end end   # Turin it […]

Read the complete article »

Fun with sql

27-Oct-08

What’s all the fuss about this SQL Injection thing? It boils down getting some malicious crafted SQL code into the SQL code of an application, destroying data or authenticate yourself without knowing any real password. xkdc has a nice explanation. The simple cases base on wrong escaped strings and the like. But as this SQL […]

Read the complete article »

Recursively md5sum all files in a directory tree

25-Oct-08

After a server crash a wanted to compare all actual files with the backuped data. An easy way is to compare the md5 hashes like that: First create recursively md5 hashes from all files in that directory: find ./backup -type f -print0 | xargs -0 md5sum > /checksums_backup.md5find ./backup -type f -print0 | xargs -0 […]

Read the complete article »