Git Tip of the Day: count number of lines of code in repository

How to count number of lines of code in a Git repository? Add this alias to your ~/.gitconfig

[alias]
    loc = diff --stat 4b825dc642cb6eb9a060e54bf8d69288fbee4904

This shows diff against empty repository (git hash-object -t tree /dev/null)

Now you can just type git loc and get an answer. This is nice as ...

more ...

AWS Tip Of The Day: Get S3 disk usage per bucket

Getting disk usage statistics for Amazon S3 buckets is not that easy. Things are quite simple when your objects count and data size is reasonable and by reasonable I mean something around < 10 TB and < 1000 objects per bucket.

You can either use s4cmd (fast, multi threaded)

s4cmd du -r ...
more ...

Fix ElastiSearch stuck with unassigned shards

In case your ElasticSearch cluster is stuck with unassigned shards you might want to try rerouting them to some other node.

curl -XGET http://localhost:9200/_cat/shards | grep UNASSIGNED | awk '{print $1 " " $2}' | while read -r index shard; do

    echo "Rerouting shard $shard from index $index"
    curl -XPOST 'localhost ...
more ...

vagrant down

Why doesn't vagrant provide vagrant down command? And I need to always check how to stop my VM insted of just relaying on simple up->down schema..

Edit: gues I wasn't the only one ranting about it: vagrant-down.

more ...

OS X Tip of the Day: Getting GDB back on Maverics

XCode on Maverics switched to LLDB and CLANG. Although this is exciting news, it screwed some utils that assume gdb is available on your system. Well, it is not - even if you had installed Command Line Tools. Fortunately, your local brewery came to the rescue. Assuming you have installed Homebrew ...

more ...

LXC Tip of the Day: network issues, connection lags

If you get strange network lags and issues while connecting to your LXC Container, be sure that a coworker didn't setup another container WITH THE SAME MAC ADDRESS as yours container.

lxc.network.hwaddr  = 00:FF:00:00:00:04

By the way, lxc-clone sux not taking care of ...

more ...


OS X Tip of the Day: AirPlay audio glitches

Annoyed with AirPlay glitches when outputing Mac's sound to your Awesome Speakers connected to AppleTV? Tired of rebooting to fix AirPlay problems? Angry because issue is known for at least a few months and still no fix from Apple?

Well fear not! Open Terminal and type:

$ sudo pkill coreaudiod ...
more ...