Today, I made some experiment with avconv on videos made with some android devices and found out that the creation_time of a video of mine recorded back in june seems to be crippled since the value returned by ffprobe is 1946-06-26 12:30:42! That can’t be possible…
Googling time
That’s strange but there are only few relevant results returned by Google on that crippled timestamp. After some digging, I found out that FFmpeg issue. In fact, that’s the fourth result of a Google search on android video creation_time but it’s like always, you just need to find the good keywords.
Matter fixed
The ticket’s status is closed defect: fixed. OK but the issue tracker doesn’t contain any reference to the fix.
$ git clone git://source.ffmpeg.org/ffmpeg.git
$ git log --grep=1471
[…]
commit 23eeffcd48a15e73fb2649b712870b6d101c5471
Author: Michael Niedermayer <michaelni@gmx.at>
Date: Sun Jul 1 21:41:06 2012 +0200
mov: add workaround for incorrect 0 time point.
Fixes Ticket1471
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
[…]
$ git show 23eeffcd48a15e73fb2649b712870b6d101c5471
commit 23eeffcd48a15e73fb2649b712870b6d101c5471
Author: Michael Niedermayer <michaelni@gmx.at>
Date: Sun Jul 1 21:41:06 2012 +0200
mov: add workaround for incorrect 0 time point.
Fixes Ticket1471
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
diff --git a/libavformat/mov.c b/libavformat/mov.c
index af5b126..faa8c65 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -780,7 +780,8 @@ static void mov_metadata_creation_time(AVDictionary **metadata, time_t time)
char buffer[32];
if (time) {
struct tm *ptm;
- time -= 2082844800; /* seconds between 1904-01-01 and Epoch */
+ if(time >= 2082844800)
+ time -= 2082844800; /* seconds between 1904-01-01 and Epoch */
ptm = gmtime(&time);
if (!ptm) return;
strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);
Uh!
Compile time
ATTOW, the debian package version of libav-tools is 0.8.xx and a git log --tags --simplify-by-decoration --pretty="format:%ai %d" shows that the 0.9 tag has been bumped in the late 2011… Too bad… I’ll need to compile that myself if I really wanted that creation_date.
Update
The wording of the Compile time is unclear at least, so:
libav and FFmpeg has forked.
libav is now the default on Debian GNU/Linux.
libavformat/mov.c has evolved differently but FFmpeg seems to provide a fix (that must be
verified) but that doesn’t mean that the issue has not been fixed in the libav edge, only that
I’ve found only clue that the issue has been adressed by the FFmpeg project.
Back to the beginning of this year, I succeded in compiling ICS AOSP
4.0.3_r1 for the Galaxy Nexus. At that time, I didn’t have much time to post a full entry on the
whole compilation process (including the different hacks needed to get a fully functional ROM).
With the Jelly Bean AOSP release and my third ROM compilation, I’ve succesfully compiled 4.1
back in July. Now we have 4.1.1_r4 and it’s due time for me to document the process using Debian
GNU/Linux.
Without the Android Open Source Project, nothing has been possible and
the website clearly describes how to proceed to get the code and compile it for a supported
target. I will not rewrite the provided documentation but I’d rather provide a guide on
how I have obtained my own ROM. Feel free to review and I will update accordingly.
DISCLAIMER: Please do not do anything described in this post if you have no idea of what you are
doing! I will not be held responsible for bricking your phone or invalidate your device warranty! Do
not forget to backup your data before doing anything since any issue may involve a factory reset!
My first advices are:
Browse the AOSP website
Read that whole post a first time before doing anything
Flash the bootloader and the baseband firmware to the latest versions available
Get the latest factory image “yakju” for Galaxy Nexus “maguro” (GSM/HSPA+) JR003C
$ mkdir ~/foo/android_prereq/jro03c
$ cd ~/foo/android_prereq/jro03c
$ curl -#O https://dl.google.com/dl/android/aosp/yakju-jro03c-factory-3174c1e5.tgz
We will need fastboot to flash images to the device. More over, since it’s the time to compile some
host utilities, we take the opportunity to get adb (necessary to interact with the device for
debug purposes) and the simg2img (usefull to convert a sparse image file to a raw image file).
$ cd ~/foo/bar/android
$ make fastboot adb simg2img
The resulting host binaries could be found in the ~/foo/bar/android/out/host/linux-x86/bin
directory.
If your bootloader is not already unlocked, you will need to boot in fastboot mode:
Press and hold both Volume Up and Volume Down, then press and hold Power.
We define a linux local alias to simplify the use of the brand new fastboot (using the _aosp
suffix).
$ alias fastboot_aosp=/home/renaud/git/android_ics/out/host/linux-x86/bin/fastboot
Let’s get and flash the bootloader and the baseband from the JRO03C factory to the actual device:
$ cd ~/foo/android_prereq
$ tar xzvf yakju-jro03c-factory-3174c1e5.tgz
$ tar xzf yakju-jro03c-factory-3174c1e5.tgz
$ cd yakju-jro03c
$ fastboot_aosp flash bootloader bootloader-maguro-primelc03.img
$ fastboot reboot-bootloader
$ fastboot flash radio radio-maguro-i9250xxlf1.img
$ fastboot reboot-bootloader
The bootloader now display:
[…]
BOOTLOADER VERSION - PRIMELC03
BASEBAND VERSION - I9250XXLF1
[…]
Getting root or injecting su and Superuser to the source tree
$ cd ~/foo/bar/android/system/extras
$ git clone https://github.com/nibua-r/su-binary.git su
I want the su binary to be compiled in the very same time of the full AOSP
build. As a consequence, I have modified the original Android.mk file by setting
LOCAL_MODULE_TAGS := optional and adding the su module to PRODUCT_PACKAGES into the
build/target/product/core.mk file to force the inclusion.
I want to have the ChainsDD/Superuser apk included into the
build as a system app:
$ cd ~/foo/bar/android/packages/apps
$ git clone https://github.com/nibua-r/Superuser.git
and add Superuser to PRODUCT_PACKAGES into the build/target/product/core.mk.
You will need to generate your own certificate for Superuser using:
If superuser.pk8 is not there, the compilation process will fail… Don’t go too far away from your
computer since the Superuser compilation will require your password to get the build done.
After setting ccache to fit with your resources, just do:
$ cd ~/foo/bar/android
$ make -j4
You normally end up with flashable images located in out/target/product/maguro/.
The whole compilation process took a very long time on my machine… so be it and be warned!
Flash the images to the devices
Assuming the fastboot_aosp alias is defined and the battery of your device is decently charged,
just flash the whole system with:
$ fastboot_aosp flashall
If you upgrade from a previous Android version, you should wipe your data using the -w switch:
$ fastboot_aosp -w flashall
The whole flashing process took about 1 min. to finish on rebooting the device. Congrats! But wait,
this is not the end…
If you have clockworkmod installed on your recovery partition, flashall will overwrite it with the
nominal android recovery.
Flash or reflash clockworkmod recovery (for later use)
The clockworkmod recovery enable us to backup and/or restore our ROMs and apply zip update files.
If you test the gps or the camera, you certainly are already grumbling…
Some binaries are distributed by Google, some aren’t and since the famous extract-files.sh have
been suppressed from this release, you will have to hunt down some missing libraries. You’ll need to
play with find/sort/diff combos to figure out which one are needed.
OK, but on which reference data? Remember the simg2img host compilation? Time to use it…
Please read the following section before hunting down the missing files…
Where are my GApps!
The GApps are not-so-useless on Android but they are not Open Source and therefore not distributed
by Google AFAIK… Considering the situation, Google seems flexible, up to now, about the various
gapps packagings out there…
The short version: Go get a gapps update file on Goo.im/gapps
(gapps-jb-20120726-signed.zip ATTOW). Use adb to put that file on the device storage, reboot to
clockworkmod and apply…
You should (in not must) locally unzip the file to see what’s into it before flashing and before
processing the previous section…
Conclusion
That post is more a personal log than a real guide and although some parts could be automated, the
manual toying is a full learning experience!
This blog is powered by Enki and as technical blog, I’d like to insert some code snippets to the entries. As a rails 3 application, integrating google-code-prettify is relatively simple.
First download the installation bundle (I experienced some difficulties, with perl, to make a distribution package from the svn):
Insert <%= stylesheet_link_tag 'prettify' %> and <%= javascript_include_tag 'prettify' %> within
the head element of your /path/to/my/railsapp/app/views/layouts/application.html.erb file. Add
the onLoad="prettyPrint()" attribute to the body element.
Back to august 2010, Rich Hyndman posts an entry on the android developers’ blog entitled “Horizontal View Swiping with ViewPager”. I already was really enthusiastic about the Android Support Package at that time because of the introduction of the LoaderManager which save us big headaches on the proper cursor management (but that’s another story). In an application of mine, I’ve used an onFling/swipe gesture based on some 2009 codes found on the Web (codeshogun.com and/or ceveni.com for example).
The main drawbacks on my onFling approach and implementation are:
That is based on a threshold velocity
Once initiated, the animation goes on and can’t be reversed
The gesture is the trigger of a startActivity call and each of those activities are… activities!
Surely my onFling implementation was too dumb and since I read Rich’s post, I have the secret personal project to use the ViewPager and one of the underlying adapters to reimplement that ugly onFling part of our application.
Well, the time has come with the Christmas holidays!
The point is that my onFling-based activity is now composed by two fragment and the FragmentPagerAdapter is nice but manage only one Fragment as a ViewPager current page content.
Now, what if a want a vertical stack of several fragments? ⇒ Read and adapt the FragmentPagerAdapter source code from the Support Package (compact version without comments):
publicabstractclassVerticalFragmentsPagerAdapterextendsPagerAdapter{privatestaticfinalStringTAG="VerticalFragmentsPagerAdapter";privatestaticfinalbooleanDEBUG=false;privatefinalFragmentManagermFragmentManager;privatefinalintmRows;privateFragmentTransactionmCurTransaction=null;privateArrayList<Fragment>mCurrentPrimaryItem=null;publicVerticalFragmentsPagerAdapter(FragmentManagerfm,introws){mFragmentManager=fm;mRows=rows;mCurrentPrimaryItem=newArrayList<Fragment>(mRows);}/** * Return the Fragments associated with a specified position. */publicabstractArrayList<Fragment>getItem(intposition);@OverridepublicvoidstartUpdate(ViewGroupcontainer){}@OverridepublicObjectinstantiateItem(ViewGroupcontainer,intposition){if(mCurTransaction==null){mCurTransaction=mFragmentManager.beginTransaction();}Contextctx=container.getContext();LayoutInflaterinflater=(LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);Viewlayout=inflater.inflate(R.layout.pager,null);layout.setId(6109+position);LinearLayoutll=(LinearLayout)layout.findViewById(R.id.pager_linear_layout);ll.setId(900913+position);((ViewPager)container).addView(layout);FragmentfirstFragment=mFragmentManager.findFragmentByTag(makeFragmentName(container.getId(),position,0));ArrayList<Fragment>frags=null;if(firstFragment!=null){frags=newArrayList<Fragment>(mRows);for(inti=0;i<mRows;++i){frags.add(mFragmentManager.findFragmentByTag(makeFragmentName(container.getId(),position,i)));}for(Fragmentf:frags){if(DEBUG)Log.v(TAG,"Attaching item #"+position+": f="+f);mCurTransaction.attach(f);}}else{frags=getItem(position);intcurrentRow=0;for(Fragmentf:frags){if(DEBUG)Log.v(TAG,"instanciateItem / Adding item #"+position+": f= "+f);mCurTransaction.add(ll.getId(),f,makeFragmentName(container.getId(),position,currentRow));currentRow++;}}if(frags!=mCurrentPrimaryItem){for(Fragmentf:frags){f.setMenuVisibility(false);f.setUserVisibleHint(false);}}returnlayout;}@OverridepublicvoiddestroyItem(ViewGroupcontainer,intposition,Objectobject){if(mCurTransaction==null){mCurTransaction=mFragmentManager.beginTransaction();}for(inti=0;i<mRows;++i){if(DEBUG)Log.v(TAG,"destroyItem / Detaching item #"+position+": row="+i);mCurTransaction.detach(mFragmentManager.findFragmentByTag(makeFragmentName(container.getId(),position,i)));}((ViewPager)container).removeView((View)object);}@OverridepublicvoidsetPrimaryItem(ViewGroupcontainer,intposition,Objectobject){ArrayList<Fragment>frags=newArrayList<Fragment>(mRows);for(inti=0;i<mRows;++i){frags.add(mFragmentManager.findFragmentByTag(makeFragmentName(container.getId(),position,i)));}if(!frags.equals(mCurrentPrimaryItem)){if(!mCurrentPrimaryItem.isEmpty()&&(mCurrentPrimaryItem.get(0)!=null)){for(Fragmentf:mCurrentPrimaryItem){f.setMenuVisibility(false);f.setUserVisibleHint(false);}}if(!frags.isEmpty()&&(frags.get(0)!=null)){for(Fragmentf:frags){f.setMenuVisibility(true);f.setUserVisibleHint(true);}}mCurrentPrimaryItem=(ArrayList<Fragment>)frags.clone();if(DEBUG)Log.v(TAG,"setPrimaryItem #"+position+": "+mCurrentPrimaryItem);}}@OverridepublicvoidfinishUpdate(ViewGroupcontainer){if(mCurTransaction!=null){mCurTransaction.commitAllowingStateLoss();mCurTransaction=null;mFragmentManager.executePendingTransactions();}}@OverridepublicbooleanisViewFromObject(Viewview,Objectobject){returnview==((View)object);}@OverridepublicParcelablesaveState(){returnnull;}@OverridepublicvoidrestoreState(Parcelablestate,ClassLoaderloader){}publicstaticStringmakeFragmentName(intviewId,intindex,intsubindex){return"android:switcher:"+viewId+":"+index+":"+subindex;}}
This implementation uses ArrayList as the fragments’ container. The trick here is that instead of returning a fragment from instanciateItem, I return a containing a LinearLayout.
Be warned: don’t use several instances of the same fragment for a given position! That adapter is not designed to do that…
From the above code, it’s now trivial to figure out how to extends that adapter: “Uh… the getItem should return an ArrayList of Fragments?” − “Yup!”
A trivial example is available on github. Just clone and run ant debug && ant installd… Feel free to fork, improve and return your feedback.
Last days at work, we integrate some QR codes recognition development on android using ZXing. Although we have a special printer, we need some test cases and a standalone solution to generate and print out several QR codes on a standard printer. At first, a colleague of mine has used some online QR generator but it does not scale very well. Fortunately, a C library and a derived command line tool exists in the libqrencode project, thanks to Kentaro Fukuchi. Moreover, that’s packaged on debian…
qrencode is the right tool, the unix way. However, our use case requires that we get an organized output for testing. To be more specific, we need to sequentially recognize several sets of QR codes.
Black box description
The input is a sequence of strings. As for the output, I need to obtain a standalone printed document. As a consequence, I choose to use the pdf format to not be bothered with any printing issue, even if the content is pure raster.
Input data sample
I will not provide there my real data. The sample data are:
Lorem ipsum dolor sit amet duis mattis ullamcorper ultricies aliquam sit amet vestibulum augue
Aenean ut orci eget nisi tincidunt pulvinar
Aenean eleifend tellus ac lacus convallis fermentum
Be prepared…
I have already used ImageMagick in the past to do composition and conversion operations and my feelings at the beginning were that ImageMagick is all I need to get my formatted output.
Obviously, we need to install qrencode and ImageMagick (and the associated verbose documentation):
But, wait, I need a multipage pdf in the end. I certainly need some pdf merging tool. Go with the installation of pdfsam then:
$ sudo apt-get install pdfsam
QR codes generation with human-readable label
Pretty straightforward. An example on the first dataset:
123456
for i in lorem ipsum dolor sit amet duis mattis ullamcorper
doqrencode -l Q -s 20 -m 10 -o $i.png $i composite -geometry +0+40 -font Lucida-Sans-Typewriter-Regular -pointsize 40 \ -gravity north label:"${i}"$i.png $i.png
done
The qrencode call is to generate each png from a single string. The -l Q option is to set the error correction level to Q (25% of codewords can be restored), -s 20 is to specify the size of dot and -m 10 is to set the margin width.
ImageMagick composite is used to add a human-readable label to each png. The Lucida-Sans-Typewriter-Regular font is provided by the sun-java6-fonts debian package. You can use whatever font you like as listed by identify -list font.
Generate a multipage pdf file for each dataset
From the generated png files, we use ImageMagick montage to arrange a multipage pdf (2 rows / 3 columns) with the following command:
with input files the list of the png input files. The -transparent white option is really important to enable the correct insertion of the title. Without that option, the title would be overridden by the white pixels of the input files.
Putting it all together and merge the result to a standalone pdf file
Once we have the intermediate pdf files, it is simple to merge them into one using pdfsam-console. The final quick-and-dirty bash script is:
#!/bin/bashLABEL=("first""second""third")DATA=("Lorem ipsum dolor sit amet duis mattis ullamcorper ultricies aliquam sit amet vestibulum augue"\"Aenean ut orci eget nisi tincidunt pulvinar"\"Aene eleifend tellus ac lacus convallis fermentum")dataLen=${#DATA[@]}FILE=()for((j=0; j<${dataLen}; j++ ));
do for i in ${DATA[$j]}do# Generate the QR codes qrencode -l Q -s 5 -m 50 -o $i.png $i# Add a human-readable label composite -geometry +0+40 -font Lucida-Sans-Typewriter-Regular -pointsize 40 \ -gravity north label:"${i}"$i.png $i.png
FILE[$j]="${FILE[$j]} ${i}.png"done# Assemble them into a pdf montage -page A4+20-20 -tile 2x3 -geometry +1+1 -transparent white ${FILE[$j]}\ -font Lucida-Sans-Typewriter-Regular -pointsize 40 \ -title "${LABEL[$j]}"${LABEL[$j]}.pdf
done# Create the final pdfif[ -f output.pdf ]; then rm -rf $PWD/output.pdf; fi;
pdfsam-console -o $PWD/output.pdf -d $PWD/ concat
# Delete all the intermediate filesfor i in ${DATA[@]}; do rm -rf ${i}.png ;done;
for((i=0; i<${dataLen}; i++ )); do rm -rf ${LABEL[$i]}.pdf; done;
An ./autogen.sh is needed to generate the configure script:
$ cd emacs
$ ./autogen.sh
I have some emacs binary packages installed, so I have chosen to install my new emacs to /usr/local. Moreover, I have the gtk3 dev packages. As a consequence, my configure call is:
At this step, you will have to retrieve the required and wanted libWhatTheF**k-dev dependencies by yourself…
For me, the configure step returns with:
Configured for `x86_64-unknown-linux-gnu'.
Where should the build process find the source code? /foo/bar/git/emacs
What operating system and machine description files should Emacs use?
`s/gnu-linux.h' and `m/amdx86-64.h'
What compiler should emacs be built with? gcc -std=gnu99 -g -O2
Should Emacs use the GNU version of malloc? yes
(Using Doug Lea's new malloc from the GNU C Library.)
Should Emacs use a relocating allocator for buffers? no
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? x11
What toolkit should Emacs use? GTK
Where do we find X Windows header files? Standard dirs
Where do we find X Windows libraries? Standard dirs
Does Emacs use -lXaw3d? no
Does Emacs use -lXpm? yes
Does Emacs use -ljpeg? yes
Does Emacs use -ltiff? yes
Does Emacs use a gif library? yes -lgif
Does Emacs use -lpng? yes
Does Emacs use -lrsvg-2? yes
Does Emacs use imagemagick? yes
Does Emacs use -lgpm? yes
Does Emacs use -ldbus? yes
Does Emacs use -lgconf? yes
Does Emacs use GSettings? yes
Does Emacs use -lselinux? yes
Does Emacs use -lgnutls (2.6.x or higher)? yes
Does Emacs use -lxml2? yes
Does Emacs use -lfreetype? yes
Does Emacs use -lm17n-flt? yes
Does Emacs use -lotf? yes
Does Emacs use -lxft? yes
Does Emacs use toolkit scroll bars? yes
Now, just compile, install and fix blessmail as required using:
$ make all && make install
$ sudo lib-src/blessmail /usr/local/libexec/emacs/24.0.91/x86_64-unknown-linux-gnu/movemail
Configure Debian GNU/Linux to use your brand new emacs
Rename your new binaries with the following bash script (reusable after each recompilation):
12345678910111213141516
for i in etags ctags emacsclient ebrowse rcs-checkin grep-changelog emacs
do if[ -f /usr/local/bin/$i]; then if[ -f /usr/local/bin/$i.emacs24 ]; thenrm /usr/local/bin/$i.emacs24
fimv /usr/local/bin/$i /usr/local/bin/$i.emacs24
fidoneif[ -f /usr/local/bin/emacs.emacs24 ]; then if[ -f /usr/local/bin/emacs24-x ]; thenrm /usr/local/bin/emacs24-x
filn -s /usr/local/bin/emacs.emacs24 /usr/local/bin/emacs24-x
fi
Install the ad hoc new alternatives (needed just once, even if you recompile and reinstall emacs after a git pull origin):
After some existencial questions on how the gray level colors should be defined in our android projects, I’ve decided to check the predefined colors on the android platform:
Ok, the first conclusion is that the android platform definetely used a US convention… No surprises there. Two gray level colors are defined in platforms. Now, I should check on the android developers website: here and there and search for gray level colors. According to this documentation, only darker_gray seems to be public, although lighter_gray is defined within data/res/values/colors.xml…
That’s weird but lighter_gray is not public… We have access to only one gray system color! To conclude: although we could use the system colors, and since one and only one color is just useless, we would rather define lighter_gray and darker_gray in our own res/values/colors.xml file and if we need more grayish colors, we would use a gray_xx, xx corresponding to the percentage of white color.
The story so far: I have several versions of gcc and g++ on my debian distro and during some external project compilation I went to version-related compilation issues. OK, gcc should be managed by the alternatives debian stuff…
Just after a $ sudo update-alternative --config gcc[tab][tab], I discovered that gcc, g++, gcov, etc. are NOT managed the alternatives way… OK, there are some alternatives defined for c++, cc and cpp, but these alternatives are symbolic links to… symbolic links:
foo@bar:/etc/alternatives$ ls -al c++ cc cpp
lrwxrwxrwx 1 root root 12 2 avril 2011 c++ -> /usr/bin/g++
lrwxrwxrwx 1 root root 12 2 avril 2011 cc -> /usr/bin/gcc
lrwxrwxrwx 1 root root 12 1 août 23:41 cpp -> /usr/bin/cpp
foo@bar:/etc/alternatives$ ls -al /usr/bin/g++ /usr/bin/gcc /usr/bin/cpp
lrwxrwxrwx 1 root root 7 1 août 23:32 /usr/bin/cpp -> cpp-4.6
lrwxrwxrwx 1 root root 7 9 juil. 19:39 /usr/bin/g++ -> g++-4.6
lrwxrwxrwx 1 root root 7 9 juil. 19:39 /usr/bin/gcc -> gcc-4.6
It’s really really strange since c++ and cc are generic but not cpp. Here is my proposal to have a better management for cpp, gcc, g++ and gcov, assuming that you have 4.4 and 4.6 versions on your system:
Obviously, you should adapt the previous commands to your system (i.e. which versions are present).
Now, when you need gcc-4.4 for a specific compilation and if $ export CC=/usr/bin/gcc-4.4 is not sufficient, you just have to do $ sudo update-alternative --config gcc and manually select gcc-4.4… to reset to gcc-4.6 if you nominally need it.
Using my brand new enki blog instance with a SQLite database, I wrote my first post… then I told myself that it could be nice to use a PostgreSQL database, just for fun…
Google and a stackoverflow entry gives me the answer, here the step-by-step result for a RAILS_ENV="production":
# PostgreSQL version# gem install pgdevelopment:adapter:postgresqlencoding:unicodedatabase:blog_developmentpool:5username:blogpassword:blurphost:localhost# Warning: The database defined as "test" will be erased and# re-generated from your development database when you run "rake".# Do not set this db to the same as development or production.test:adapter:postgresqlencoding:unicodedatabase:blog_testpool:5username:blogpassword:blurphost:localhostproduction:adapter:postgresqlencoding:unicodedatabase:blog_productionpool:5username:blogpassword:blurphost:localhost
Backup your SQLite data with yaml_db: $ rake db:dump RAILS_ENV="production"
Configure Rails to use your new PostgreSQL configuration: $ cp config/database.yml.pg config/database.yml
Create the database and the associated tables: $ rake db:create RAILS_ENV="production"
Load your schema: $ rake db:schema:load RAILS_ENV="production"
Load your data with yaml_db:$ rake db:load RAILS_ENV="production"