Be Among the 20% of the Best!

Faster DNS on OS X

| comments

There is one operation that’s completed very often when programs connect to servers on the internet — that’s resolving DNS names (finding out the server’s IP address by its name). Typically, you use a DNS server of your ISP. It’s relatively close to your network, so it may be fast. This short post is about setting up a local caching DNS server on OS X for even faster DNS responses.

Persistent Application Container Directories in iOS Simulator

| comments

An annoying thing that was introduced a few releases ago in the iOS Simulator is that your apps’ bundle and container directories change their names (a random UUID) every time you run them in Xcode. It makes it very annoying to test your app if you need to check the output files regularly or restore the app’s container to a known state before launching. I’ve found a relatively painless workaround though!

HowTo: Demo Gerrit Server on AWS EC2 Instance

| comments

Hello there!

I occasionally conduct trainings on git and gerrit at my company. Using git is very easy, even for remote commands, there is GitHub, just cloning from another local directory, or even serving your own local repo on the network with git serve. Gerrit, on the other hand, requires a server somewhere to run it. This article describes the steps to setup a demo Gerrit server on an AWS EC2 instance (virtual private server) with HTTP authentication. NB: This guide is not for production usage.

Note: I run this server for a few days max on a month, so EC2 is cheaper than DigitalOcean. If you need to run it the whole month, the latter option is cheaper.

Note: you can do the same stuff (with fewer steps) to setup Gerrit on an Ubuntu virtual machine if you need to test it only locally.

OS X: Flexible Random Screensavers

| comments

Welcome back!


Today’s post is a trivial script to pick a random screensaver every day on OS X. Yes, if you go the “Desktop & Screen Saver” preference pane, there is the last item called “Random”, but it’s very limited — a screensaver is picked randomly among all available every time when it’s requested. To show why that’s not what I need, let’s install a pack of great screensavers, which has been ported to OSX — XScreenSaver:

# run this command if you don't have `brew cask` installed yet
$ brew tap caskroom/cask
$ brew cask install xscreensaver

The Fastest Way to Open System Preferences on OS X

| comments

Hello there. It’s a tiny post today to save you a couple of seconds when opening the “System Preferences” app on OS X.

  • One way: Cmd+Space/F10/your shortcut for Spotlight/Alfred/etc., type something like “sys” (“System Preferences” should be suggested), Enter.

  • The fastest way I’ve found accidentally: press Fn+Option+F11/F12 => the “Sound” tab in “System Preferences” opens, and the search bar is already focused, so you can easily type e.g. “display” to go to Display settings. So you use Fn+Fx keys to change brightness, volume, etc., and by adding Option you can open the corresponding settings tab. Very quick!

Restoring Files From TimeMachine Backup Manually

| comments

TimeMachine is a backup system working out-of-box on OS X, supports encryption and is quite easy to setup. Backing up is only a half of the deal though; you may need to restore it some day. You can restore the whole system on a new Mac, and it’s also possible to get the individual files if the need arises.

Renaming Xcode Project

| comments

I’ve used shell commands to rename projects a few times, and it worked better than renaming from Xcode itself. Here are the steps (given we want to rename warnings_test => BestAppEver) (you may need to install a few extra tools with brew install rename ack):

Fast Shoelace Knot Post

| comments

A quick post for those of you who use boots/sneakers with shoelaces.

I was taught to make a know which is called “Two Loop Shoelace Knot”. It is good, but is untied once in a while. I came across the “World’s Fastest Shoelace Knot” by Ian Fieggen, which, I must say, can be tied much faster indeed and is also stronger. Here’s an image:

All in all, the website itself is fascinating too. It’s wholly dedicated to shoelaces and knots. There is even one that can be tied with one hand (related to Neurobics).