Skip to content

Instantly share code, notes, and snippets.

View ekohl's full-sized avatar

Ewoud Kohl van Wijngaarden ekohl

View GitHub Profile
class PowerShellVmsResource {
enum Method { GET, ADD };
enum Detail {
DISKS("$_.getmemorystatistics(); $_.getcpustatistics(); "),
STATISTICS("$_.getdiskimages(); ");
public final String powershell;
@ekohl
ekohl / listdir.c
Created June 1, 2012 11:41 — forked from anonymous/listdir.c.txt
listdir.c
#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#define handle_error(msg) \
import requests
import json
from subprocess import Popen, PIPE
class MCollective:
def list_hosts(self):
process = Popen("mco rpc rpcutil ping -j".split(), stdout=PIPE)
j = process.communicate()[0]