Skip to content

Instantly share code, notes, and snippets.

View CMAD's full-sized avatar

Carlos Antelo CMAD

  • Montevideo, Uruguay
View GitHub Profile
@CMAD
CMAD / parallel.sh
Created July 9, 2012 18:02
./parallel.sh $WORKER_CMD $NUM_WORKER $TASK_POOL
#!/bin/bash
WORKER_CMD="$1"
NUM_WORKER="$2"
TASKS_POOL="$3"
callback(){
"$WORKER_CMD" "$1"
schedule
}
schedule(){
TASK=`head -n 1 "$TASKS_POOL"`
@CMAD
CMAD / exportfs
Created September 10, 2012 20:45
script trivia
#!/bin/bash
# micro fileserver
echo "exportfs: server initiated" | logger
if [ "$#" -ne 1 ]; then
echo "Usage: exportfs EXPORT_BASE"
exit
fi
@CMAD
CMAD / gist:3699643
Created September 11, 2012 16:23
evil ssh wrapper
# this function is a ticket to hell, each time you connect
# somewhere, it records a log of when you connect and disconnect
ssh() {
# create a file, for ssh to let us know the hostname
ssh_hostname_tmp=$(mktemp)
ssh_username_tmp=$(mktemp)
ssh_port_tmp=$(mktemp)
# why do I need a fifo, see below, hint: controll flow from hell

Keybase proof

I hereby claim:

  • I am cmad on github.
  • I am cmad (https://keybase.io/cmad) on keybase.
  • I have a public key ASDoyVu8dgD0eDujWYD9U1tgLljeOQ4GvChP-lrnxfrD-wo

To claim this, I am signing this object: