Skip to content

Instantly share code, notes, and snippets.

@TakashiUNUMA
TakashiUNUMA / cache_free.sh
Last active December 16, 2015 16:49
Chach を解放する、shell script。
#!/bin/sh
echo '# before ------------------------------------------------------------- #'
free
echo ''
echo 3 > /proc/sys/vm/drop_caches
echo '# after -------------------------------------------------------------- #'
free
echo ""
@TakashiUNUMA
TakashiUNUMA / jst2utc.sh
Created April 26, 2013 10:42
日時処理プログラム。 12桁のJST時刻を、12桁のUTC時刻に変換する。
#!/bin/sh
#
# 日時処理
# Last modified: 2012/04/16
#
# 引数があるかどうかチェック
if test $# -lt 1
then
echo "USAGE: jst2utc yyyymmddhhnn"
@TakashiUNUMA
TakashiUNUMA / utc2jst.sh
Created April 26, 2013 10:45
日時処理プログラム。 12桁のUTC時刻を、12桁のJST時刻に変換する。
#!/bin/sh
#
# 日時処理
# Last update: 2012/01/12
#
# 引数があるかどうかチェック
if test $# -lt 1
then
echo "USAGE: utc2jst yyyymmddhhnn"
@TakashiUNUMA
TakashiUNUMA / r2z.sh
Created May 22, 2013 09:12
Calculate reflected intensity [dBZ] by the use of Z-R relationship.
#!/bin/sh
#
# Calculate reflected intensity [dBZ] by the use of Z-R relationship.
# original script coded by Takashi Unuma, Kyoto Univ.
#
# -----
# Z = A * R^b
# where, A = 200, b=1.6
#
@TakashiUNUMA
TakashiUNUMA / 10min_2_3hour.sh
Created May 22, 2013 10:05
Change from 10 minute interval time to 3 hour interval time.
#!/bin/sh
#
# program of converting from 10-min. time to 3-hour time
#
# original script coded by Takashi Unuma, Kyoto Univ.
# Last modified: 2013/05/22
#
if test ${#1} -lt 12 ; then
echo "please type following format of date:"
@TakashiUNUMA
TakashiUNUMA / FREQ_DIST.awk
Created May 29, 2013 09:20
Make a frequency distribution. USAGE: awk -f FREQ_DIST.awk [input_file]
#!/bin/awk -f
{
if(binsize <= 0) exit
if($1 < 0){
frequency[int($1 / binsize) - 1] ++
}else{
frequency[int($1 / binsize)] ++
}
@TakashiUNUMA
TakashiUNUMA / gmtplot.sh
Created June 4, 2013 06:42
Template for GMT plotting.
#!/bin/sh
#
# GMTPLOT
# original script coded by Takashi Unuma, Kyoto Univ.
# Last modified: 2013:06/04
#
infile=Z__C_RJTD_composit_RDR_JMAGPV.out
# setting
@TakashiUNUMA
TakashiUNUMA / gplot.sh
Last active July 21, 2017 07:30
A template bash script for gnuplot.
#!/bin/sh
# 描画する元のデータを指定 (gnuplot スクリプトへ引き継がれる)
infile=input.txt
# bash ファイル内での出力ファイル名を指定 (gnuplot スクリプトへ引き継がれる)
epsfile=output.eps
cat > tmp.gnuplot << EOF
# 出力を eps color enhanced に指定するためのおまじない
@TakashiUNUMA
TakashiUNUMA / change_time.sh
Last active December 18, 2015 17:49
Change Time by the use of date and awk command.
#!/bin/sh
#
# change_time.sh
# original script coded by Takashi Unuma, Kyoto Univ.
# Last modified: 2013/06/21
#
if test $# -lt 3 ; then
echo "USAGE: $(basename $0) [YYYYMMDDHHNN] [INT] [+/-]"
echo " *** Note: All values must be 'integer'. *** "
@TakashiUNUMA
TakashiUNUMA / get_data_from_uwyo.edu.sh
Created July 13, 2013 08:38
A wget wrapper script for the sounding data of http://weather.uwyo.edu/ . This script requires ”change_time” shell script (https://gist.github.com/TakashiUNUMA/5821630). USAGE: get_data_from_uwyo.edu.sh [JSTTIME] [STATION NUMVER] [TYPE]
#!/bin/sh
#
# wget wrapper script
#
# original script coded by Takashi Unuma, Kyoto Univ.
# Last modified: 2013/07/13
#
debug_level=100
if test $# -lt 3 ; then