I had to do this recently for a project. The difficult piece was sorting through the opinions of what the best tools and procedures for handling this migration was. So I tried a few until I found one that worked so well, so quickly that I decided it was worth sharing. Firs tthings I used that didn't work well and/or quickly and/or intuitively:
- mysqldump with various options and various tweaks/scripts/editing of the dump file
What did work well was py-mysql2pgsql. Once installed it was easy to set the configuration file options and run it. It worked without problem and I would use it again for this task. I can't comment as to whether it will handle all cases, this project didn't contain anything too fancy, but I would recommend it as a place to start:
I think my Dell 2005FPW is showing its age: I’m starting to get some rolling when the monitor is first powered on. It’s had a good run but I think I need to buy something or at least be prepared to buy before it becomes more problematic. I’ve resisted buying a new monitor because 1) if it’s not broken don’t fix it and 2) their has been little offered on the monitor market to encourage me to buy. There has been tremendous stagnation in the display world with regard to resolutions. I also strongly favor non-TN displays. The Dell 2005FPW uses PVA but IPS seems to have largely won out as the better display technology. Here’s the specs of my current monitor:
- Dell 2005FPW – 20″ 1680×1050 PVA 16:10 (0.258 mm pitch)
What I have found is that in that size range there has been little improvement in resolution. I suppose this is understandable since 1080 is the number of lines considered to be HD and if you are watching HD content it is nice to do so without upsampling. So what I have found is the following size/resolution pairings:
I ordered the SanDisk Extreme USB 3.0 32GB. Half the price of the Lexar JumpDrive Triton and the best random write performance on a USB drive. Some research I did included:
- 64GB Lexar JumpDrive Triton vs 64GB SanDisk Extreme USB 3.0 Comparison | Computer Hardware Upgrades
- SanDisk Extreme 64GB USB 3.0 Flash Drive Review :: TweakTown
- Lexar JumpDrive Triton 32GB USB 3.0 Flash Drive Review :: TweakTown
- SanDisk 64GB Extreme USB 3.0 Flash Drive Review – SanDisk Extreme USB 3.0 Performance – Legit Reviews
- Sandisk Extreme USB 3.0 (32GB, 64GB) Review | Everything USB
- SanDisk Extreme 64GB USB 3.0 Flash Drive – Newegg.com
I’ve come across a number of posts giving instructions on how to get debugging to work with ruby 1.9.x and they all seem to involve downloading gems and installing them. Here is what I did on my Ubuntu 12.04 workstations that was very easy though not trivial to figure out.
sudo gem install linecache19 --pre sudo gem install ruby-debug-base19 --pre -- --with-ruby-include=/usr/include/ruby-1.9.1/ruby-1.9.3-p0/ sudo gem install ruby-debug-base19x --pre sudo gem install ruby-debug-ide --pre
First install build dependencies. This list may not be complete as some necessary libraries and tools may have already been installed on my test machines. This is what I used to get the packages to build successfully:
- apt-get install build-essential python-dev gettext bin86 bcc iasl uuid-dev libncurses5-dev pkg-config libglib2.0-dev libyajl-dev git gcc-multilib texinfo fakeroot
Then download, unpack, configure, and build:
- wget http://bits.xensource.com/oss-xen/release/4.2.1/xen-4.2.1.tar.gz
- tar -zxf xen-4.2.1.tar.gz
- cd xen-4.2.1
- make deb
Afterword you’ll be left with a shiny new package:
I ran into this problem where I was getting “uninitialized constant” errors when running rake tasks. These are tasks which had been working and I verified that the proper paths were set (eager_load_paths). When searching I saw information about config.threadsafe! being a problem so I disabled it and the problems vanished. However, I wanted to use config.threadsafe!, specifically for allow_concurrency. So, how to resolve this.
I did some research and found a lot of discrepancy among recommendations for the decimal precision when doing geocoding. Some say you only need 4 digits of precision and others suggest up to 15. In my own testing the best results seemed to be with 6-digits and SQL type of PRECISION(9,6) for latitude and longitude. This should provide a resolution of less than 12cm which should be sufficient for most purposes. The storage requirements should be 5 bytes in MySQL and 9 bytes in PostgreSQL.
Validating URL Addresses
- http_url_validation_improved (1.3.1) – uses Addressable::URI.parse, can check url connectivity
- url_validation (1.0.0) – uses Addressable::URI.parse, can check url connectivity
- url_validator (0.1.0) – uses Addressable::URI.parse
- validate_url (0.2.0) – simple, Rails 3 only, uses URI.parse
- validates_url_format_of (0.3.0) – Rails 2 and 3, uses regexp
Obviously people’s needs will differ but I think validate_url suites my needs best: it doesn’t add a dependency on Addressable and doesn’t use a regexp for validation. Mostly I’m looking to prevent user entry errors link failing to provide a schema. Whether the site exists is not something I need to check in a validation.
Validating Email Addresses
There are about 28 gems for doing email address validation. I’ve been using validates_email_format_of for quite some time with no complaints. It can validate mx records, works in Rails 2 and 3, and is highly configurable. Until I see a reason to switch I’ll keep using it.
If you want to get the numeric month from strftime your only only is %m which is zero padded. So January is “01″. But what if you don’t want zero padding? Turns out that’s non-trivial, unless you’re on a system that supports strftime flags. Then you can use “%-m” for no padding (“1″) and “%_m” for space padding (” 1″). These same flags work on all of the other formatters so you can use “%_d” for space padded day instead of having to remember to use “%e”. Not portable, but much more readable.