Skip to content

Instantly share code, notes, and snippets.

@mapk0y
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mapk0y/a7be5e9bb9bd3d77ff80 to your computer and use it in GitHub Desktop.
Save mapk0y/a7be5e9bb9bd3d77ff80 to your computer and use it in GitHub Desktop.
bash で mackerel-agent.deb を持ってくる
# bash の tcp 通信機能を使います
# 参考: http://qiita.com/k_ui/items/a01fdcfa8ac6729e7870
exec 3<> /dev/tcp/file.mackerel.io/80
echo -e "GET /agent/deb/mackerel-agent_latest.all.deb HTTP/1.0\nHost:file.mackerel.io\n\n" >&3
cat <&3 >mackerel-agent_latest.all.deb
# header が付いているので除去
# 参考: http://stackoverflow.com/questions/20179623/bash-remove-headers-from-http-response
sed -i '1,/^\r\{0,1\}$/d' mackerel-agent_latest.all.deb
# インストール
dpkg -i mackerel-agent_latest.all.deb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment