We had to move about 30 databases from one server that had run out of drive space to another server with enough drive space to last us a couple years (at current growth). The problem is that the old server didn't have enough space for the dump files (shutting down the server for the duration of the maintenance wasn't an option, so we couldn't copy of the database files) so we had to figure out a way to move them using mysqldump.
I love how easy SSH can make things. The quick fix for this problem was for us to pipe mysqldump's output into SSH and then restore them on the remote server.
mysqldump -u username -p database | gzip -c | ssh username@hostname 'cat > ~/database.sql.gz'
We could have dumped the dump directly back to MySQL but because restoring these databases took upwards of an hour we found it easier to move them all over, run a script to restore them all, go home for the weekend, and look for errors on Monday.
An interesting article about how Diaspora starting using MongoDB and switched over to MySQL after they ran into problems with consistency. It's a little long but I would recommend reading it because it explains one of the problems with using a document-oriented database. I would also like to say that I'm not a NoSQL database expert but I love the structured nature that traditional SQL gives us plus we have decades of experience with people using it.
http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/
How far we've come.
http://mentalfloss.com/article/53792/17-ancient-abandoned-websites-still-work
I'm always looking for ways to improve my workflow and on Shop Talk Show #90 they mentioned this presentation. It has a LOT of tools that I'm going to be experimenting with.
https://speakerdeck.com/addyosmani/automating-front-end-workflow
I recently purchased a new computer and as part of that I had to reinstall Sublime Text (I always look at new computers as a clean slate so I don't copy over any of my settings). As I did so I had to go back through and find all the changes I've made to to my preferences. Here are some of the changes I've made in order to improve the way I develop. Read More
I'm a big fan of using Markdown in my projects so I'm always on the lookout for libraries that help me do that. I just saw Ciconia and it's a PHP 5.4 Markdown parser that supports GitHub Flavored Markdown. As an added bonus it's MIT Licensed so it could be used for closed source projects.
Lets say you need to delete a bunch of files from a directory like all the vssver2.scc files or something similar. You could manually delete each file or you could use some quick command line fu:
find /path/to/directory -name "file.name" -exec rm -f {} \;
We recently switched over to using git and vagrant at work and during one of my trainings with a new programmer his computer crashed. After his computer rebooted and he got everything back up and running when he ran vagrant up it started recreating his VM. It hit a point where it tried to rename the newly created VM and reported an error (I'm actually amazed that vagrant doesn't check for this initially) when it found one already existed with the same name. We could have just deleted the VM and started over but he had already started to enter test data that we didn't want to loose.
In order to fix this we found out a couple things.
Every VM in VirtualBox has a unique ID. If you open the .vbox file for a VM there will be a section that looks like this:
<Machine uuid="{2489fd71-90eb-4142-848d-d06dab9bfa9b}"
The part after the uuid= is the ID.
Vagrant associates your project with your VM in the .vagrant/machines/default/virtualbox/id file (based off the location of your Vagrantfile). This file contains the VM's unique ID.
Ultimately, I'm happy that it was all simple text files so we didn't have to spend the time exporting his test data and waiting while a new VM was created.
A cool infographic that shows how many lines of code various codebases have. I'm still amazed by the fact that healthcare.org contains 500 million lines of code. That just seems like a copy and paste development process that's totally out of control or it's being reported wrong.
http://www.informationisbeautiful.net/visualizations/million-lines-of-code/
subscribe via RSS