Connect to GitLab via SSH

Start an ssh-agent

If not yet done add to your rc-file ike .bashrc or .zshrc

$ eval `ssh-agent`

Add your generated key

$ ssh-add ~/.ssh/id_rsa

List keys

$  ssh-add -l

GitShell anyone?

GitLab should response with git-shell. You shall log in by git-user only!

$ ssh -T git@myserver.lab
Welcome to GitLab, Markus Geiger!

You should not get an Interactive Shell like sh!

Git Version> 2.2
GIT_SSH_COMMAND="ssh -vvv -T git@gitserver" GIT_TRACE=2 git clone git@gitserver/foo.git
Git Version < 2.2

# Debugging

ssh -vv -i privatekey -l git $@
GIT_SSH="sshwrapper-script" GIT_TRACE=2 git clone git@gitserver/foo.git

Other way

git config --global credential.helper cache

bash: shell table output to json

You know that sometimes it would be really great to format a shell output to a more versatile format like JSON or YAML you can process with jq instead of writing long pipes with text-processing.

Ah yeah, you could use python instead of bash 馃槈


$ virsh net-list                     
 Name                 State      Autostart     Persistent
 default              active     yes           yes


$ virsh net-list | table-to-json 
        "autostart": "yes", 
        "name": "default", 
        "persistent": "yes", 
        "state": "active"
$ virsh net-list | bin/table-to-json  | jq -r ".[0].name"


#!/usr/bin/env python

import sys
import re
import json

def parse_line(line):
    if line.find("\t") == -1:
        line = re.sub(r'\s+', '\t', line , flags=re.IGNORECASE)
    line = re.sub(r'^\s+', '', line , flags=re.IGNORECASE)
    line = re.sub(r'\s+$', '', line , flags=re.IGNORECASE)
    return [x for x in line.split("\t") if x]

lastparts = []
columns = None
data = []
for line in sys.stdin:
    parts = parse_line(line)
    if len(parts)>0:
        if len(parts)>0 and parts[0].startswith("-"):
            columns=[x.lower() for x in lastparts]
        elif len(parts)>0 and columns:
            data.append(dict(zip(columns, parts)))
    lastparts = parts

print json.dumps(data, sort_keys=True, indent=4)

UPDATE: Maybe the script should use asciitable

Infojunk October 2018

Browser Extensions

Collaborative Coding

Focusing on IDEs. Web-based solutions are mostly ignored.






Jame’s Path Selector is not as much powerful as jq but Amazon AWS probably chose it since it might be faster and probably query-selectors are a bit more sophisticated (?)




Font Ligatures