Skip to content

Instantly share code, notes, and snippets.

@randysecrist
Created February 15, 2012 21:39
Show Gist options
  • Save randysecrist/1839170 to your computer and use it in GitHub Desktop.
Save randysecrist/1839170 to your computer and use it in GitHub Desktop.
handy shell script commands
# Passing a list of files to mHealth
for i in `find . -name "*.hl7"`
do
curl -X PUT -H "Content-Type: application/octet-stream" -i 'http://localhost:9292/v2/health/data/hl7?oauth_token=4b5f64eb-0679-4521-97be-a705fd2615c0' --data-binary @$i
done
# rename extension for files in current (and all sub) directories.
for i in `find . -name "*.txt"`
do
mv "$i" "${i%.txt}.hl7"
done
# monitor network packet loss
watch -d "sh -c 'netstat -s | egrep -i retrans'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment