Nisdom. As opposed to Wisdom.

The problem with the future is that it keeps turning into the present.

Minimalistic Logging From Docker Containers

| Comments

Reading logs from Docker container can be done using docker logs container_id. This simply fetches logs present at the time of execution from container’s STDOUT and STDERR streams. If you want to, however, transform those logs, and send them to a central repository using e.g. logstash, there are a number of options to choose from. Here I’ll be describing the simplest case of writing logs to /dev/log socket.

A Matter of Logs

| Comments

Logs are very important part of any serious software system. They provide invaluable insight in the current and past state of the system. Simply saving them to a disk or persisting them in any other crude way might probably deprive you from discovering anything interesting in it. The purpose of this article was to describe one such offline processing logs collection system I created years ago and to sketch possible real-time solutions using technologies available today.

Replacing Wordpress With Octopress

| Comments

About a month ago I embarked once again on an adventure of replacing my WordPress blogging platform with something more Ruby friendly. I say once again because the last time I have tried, after 30 minutes or so of more or less futile search, I simply gave up. This time the urge was stronger and I was even luckier. But first, let me explain a bit my motivation for change.

CORS Font Issues With Rails, Heroku, CloudFront and Passenger

| Comments

Ever saw a log in your browsers console saying some resources like web fonts could not be loaded because Access-Control-Allow-Origin headers were missing? Did you think “oh, this should be easy” and then spent hours of searching through various misleading articles and even more hours applying those advices and still failing? Well, I sure did and here’s the story and how I finally won.

A Simple Ruby sitemap.xml Generator

| Comments

Yesterday I finished writing a simple Ruby CLI tool which I called SiteMapper and which sole purpose was to output the sitemap.xml file, a standard format used by many popular search engines. I have made it available at https://github.com/okulik/sitemapper. While doing first smoke tests I realized I would benefit from some sort of visualization (besides creating space-indented text logs), so I added a way to generate dot file which can be converted to .png file by the graphviz tool.

Embedding a 64-bit Binary in a 32-bit Windows C++ App

| Comments

Some time ago I bumped into a nasty little problem on Windows 7. I had this small Windows tray utility written in C++ whose purpose was, among other things, to detect if Microsoft Word was running and whether it was a top-level app. One of the APIs I was using for that purpose was EnumProcesses. Here’s how that looked like:

Neo4j Tweaks

| Comments

Increase the number of open files for all users:

1
2
3
sudo vi /etc/security/limits.conf
*       soft    nofile  100000
*       hard    nofile  100000

Ruby http.rb Segmentation Fault Solution for OSX

| Comments

If you are getting segmentation faults from your Ruby interpreter (either 1.8.6, 1.9.2 or 1.9.3) on your OSX development machine, and your code is touching some https endpoints, they are probably caused by faulty macports openssl installation (problem is described here in more details).

Farewell to OCZ Vertex 2

| Comments

A week ago I just couldn’t boot my iMac 2010. No Apple logo, not anything except a blinding white screen. From all keyboard shortcuts available during the boot time I was only able to reset NVRAM. Since the reset worked (followed by a loud Apple boot sound), I wasn’t worrying anymore that my iMac died (mobo, cpu, ram), so I turned my attention to the SSD (about a year ago I replaced the internal DVD drive with the OCZ’s Vertex 2 120GB SSD).