Have you gotten tired of messing with servers? Doing updates? Maintaining security?
You may just be in the right mind set to look at an architecture as a service, such as PagodaBox or Orchestra.
And now for the treat:
I have set up an easy-to-use quickstart for symfony2 + sonata admin for you to use on PagodaBox.
Want to contribute? Send a PR to the GitHub repository!
So, there was a discussion in #symfony about how to test if ROLE_A was included within ROLE_B.
Long answer short — there’s no clear cut way that I found. That being said – I did figure out how to do it.
I’m sure there’s slightly cleaner ways to do this, but I was just going for getting it running.
So, I keep saying in #symfony (freenode IRC) “I need to blog about my setup”. So, here it is.
For my current setup, you’ll need to buy two pieces of software.
If you use a Mac
- Parallels Desktop for Mac — $79.99 (on sale for $49.99 in the iStack Mac Bundle)
- Your favorite linux distribution
If you use a Windows machine, I don’t have a recommended virtual machine but I bet Parallels Workstation is reasonable.
HOLD IT! I’m not going to BUY software!
Then fine, don’t. Enjoy your fiddling. Enjoy tweaking. Enjoy not working. My goal is to just get stuff done. And besides — how much money do you make a year doing this stuff anyway? If you can’t afford $80 in tools to do your job better, you’re doing it wrong. If you really can’t afford it, make the case to your boss. Download the demos and see the value. Don’t have a boss? Then you’re really in trouble.
I say your favorite linux distribution because it really doesn’t matter. The more you know about it, the less time you spend fiddling. For me, that’s CentOS. For you, it could be Dumbledebian 5.4.2 XXL. It doesn’t matter.
First, install your virtual machine. Set it up so it can talk to your computer, and the internet at large.
Next, decide a name for it. I call mine ‘linux’. Fancy, eh?
Now, edit your /etc/hosts file on both your local machine and your VM. Add your VMs IP and point it to ‘linux’. This is important. Now ‘linux’ refers to the VM on both your computer and the VM. That means in your db config, you can say to use ‘linux’ as the host, and it will work locally and remotely.
Here’s my /etc/hosts addition:
Now it’s time for the special sauce. The magic. The thing that makes this all worth it.
For this purpose, I will assume all of your development stuff lives within ~/Projects
On your Mac, export your home directory over your VM’s network (/etc/exports):
/Users/[username] -mapall=[username] -network=10.211.55.0 -mask=255.255.255.0
and on your linux VM (/etc/fstab):
10.211.55.2:/Users/[username] /home/[username] nfs rw 0 0
Now to assist your path parity (so that things understand where they live, since OS X uses /Users and linux uses /home), what I did was simply symlink /Users to /home on my OS X and symlink /home to /Users on the VM
ln -sf /Users /home
ln -sf /home /Users
Now you just configure your apache:
CustomLog /var/log/httpd/linux.access_log combined
Restart your nfsd locally, and apache remotely, and remount /home/user on your linux vm, and you should be ready to enjoy some frictionless development. Work locally in your favorite IDE (I like PHPStorm), and via the magic of NFS, your changes are automatically running in an actual linux environment.
So this may be very Merlin Man (site, twitter, podcast1, podcast2, and podcast3) inspired, but I have to ask it, just for everyone’s sanity: What if you’re actually terrible at what your real job is?
Let’s say you’re hired to build websites. sure. You’re hired to build websites. But as Horace Dediu (podcast) points out, a lot of what we need to look at is the “Jobs to Be Done” and when you look at it in that perspective, your Job to Be Done is really to solve their communication issue.
That’s right. You’re not building a website, but communicating information. Be it “This is good” or “That is bad”, or just “Buy this widget”, the job you are doing for your employer is helping them to disseminate information.
If you get up every day, build exactly what they tell you to build, exactly the way they say, there’s two very, very real possibilities of what is happening:
- You’re viewed as nothing more than a production worker
- You’re terrible at actually solving the problems given to you, and thus become #1
Sure. You have to be able to make things pretty to be a designer, and you have to be able to code to be a programmer, but you have to be able to problem solve to be effective at either.
So, what do you do if you decide you’re terrible at your job?
So fkrauthan (in #symfony on freenode) ran up against an interesting issue w/ regard to generating paths to other bundles assets.
I don’t personally know much about the problem area specifically, but I worked with fkrauthan to develop a hack that got around the problem.
So, please, take a look at the github repository and chime in your two cents. I’m almost positive there is a more elegant way to do this, but we had no idea what that was.