A friend recently read my post on how bash redirection works, but didn’t quite understand my explanation of how bash launches another process and sets stdin/stdout/stderr, so this is a follow up post. Linux creates every process using the fork(2) or clone(2) syscalls. The only way to create a process is to fork your current […]
So what is /proc anyways?
I’ve been using Linux for years, but I’ve never really known was /proc was or why certain commands used it. I’m not sure why I’ve never looked it up in the past, but I recently did and I thought I’d share. /proc isn’t a “real” directory, in the sense that it doesn’t exist on disk. […]
How bash redirection works under the hood
Have you ever wondered how bash redirection works under the hood? Redirection itself is pretty straightforward. Using bash, you can redirect a file to a process’ stdin, or redirect a process’ stdout/stderr to a file or other file descriptor (including things like redirecting stderr to stdout, because both are file descriptors). Redirection looks like this: […]
Z, a must use command line tool
Recently, I was updating my bash prompt and setting up some Zsh profiles when I found a great script called Z (https://github.com/rupa/z). Z keeps a history of your most used directories and allows you to quickly jump to them based on the most popular/frequently used directory that matches a partial string. I manage a lot […]
- Development
- ...
Why you should be using strace
Strace is a debugging utility for *nix systems, used to monitor the system calls used by a program, as well as any signals received by the program. Strace is useful for seeing what an application is doing under the hood, which can be vital to find subtle bugs in your code obscured by built-in functionality. […]
Long running PHP script gotcha
So I was recently answering a question on StackOverflow, and learned something quite interesting about PHP. This particular aspect of PHP mostly affects long running scripts, such as PHP based servers or daemons. PHP does not re-use resource ids internally, so eventually your script could run into an error with the resource ID overflows and […]
- Development
- ...
Optimizing Your PHP with Xdebug
I work with a lot of PHP applications, and part of my job is optimizing those applications to reduce server costs and maximize how many requests each server can handle. There are many ways to do this, but I’m going to talk about using a profiler, which is one of the better ways to start […]
Basics Of Scaling: Load Balancers
Lately, I’ve been doing a lot of work on systems that require a high degree of scalability to handle large traffic spikes. This has led to a lot of questions from friends and colleagues on scaling, so I thought I’d do a blog series on the basics of scaling .
Varnish VCL Syntax Highlighting For Sublime
I’m an avid fan of the Sublime Text editor, and I also work with Varnish on a daily basis. Like Nginx and many non-standard languages, Sublime Text has no built-in support for Varnish VCL configuration files, and the only existing plugin was very poor. Not only does the existing plugin have awful syntax highlighting that […]
Nginx Syntax Highlighting For Sublime
I’m an avid fan of the Sublime Text editor, and I also work with Nginx very frequently. Sadly, Sublime Text has no built-in support for Nginx configuration files, and the only existing plugin was very poor. Recently, I decided to investigate the process to make my own syntax highlighting plugin for Sublime, and it turned […]