Keep It Simple Stupid

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).

Jenkins: matrix job with conditions

| comments

Let’s say I have an iOS project, and I’d like to build it in a number of configurations: “Debug”/“Release”, for device/simulator, and with/without debug logs. Jenkins has the multi-configuration (aka matrix) project build plugin for that. Not all of the steps are required/possible everywhere (e.g., testing is allowed in the simulator only, or checking the license is enough one time only).

Source Code License Check in Jenkins: Revised

| comments

This is a revised post on how to setup source code license check on your Jenkins. The first version is here. The basic idea is the same, but there are a few important changes described below. So to set this up, please follow the first post, except for a few values overridden here.