Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / gist:543e277a2f7221a7833a
Last active April 3, 2024 12:56
install autoconf 2.69 for CentOS 6
curl -L -O http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar zxf autoconf-2.69.tar.gz
cd autoconf-2.69
yum install -y openssl-devel
./configure
make && make install
@tkuchiki
tkuchiki / bats.log
Last active May 16, 2023 11:07
Example Bats
##### setup start
BATS_TEST_NAME: test_example_status_and_output-2c_lines
BATS_TEST_FILENAME: /home/bats/test.bats
BATS_TEST_DIRNAME: /home/bats
BATS_TEST_NAMES: test_example_status_and_output-2c_lines
BATS_TEST_DESCRIPTION: example status and output, lines
BATS_TEST_NUMBER: 1
BATS_TMPDIR: /tmp
##### setup end
example 1
@tkuchiki
tkuchiki / newFile1.txt
Last active May 11, 2023 06:53
nginx source build (lua-nginx-module). https://gist.github.com/tkuchiki/7025062
# LUAJIT のディレクトリは適宜変更
LUAJIT_LIB=/usr/local/lib
NGX_VERSION=1.4.3
wget "http://nginx.org/download/nginx-$NGX_VERSION.tar.gz"
tar zxvf nginx-$NGX_VERSION.tar.gz
# ./configure: error: the HTTP rewrite module requires the PCRE library.
yum install pcre pcre-devel
yum install openssl openssl-devel zlib zlib-devel readline readline-devel libxml2 libxml2-devel libxslt-devel
@tkuchiki
tkuchiki / gist:7315374
Created November 5, 2013 07:52
lua で 外部コマンドの実行結果を受け取る
# http://stackoverflow.com/questions/9676113/lua-os-execute-return-value
local handle = io.popen("ls")
local result = handle:read("*a")
handle:close()
print(result)
@tkuchiki
tkuchiki / _memo.md
Created April 21, 2022 13:56
Example of calling Cloud Monitoring API

Prerequisite

  • python3
  • curl
  • gcloud

Usage

echo  | bash cloud-monitoring-api-list-time-series.sh   
@tkuchiki
tkuchiki / _usage.md
Created April 21, 2022 08:16
Drop Spanner tables
$ bash drop-spanner-tables.sh <your project> <your spanner instance> <your spanner database>

Prerequiresite

  • macOS: brew install coreutils
  • Linux: GNU date

Usage

# timelist.txt
3/16 17:26 ~ 17:29 JST
#!/bin/bash
project="${1}"
instance="${2}"
billing_project="${3}"
_gcloud() {
if [ "${billing_project}" != "" ]; then
gcloud --project ${project} --billing-project ${billing_project} "${@}"
fi
@tkuchiki
tkuchiki / new_gist_file_0
Created January 10, 2014 09:55
iscsi over ssh tunnel
$ autossh -M 33333 -N -f -L 13260:10.150.1.26:3260 sg
$ yum install -y iscsi-initiator-utils
$ iscsiadm -m discovery -t sendtargets -p 127.0.0.1:13260
$ vim /var/lib/iscsi/send_targets/127.0.0.1\,13260/iqn.1997-05.com.amazon\:myvolume\,10.150.1.26\,3260\,1\,default/default
#node.conn[0].address = 10.150.1.26
#node.conn[0].port = 3260
node.conn[0].address = 127.0.0.1