sudo without password

By Josh Sherman
3 min read
linux
security

I’ve recently run into deployment scenarios where I need to have a unprivileged user account execute something privileged like restarting nginx. Sure, I could just do things with the root account, but most of my deployments are done via SSH commands and I don’t allow root logins directly on my […]

Days until Christmas in PHP

By Josh Sherman
1 min read
development
php

The holidays are upon us so it’s time for my obligatory holidays themed post! Keep in mind that the title may say Christmas but you could apply this same logic to any holiday or date of your choosing. $christmas = date('Y-12-25'); $today = date('Y-m-d'); echo (strtotime($christmas) - strtotime($today)) / 86400; […]

How to reverse a string with PHP

By Josh Sherman
1 min read
development
php

Reversing a string in most languages is a pretty trivial task. In PHP we have a dedicated strrev function to do so: $string = 'This is my awesome string!'; $reverse = strrev($string); But what if this function didn’t exist? How would you go about reversing the string? For me, I’d […]

Blogging from your phone

By Josh Sherman
1 min read
blogging
writing
productivity

Why an I blogging from my phone? Well it’s been a very busy weekend and I wanted to give this a shot. It’s amazing that we have the technology to be able to do what I am doing right now. My rig consists of a Nexus 5 running the latest […]

Node.js on the command-line

By Josh Sherman
1 min read
development
nodejs
command-line

To start, let me put it out there that I’ve drank the kool-aid and have been doing a ton of hacking with Node.js (and soon enough, IO.js). I’m going to save the details for another post though. So an observation I’ve been making recently is that it seems like the […]