Ideally, we should all be developing our code in our own little space on our little local server. This allows us to easily make changes without messing up production code or stepping over other's work. This is usually cost prohibitive so we use virtual machines to make this a reality.
The problem we face is that each developer needs to have a virtual machine that is setup exactly (or nearly exactly) like our production server. This requires a long list of configuration changes that need to be made on every machine. For example, install the apache package, update this configuration file, setup Samba so you can access the files remotely. Then we run into more problems when additional changes are needed because the developer has to take time out of their schedule to make them on each machine. There are also passwords that have to be remembered and /etc/host changes that need to be made. You'll be in even worse shape if the deployment consists of multiple VMs.
Scott's Note: This is still a valid post but I suggest you read Getting Started With Vagrant Using PuPHPet.com for a slightly easy approach that doesn't require as much command line work and is easier (in my opinion) to work with.
I've started playing with Vagrant and the first thing that I wanted to learn how to do is to install MySQL without the password prompts. I want this so if I hand off a project to someone else they don't even have to worry about what the password is set to. It turns out it's fairly simple:
debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password password rootpass'
debconf-set-selections <<< 'mysql-server-5.5 mysql-server/root_password_again password rootpass'
apt-get update
apt-get -y install mysql-server-5.5
The other trick that I learned while figuring this out was the -y
switch for apt-get
which causes it to automatically reply yes to that prompt that asks if you're sure that you want to install the packages.
This is the update on my technical goals for this year.
A collection of best practice tidbits. This is my favorite:
Accept that you have no idea how this will grow
The key is to acknowledge from the start that you have no idea how this will grow. When you accept that you don't know everything, you begin to design the system defensively... You should spend most of your time thinking about interfaces rather than implementations.
https://github.com/thomasdavis/best-practices
via Reddit.
I've used this trick before but I haven't shared it here. I needed to have it setup so a client was forced to download a PDF file to their computer and not use the Acrobat Reader plugin. The process is very simple:
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="filenamegoeshere.pdf"');
You then output the file contents.
It's simple to do this for other file types to.
header('Content-type: text/xml');
header('Content-Disposition: attachment; filename="filenamegoeshere.xml"');
header('Content-type: application/msword');
header('Content-Disposition: attachment; filename="filenamegoeshere.doc"');
Scott Adams:
So here's my summary: Management only exists to compensate for its own poor hiring decisions. The Internet makes it easier to locate and then work with capable partners. Therefore, the need for management will shrink - at least for some types of businesses - because entrepreneurs have the tools to make fewer hiring mistakes in the first place.
I couldn't agree more.
http://dilbert.com/blog/entry/the_managementfree_organization/
NOTE: Databases can be fickle beasts and I take no responsibility for any damage this article may cause. Always backup your data and check that your backup plan works!
Databases can be hard to manage when you have multiple instances to keep up to date. You might have several development databases (usually one on each developer's machine), a test database, one or more production databases, and you're really in trouble if the client databases are located offsite on a client's network inside their firewall. Needless to say you really need to have some way to keep all of these databases consistent. This is where database versioning helps out.
Database versioning (like source code versioning) helps us to keep a record of what the database looked like at a given point of time and allow us to update existing databases to that state. It's almost painfully simple to do and saves so many headaches. Read More
This blog is powered by Wordpress because of it's ease to use and I've always wanted to learn how to make custom themes but after reading this post I'm not so sure anymore.
Its weakness lies in how it has evolved, or rather mutated, from a blogging platform to pseudo-framework in a highly inelegant way. Functionality has been added along the road to accommodate WP’s growing use as a CMS: custom post types, custom menus etc – but really these are just hacks to a platform that fundamentally still behaves like blogging software.
http://jshakespeare.com/the-dire-state-of-wordpress/ via Reddit.
Google Reader’s upcoming shutdown and Mailbox’s rapid acquisition have reignited the discussion of free vs. paid services and whether people should pay for products they love to keep them running sustainably.
An interesting read by Maco Arment the creator of Instapaper. It's been interesting listening to the discussions about paid vs free software since Google announced the death of Google Reader.
http://www.marco.org/2013/03/19/free-works
I was troubleshooting a client problem today and we needed to know how many total rows had been inserted into a table. It turns out you can use the show table status
command to get this result.
show table status where name = 'tableNameHere';
This will show a bunch of information about the table and one of the columns is 'Auto_increment'. This is the field that contains the next id that will be used when you attempt to insert a row into the table.
subscribe via RSS