Programming
7 May 2012 1 Comment

Setting Up Git/Github on Ubuntu In Five Minutes

1: Install Git

sudo apt-get install git-core git-doc

2: Configure Git

Bare minimum:

git config --global user.name "Firstname Lastname"
git config --global user.email ""

Enable colors when outputting to terminal:

git config --global color.ui true

These settings are saved in ~/.gitconfig.

3: Generate Cryptographic Keys

Create an RSA public/private key pair in the ~/.ssh/ directory. Be sure to use a passphrase.

ssh-keygen -t rsa -C "" -f ~/.ssh/git_rsa

This generates a private key in ~/.ssh/git_rsa and the corresponding public key in ~/.ssh/git_rsa.pub

4: Add Public Key To Github

Copy all contents of ~/.ssh/git_rsa.pub and add it to your Github profile.

$ cat ~/.ssh/git_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJCqSW4MyOESvnNL6Xjc9jQ3Vvj+yZSqD+HB5Dcbewc3vKpUISaC4mnUetN2B0Xn5QUOVTwdfDti+N+uMHod5VTeDPN7jNdbA/b/Vjo+C+hdJ8tissJDaCSQ29Wluhlogoe/4H3uSWmwKvMkgnK6DK3rXBKdy/T6Xeb8iFlxK5LLUt1B5nv9wxOGlhLd6ul5VeVGZKYxdwRLRkWE1w+ffEnfhJualOOZrW71up2EYl/FnmOMCMA7oKRyje+uQ2XSai220MlMwFH/VSOFskEM9dmilRxtFv27cq1vasiAIloKwFP8uYh42P4m3FPbWMulNXZvA3F4YsDfTBfDzQ3SUt

General
27 December 2010 5 Comments

How To Fix: Strange Characters in PuTTY

When opening an SSH session from a Windows box to a Linux machine using PuTTY I noticed some strange characters. The text looked like this:

warning: format â%dâ expects type âintâ, but argument 2 has type âint *â

I was puzzled, because I had not had experienced this problem before when using PuTTY. Typing echo $LANG in the bash terminal prompt showed that it was using en_US.UTF-8 as the character set . The problem was caused by PuTTY expecting a different character set (One of the Windows ISO-8859 charsets).

To solve this problem, PuTTY must be configured to speak the same language: UTF8. Here’s how:

  1. Open the PuTTY configure dialogue by clicking in the upper left corner of the window and selecting “Change Settings…” from the menu.
  2. Go to “Translation” on the left side tree menu and select “UTF-8” from the pulldown menu to the right.
  3. Apply the settings.

Now the correct output will show:

warning: format ‘%d’ expects type ‘int’, but argument 2 has type ‘int *’

Tags: , charset, iso-8859, putty, , translation, utf-8, utf8