Skip to content

Instantly share code, notes, and snippets.

View tmkasun's full-sized avatar
🕶️

Kasun Thennakoon tmkasun

🕶️
View GitHub Profile
@imesh
imesh / cp-cep-artifacts.sh
Created December 26, 2013 14:31
Copy CEP artifacts from source to server deployment folders
#!/bin/bash
# -----------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
@mrrooijen
mrrooijen / run.rb
Created May 28, 2013 17:05
Quick `open3` wrapper for running a synchronous system command and returning the pid, exit_status, stdout and stderr of the provided command.
require "open3"
def run(cmd)
Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|
return {
pid: wait_thr.pid,
exit_status: wait_thr.value.to_i,
stdout: stdout.read,
stderr: stderr.read
}