SSH tips and tricks

We often have to work with remote servers in our jobs as developers. For simple projects you might chose FTP (or SFTP), which is fine for copying files, but for more complex applications which require more complex deployment processes, you will need something more powerful. There are many ways to access remote systems but SSH is probably one of the most widely used; deeper knowledge of it may simplify a developer's tasks and allow them direct access to a remote operating system in a fast and secure way. This post shows how to use SSH: not only to connect to a remote server, it shows how to use SSH in secure way and how to use it to automate tasks, and includes tips for all kinds of users. Developers may learn how to access remote databases behind a firewall, administrators will be interested in mosh (mobile shell) or the parallel execution of tasks, and even project managers may want to use an SSH proxy to bypass limitations of guest wifi during meetings. We'll start out with some tips for tackling the unexpected.

PHP test doubles patterns with prophecy

Test doubles are a way of replacing all classes in our tests other than the one we are testing. They give us control on direct and indirect outputs that would have been generated by those classes. Understanding the role of the test double helps us to write better tests, and thus better code. If we manage to isolate the "collaborators" (the other objects involved in our test) using doubles and test our objects in isolation, then we have achieved modularity: our code is decoupled and the communication between objects is documented by our tests. When writing unit tests we are focusing on describing one unit of behaviour at a time, and how objects communicate in order to achieve that behaviour. We instantiate the object under test, call a method of the object and observe if the outcome is as expected.

Functionally testing your application using MINK

Automated testing is big news these days. There's hardly a PHP conference happening without a talk on testing automation or derivative methodologies. TDD (Test-Driven Development) and BDD (Behaviour Driven Design) are all around us. So why should you care about all this? Well, there are many excellent reasons to do automated testing, including assuring application quality and inspiring developer confidence in a system. If you are a business person, you're most likely to care about the quality; if you're a developer then the confidence aspect is more important.

New relic for PHP: web application performance monitoring

The performance of a web application plays a critical role in how an application is perceived by its users. It is important to measure it, identify the causes if it changes and react swiftly to any unexpected changes. This article describes an industry leading tool, New Relic, and how it can be used to monitor and improve your site performance.

Manipulating HTTP with Charles Proxy

Charles Proxy is exactly what its name implies; a proxy. This proxy is special however, as it is specifically aimed at giving functionality that developers will need. It allows you to view, change and replay the traffic that passes through, and can handle SSL. Charles isn't free, but at $50 (at the time of writing) for a license, it reaps returns from day one. This article will show you how to start using Charles and covers techniques that will help you work with your web and mobile applications; basically anything that works over HTTP.