GLWTPL – Good Luck With That Public License

GLWTPL is awesome!

GLWT Public License
Copyright (c) Everyone, except Author

The author has absolutely no clue what the code in this project does.
It might just work or not, there is no third option.

Everyone is permitted to copy, distribute, modify, merge, sell, publish, sublicense or whatever they want with this software but at their OWN RISK.

GOOD LUCK WITH THAT PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION, AND MODIFICATION

0. You just DO WHATEVER YOU WANT TO as long as you NEVER LEAVE A TRACE TO TRACK THE AUTHOR of the original product to blame for or held responsible.

IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Good luck and Godspeed.

Reboot and wait for reboot to complete in Ansible playbook

Jeff Geerling shares a handy tip on how to implement the configure-reboot-configure pattern in an Ansible playbook.

---
- name: Do something that requires a reboot when it results in a change.
  ...
  register: task_result

- name: Reboot immediately if there was a change.
  shell: "sleep 5 && reboot"
  async: 1
  poll: 0
  when: task_result is changed

- name: Wait for the reboot to complete if there was a change.
  wait_for_connection:
    connect_timeout: 20
    sleep: 5
    delay: 5
    timeout: 300
  when: task_result is changed

...

Weird operators in PHP

Weird operators in PHP” covers a variety of awkward and weird operators in PHP.  I don’t think I’ll ever write any code using any of these.  But in case I come across any code in the future, that utilizes them, I should be sure to search back in the archives of this blog.  Here’s an example to get you started:

X-fighters

In case you want to add some firepower to the previous fleet, you can summon X-fighters to the PHP source : +-0-+. The following code adds 3 to $a.

$a = $a +-0-+ 3;

HTTP : The headers we want

The headers we want” is a very simple, straight to the point blog post on the Fastly blog.  Unlike many other more generic articles on the subject, it doesn’t try to explain the meaning of every HTTP header out there, and it doesn’t go into deep theory or the meaning of life, the universe and everything.

Instead it tells you plain and clear which headers should be emitted by your website or web application.  And these cover everything from the usual Content-Type and Content-Length, all the way down to the CORS and Server-Timing.

Once the basic functionality of your website or web application is done and out of the way, this blog post comes in handy with the specific best practices to make your site more secure and much faster.

For more on the same subject, have a look at “The headers we don’t want” in the same blog.

Shell Style Guide from Google

For all of you out there writing millions and millions of shell scripts to glue the world together, here’s a useful Shell Style Guide from Google.  It is very Bash-centric and covers all the usual bits and pieces: comments, formatting, naming conventions, allowed features and recommended best practices.