Copy a Whole Directory over SSH with rsync

rsync is a tool for efficiently transferring and synchronizing files across systems by checking the timestamp and size of files.

With the following command, a whole directory can be copied over SSH to a remote machine maintaining even symbolic links:

rsync -avze /source_dir ssh [email protected]:/target_dir

List and Change CMake Variable Values

CMake is a powerful, cross-platform tool for managing the build process of software. It is able to identifiy the location of the software’s requirements and the available compiler/s. Based on that, CMake configures and generates a makefile which is ready to be executed.

This week’s post shows how to list all variables and their set value in a CMake generated build folder.

  1. Switch to the build folder with: cd [build folder]
  2. Execute inside the folder: cmake -LAH

Install Ruby with rbenv on macOS

This post is about rbenv, a development environment managing tool for Ruby. This tool is handy if you need specific Ruby and Ruby gems versions for specific projects. By doing this, you keep your project’s requirements in check.

Installing rbenv with Homebrew:

  1. brew install rbenv
  2. brew install ruby-build
  3. echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
  4. source ~/.bash_profile

Installing Ruby in e.g. version 2.2.3 and defining it default system-wide version:

  1. rbenv install 2.2.3
  2. rbenv global 2.2.3
  3. rbenv rehash
  4. ruby -v

Take Screenshots on macOS

This week’s post is an unusual one, because it is not including the terminal. Instead, it is about taking screenshots on macOS, which is essential in a (macOS-based) developer’s life.

  1. Taking the whole screen as a screenshot: CMD + SHIFT + 3
  2. Taking a selective area as a screenshot: CMD + SHIFT + 4
  3. Selecting an open window and taking it as screenshot: CMD + SHIFT + 4, then SPACE

Download Files from Terminal Using wget

When it comes to terminal/command line tools, wget is the ultimate tool for downloading files from the internet.

These are the three most important wget commands:

  1. Downloading a file: wget [URL to file]
  2. Continuing downloading a file after interruption: wget -c [path to file on disk]
  3. Downloading an entire FTP directory: wget -r [URL to directory]