Skip to content

Instantly share code, notes, and snippets.

@kyokuheki
Created March 11, 2020 08:25
Show Gist options
  • Save kyokuheki/247e00bb84582fa6b05017e1a86b2abe to your computer and use it in GitHub Desktop.
Save kyokuheki/247e00bb84582fa6b05017e1a86b2abe to your computer and use it in GitHub Desktop.
ethercalc clean up

ethercalc

空のシートを削除

export URL=http://hack.sic.ecl.ntt.co.jp:8040
export no_proxy=hack.sic.ecl.ntt.co.jp,sic.ecl.ntt.co.jp

export ECIDs=`curl -vsS ${URL}/_rooms | jq -r .[]`
for ecid in $ECIDs
do
  #curl -sS $URL/_/$ecid; done
  #[[ "${ecid%*_formdata}" != ${ecid} ]] && continue
  size=`curl -sS -w '%{size_download}\n' -o /dev/null $URL/${ecid}.csv`
  echo "$ecid\t$size"
  if [[ $size -le 1 ]]; then
    curl -sS  "$URL/${ecid}.csv.json"
    curl -X DELETE "$URL/_/${ecid}"
    echo "$ecid\t$size\tdelete"
  fi
done

シートの1行目抽出

export ECIDs=`curl -vsS ${URL}/_rooms | jq -r .[]`
for ecid in $ECIDs
do
  #curl -sS $URL/_/$ecid; done
  #[[ "${ecid%*_formdata}" != ${ecid} ]] && continue
  echo "$ecid\t$size"
  curl -sS  "$URL/${ecid}.csv.json" | jq -c .[0]
done
export URL=http://hack.sic.ecl.ntt.co.jp:8040
export no_proxy=hack.sic.ecl.ntt.co.jp,sic.ecl.ntt.co.jp
export ecid=lm66p7xtj92o
curl -X DELETE "$URL/_/${ecid}"

export ECIDs=curl -vsS ${URL}/_rooms | jq -r .[] for ecid in $ECIDs do #c #[ echo "$ecid\t$size" curl -sS "$URL/${ecid}.csv.json" | grep -A3 -B3 192.47.162. done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment