Category Archives: Uncategorized

Release Music

Almost nobody knows that Drowning Pool’s “Bodies” is actually a song about code releases.

Let the bodies hit the floor – let’s release
Let the bodies hit the floor – git checkout staging
Let the bodies hit the floor – git merge origin/dev
Let the bodies hit the… FLOOR! – git push –force

Beaten… why for? – tests are not passing
Can’t take much more – again? they were green yesterday
Here we go… Here we go… Here we go (now) – restart the GitHub Action

One – Nothing wrong with me – first test is passing
Two – Nothing wrong with me – second test is passing
Three – Nothing wrong with me – third test is passing
Four – Nothing wrong with me – fourth test is passing

One – Something’s got to give – lints are not passing
Two – Something’s got to give – static analysis errored out
Three – Something’s got to give – there are 3 PRs still open
Now! – there’s no time unfortunately

Let the bodies hit the floor – let’s still release!
Let the bodies hit the floor – git checkout production
Let the bodies hit the, floor! – git merge origin/staging
Let the bodies hit the floor – merge conflict
Let the bodies hit the floor – git reset –hard origin/staging
Let the bodies hit the, floor! – git push –force

Push, me again – push a hotfix into master
This is the end – production cluster is down
Here we go… Here we go… Here we go (now) – it should work now

One – Nothing wrong with me – health checks are up again
Two – Nothing wrong with me – homepage is 200 OK
Three – Nothing wrong with me – release notes are sent to client
Four – Nothing wrong with me – wrapping up for the day

One – Something’s got to give – turns out homepage was cached
Two – Something’s got to give – 500 Internal Server Error
Three – Something’s got to give – migrations didn’t apply
Now! – run them manually!

Let the bodies hit the floor – client is angry
Let the bodies hit the floor – management is furious
Let the bodies hit the, floor! – users are bouncing
Let the bodies hit the floor – rollback is impossible
Let the bodies hit the floor – enable maintenance mode
Let the bodies hit the floor – overtime

Skin against skin, blood and bone – team pulling an allnighter
You’re all by yourself, but you’re not alone – management can’t help
You wanted in, and now you’re here – job responsibilities
Driven by hate, consumed by fear – mortgage payments

Let the bodies hit the floor – git bisect start
Let the bodies hit the floor – git checkout 05bc12aa
Let the bodies hit the floor – git bisect good
Let the bodies hit the floor! – git bisect bad

One – Nothing wrong with me – 05bc12aa was both good and bad
Two – Nothing wrong with me – git blame
Three – Nothing wrong with me – git log
Four – Nothing wrong with me – git stash list

One – Something’s got to give – production branch and ‘origin/production’ have diverged
Two – Something’s got to give – deleted by them
Three – Something’s got to give – rm -rf .git
Now! – git init; git add .

Let the bodies hit the floor – git commit
Let the bodies hit the floor – (how do I exit vim?)
Let the bodies hit the floor! – pkill vim
Let the bodies hit the floor – git commit -m ‘hotfix’
Let the bodies hit the floor – git push –force
Let the bodies hit the floor – 30 minutes to daily
Hey go… Hey go… Hey go… Hey go! – nano letter-of-resignation.txt



Xdebug Profiling WordPress Actions and Filters

Xdebug is a great profiling tool for PHP code, but it has one little drawback in WordPress that results in a profiling nightmare – WP_Hook::apply_filters. The profiler lumps together all calls to WordPress actions and filters without distinguishing them as different execution paths. This is bad and not useful at all, resulting in a tangled mess of cycles.

Xdebug WordPress WP_Hook-/>apply_filters” width=”959″ height=”457″ class=”aligncenter size-full wp-image-2160″ /></p>
<p>Xdebug can be patched, however (patch below is for version 3.0.4), to differentiate calls to <code>P_Hook::apply_filters</code> and tag them with the actual filter name:</p>
<p> <a href=Continue reading



Sucuri imonitor

’nuff said.



On Startup Partnerships

As a contractor, I’m often approached by startup founders (or founders-to-be). They’re looking to reach some kind of partnership deal, where I would do backend development work without charging any money. As a wantrepreneur, I’m sometimes approached to fund some sort of startup. When, or rather, if the startup becomes profitable, I would get a cut of the profits.

I’ve learned some important lessons in the past 10 years. These help me deal with new partnership proposals without getting carried away, and steer some of friends and colleagues away from lucrative business proposals.

Continue reading



Bustone – Time and Space

…or the lost and found of underground ultra rare Christian Hip-Hop songs

…or “Are you insane? You haven’t written anything programming-related in over a year and you come back with this nonsense?”

Continue reading



do_action Moscow 2018

or creating a chat bot for WordPress in 2 days.

My first WordPress hackathon! do_action Moscow 2018 was organized this past past weekend by Теплица социальных техонологий, a Russian non-profit organization operating around the country.

Around 20 non-profit organizations took part in the hackathon over two days using WordPress to advance their causes. I was assigned to a team called Второе дыхание, a non-profit based in Moscow that gathers and recycles unwanted clothes, toys, etc.

Their idea was to create a chat bot for WordPress to help alleviate e-mail and Facebook chat support resource hogging.

Continue reading



Rust’s os::args() to C’s *argv[]

I’ve been hooked on Rust lately, trying to wrap my head around the whole borrowing, lifetimes and boxes parade. What’s tough with young Rust is that most sample code out there is outdated, answers to questions no longer correct, documentation leaves a lot to be desired.

I decided to learn a bit of Rust by writing a FUSE, using the libfuse shared library (yes, I know there’s a Rust implementation here). So I’m looking at FFI to get me started and writing the main libfuse signature.

fn fuse_main_real(argc: c_int, argv: *const *const c_char, op: *const fuse_operations, op_size: size_t, user_data: *const c_void) -> c_int;

The huge challenge I found myself with was trying to convert os::args to *const *const c_char. All the code out there seems to be outdated, nothing worked for me. I was getting lifetime errors, borrowing errors and even move errors for hours on end. And when there were no borrowing errors I was slapped on the face with segmentation faults.

After a lot of thinking, reading the basics several times, I managed to convert the command line arguments given to my Rust program into the needed pointer to a pointer of chars. Here’s how it looks:

let argv:Vec<ffi::CString> = os::args_as_bytes().into_iter().map(|arg| { ffi::CString::from_vec(arg) } ).collect();
let args:Vec<*const c_char> = argv.into_iter().map(|arg| { arg.as_ptr() } ).collect();
fuse_main_real(args.len() as c_int, args.as_ptr() as *const *const c_char, .... );

Let’s go through this step by step. First we grab a Vec<Vec<u8>> from os::args_as_bytes, iterate and collect a Vec of null-terminated ffi::CStrings. Next, iterate over each CString and collect a pointer to the char array it’s being backed by. The rest is easy.

Why two variables? I found that chaining ffi::CString::from_vec(arg).as_ptr() would not work because once the pointers have been collected the created CString is freed once the map is done. So we need to keep the CStrings around in order to the pointers to be available for use.

A seemingly trivial task turned out to be quite difficult to get to. I’ve probably done it incorrectly either way 😀 it must be, since it’s a highly inefficient solution (looked at the emitted assembly and those two calls are awfully large).

Still a lot to learn about this ever-evolving, unstable but fun language. By the way, I used rustc 1.0.0-dev for the above.



This is our dog Polyushka (translates to cinnamon roll from Russian). Decided to have a shower today, after a long walk. She doesn’t like to have pictures taken, especially after a shower, but she says hello 😉

Continue reading



hello world

…thus, we begin…