Tag Archives: OSX

SSH keys & OSX

Put your private & public key on folder ~/.ssh
All private keys must have 600 rights (-rw——-), or they will be ignored.

  1. List your currently load keys:
    ssh-add -l
    
  2. Load your keys on ssh-agent and store them on OSX Keychain for future use
    ssh-add -K /path/of/private/key
    

    Eventually type the SSH key’s secret if prompted.

All your SSH keys should have been added to your “session” keychain for the application SSH.
From now on, when you need to connect with SSH, you can load all of your private keys at once with the following command

    ssh-add -A

To go further

Get speedy with a config file

You can setup a config file for your frequently accessed servers, and preconfigure all the connection details:

  • user,
  • ssh port,
  • etc …

Reuse existing putty keys (*.ppk)

Make a good use of puttygen … (To be described one day, maybe …)

References

I used the following informations found on the web and obviously the manual to get the whole thing working.
Thanks you to each of the authors for their valuable informations.

Adding a Private Key to Your Mac OSX Keychain
Simplify Your Life With an SSH Config File
Using an SSH Config File

Using markdown to write plain text … such a briliant idea!

markdown_mark.png

I am currently exploring some new tools to optimize my workflow, and this lead me among other things, to markdown. I am really not on the bleeding edge, this language is out there since 2004. You can find plenty of articles explaining why markdown is awesome, and how it has revolutionized the workflow of everyone using it.

Shortly, Markdown is a plain text formatting syntax that help you to:

  • write in plain text with your favorite text editor,
  • keep focus on writing, and being less tempted to procrastinating,
  • It’s really easy, and simpler than HTML ou WIKI syntax.

You are not bound on any file format (docx, odt, etc), it’s just plain text. It will hardly break or become corrupted … if you stick with plain a text editor (see below on this part).

Then, when the file is processed by a “markdown aware” viewer, the magic works a you get a nicely formatted text.

My first enhanced Markdown Editor : The Journalist, Crash & Restore …

So I started taking notes with textwrangler, and soon I felt the need for :

  • A preview of the text rendered, as I type,
  • an easy way to manage all theses files.

As I was just starting to explore Markdown, I looked for a free app to start with. A quick search on the Mac App Store led me to the application “The Journalist”.

The application looks pretty and my two former requirements seemed to be fulfilled. But after a day of notes, The Journalist crashed badly and my content was gone! It seems like something got finally corrupted…

Useless to explain how I was scared … I started digging to find where the application actually stored his data, without success… An email to the application developer, and a couple of hours later I got a kind answer! The folder to look for was the following ( and I would never guess it alone …) :

~/Library/Containers/com.mimietpaul.journalistmac

Rescue the data!

Basically, The Journalist store data in a sqlite database. I figured it trying to open files with a basic text editor. So all I need, is to open this database file and query it!

Here are the steps to follow in order to recover your “precious” content:

  1. copy the sqlite file:

    ~/Library/Containers/com.mimietpaul.journalistmac/Data/Library/Application Support/TheJournalist
    
  2. rename thejournalist.data to .sqlite extension,
  3. Open the database using a sqlite editor (1)
  4. query the table “ZJNOTE” to list all the notes

    SELECT * FROM ZJONOTE
    
  5. query on “ZBODY” field obtain to actual content : your notes!
  6. copy/paste in your favorite text editor,
  7. you are free!

(1) The Firefox extension SQLite Manager is a perfect fit for this simple need.

Conclusion

This misadventure has allowed me to learn a little more about the specifications for my note-taking tool:

  • The potential markdown application must generate raw text files!
  • If the application is enhancing the writing experience (adding metadata, pictures, etc …) : metadata must be kept separately from files.

Be sure that I will check twice before storing my data on an application …

Ressources

Links

Here is some useful references and stories about Markdown:

Apps and Tools

Some useful tools for Markdown on OSX

  • Textwrangler, the free edition of the great BBEdit. It recognize markdown syntax (*.md extension),
  • QLMarkdown is a OSX plugin for Quicklook. It enable the rendering of markdown files (*.md extension) right in the finder and A how-to guide to assist you installing it.

I am currently evaluating Ulysse III as my main editor and text file repository. Later on this as I continue digging about it.

Fusion and keyboard layouts for Windows/Linux/OSX guest VM

Anyone using VMs hosted by a Mac have struggled one day or another with the keyboard layout of the guest VMs. Any special character you have to deal with (enter our beloved : ‘@’, ‘#’, ‘\’, ‘|’) could be the challenge of the day, specially with a non En-US keyboard. Then if you dare to get access to a remote system by iLO/iDRAC/IPMI/etc … well, you have to be Rain Man to type your password 😀

I don’t know if it’s a new feature of Fusion 6 (nor I remember having seen it before), or if I was blind for so long time, but today I have a really simple combination of settings which make the keyboard working like a charm, even with a nasty use case like this one : installing an ESXi through UCSM KVM via an RDP session from your windows VM (uh! inception-like), and trying to send F2, F12, or special characters for the root password …

On the virtual machine settings, under “keyboard and mouse”, you just have to choose the profile “mac”… no tinkering needed with the keymap on the Windows Guest OS.

If your guest OS is Mavericks, there is a little trick : be sure to select on the OS X settings the keyboard “PC” for  your language …

This works on Linux too (tested with a CentOS 6.4 only), except characters that are not directly accessible on a mac keyboard : like backslash and pipe. To access them on the Linux VM, simply the standard PC keyboard combination, with the right option key (alt) playing the role of Alt-GR. Yes on this last one, you still have to know your PC keyboard layout.

Example : to type a pipe on your windows/linux guest OS, type “right alt” + “§” on your mac keyboard.

As a reminder, backslash and pipe on the OS X host OS are accessible with the following combination : option + shift + (slash for backslash, and l for pipe).