Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import grp
import json
import logging
import optparse
import os
import pwd
import re
import subprocess
@jhn--
jhn-- / gfid-resolver.sh
Created December 1, 2015 05:06 — forked from louiszuckerman/gfid-resolver.sh
Glusterfs GFID Resolver Turns a GFID into a real path in the brick
#!/bin/bash
if [[ "$#" < "2" || "$#" > "3" ]]; then
cat <<END
Glusterfs GFID resolver -- turns a GFID into a real file path
Usage: $0 <brick-path> <gfid> [-q]
<brick-path> : the path to your glusterfs brick (required)
@jhn--
jhn-- / gist:4e3e2cbf3d7998a324b7
Last active September 17, 2015 06:41 — forked from bortzmeyer/gist:1284249
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys