github.com

Using this gem I could get JSON generation from a large, nested Ruby hash down from 200ms to 2ms.

Here is a hacky way to load dumps directly from the source server, without fully copying them over and extracting them first. It may break horribly for you. This is...

...t have it already: sudo apt-get install pv Know the location of the dump file on the remote server. We'll use /mnt/dumps/my_project.dump.bz2 in the example below.

makandra dev

...slaves you most likely want to skip the mysql database. Restart your MySQL server Dump the database for the slave You can skip the following and use LOAD DATA FROM...

+------------------+----------+--------------+------------------+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +------------------+----------+--------------+------------------+ | mysql-bin.000001 | 1219 | | | +------------------+----------+--------------+------------------+ Dump the database (in a new terminal): mysqldump -uroot -p -r the_dump.sql some_project_production

makandra dev
github.com

...install, create database.yml, create databases, migrate), optionally run all tests (--test) or load a dump (--dump staging) update: update a Rails project that has been lying around for some time...

...selenium: previously run_tests, runs a given command with Firefox for Selenium set up dump: combined dump handling, can create, download and source dumps See command help for details...

...remote$ sudo tcpdump host 147.0.0.123 and port 80 -s 0 -w /tmp/network.dump Copy the dump to your local machine: local$ scp $remote_host:/tmp/network.dump . Load the dump: local$ wireshark network.dump

makandra dev
semaphoreci.com

...like Ruby's system etc. methods. Just call them with separate arguments, e.g. execute :dumple, '--fail-gently'. Hooks have changed: deploy:update_code -> deploy:updating Invocation of other tasks has...

...need to wrap your task body in a on...

...do...

...end block, e.g. task :dump do on primary roles :db do # <-- this # perform dump end end undefined method `map' for...

...schema.rb into the test database. You may need to run a rake db:schema:dump before to get an updated schema.rb -- else you might load an outdated database structure.

...do a db:test:prepare. rake db:test:clone You don't need to dump your database schema explicitly when calling this rake task (it generates the schema.rb for you...

makandra dev

...database, with all its tables and their data, under a new name. Make a dump of your source database: mysqldump -uroot -p my_project -r my_project.sql Or, if you only...

...want to dump the database's table structure (schema) without any contents: mysqldump -uroot -p my_project -r my_project.sql --no-data Open up a MySQL shell: mysql -uroot -p

makandra dev
github.com

geordi delete_dumps [directory] Recursively search for files ending in *.dump and offer to delete those. When no argument is given, two default directories are searched for dump...

...files: the current working directory and ~/dumps (for dumps created with geordi). geordi drop_databases Delete local MySQL/MariaDB and Postgres databases that are not whitelisted. Authentication is handled via PAM...

makandra dev

...checks out a feature branch based on a story from Pivotal Tracker Faster MySQL dumping with --single-transaction and --quick Allow pivotal tracker ids in the global config file

...missing require for Fileutils in the dump load command (#145) Document PARALLEL_TEST_PROCESSORS

makandra dev
github.com

It gives you the power to get a dump from your production database with dump-for production install your local gems to the production machine with install-gems-remotely...

After loading a staging dump into development, you might get an ActiveRecord::EnvironmentMismatchError when trying to replace the database (like rails db:drop, rails db:schema:load). $ rails db:drop

...to do this in production environment, but on a development machine, follow these steps: Dump your databases, if you want to keep them. Keeping the data directory itself did not...

When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...

github.com

...data. See the README on how to add it as a middleware. It will dump its data to the tmp directory. Sampling is by default based on CPU time, so...

...gem also includes a command line utility to extract useful information from the raw dumps. You can run stackprof tmp/stackprof-cpu-* --limit 5 to see the 5 worst offenders. The output...

timetobleed.com

...in the Linux kernel which allows external programs to be launched when a core dump is about to happen. I provide a link to a short and ugly Ruby script...

...faulting process, runs gdb to get a backtrace (and other information), captures the core dump, and then generates a notification email...

When you load a dump for development, records may reference images that are not available on your machine. Requests to those images may end up on your application, e.g. if...

makandra dev
github.com

...for example to confirm your output in tests), you can use roo. To easily dump Rails records to XLSX, there is also axlsx_rails (haven't tried it yet).

Dump this method into your Ruby console to quickly print data in columns. This is helpful for e.g. comparing attributes of a set of Rails records. def tp(objects, *method...

stackoverflow.com

...to disable foreign key constraints before it can wipe the database. Importing a remote dump with geordi Asking Postgres to show the storage path of a database Doing these things...

makandra dev

...public/javascripts/all* public/stylesheets/all* public/stylesheets/*.css config/database.yml *~ *#* .#* .DS_Store webrat-*.html capybara-*.html rerun.txt coverage.data coverage/* dump_for_download.dump .~lock.* .*.swp C:\\nppdf32Log\\debuglog.txt

makandra dev
github.com

...setup. After basic setup (see geordi help setup), runs tests and loads a staging dump into the database. geordi security-update Guides through our security update process. geordi commit

makandra dev
github.com

This gem gives you a rake task db:seed:dump do create a db/seeds.rb from your current database state. The generated db/seeds.rb will look this: Product.create!([ { category_id: 1, description...

Best results in other decks

When dumping your Heroku Postgre database (with heroku pg:backups:capture --app my-app and heroku pg:backups:download --app my-app), it will result in a binary dump.

...also a flag to omit the schema and output only the data of the dump: --data-only. This may be useful if you can restore the schema otherwise, e.g. when...

If you have a PostgreSQL dump in the custom format you can can view the text format dump (plain SQL statements). PostgreSQL 12 and newer Write it as a textdump...

pg_restore $dumpname -f name.textdump Applying parameters You can apply the same parameters for the output of the textdump as for restoring the dump (for e.g. --clean...

Search in all decks