Skip to content

Instantly share code, notes, and snippets.

@tkuchiki
tkuchiki / new_gist_file_0
Created Jan 10, 2014
iscsi over ssh tunnel
View new_gist_file_0
$ 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
@tkuchiki
tkuchiki / config.xml
Created Oct 24, 2013
jenkins config.xml
View config.xml
<?xml version='1.0' encoding='UTF-8'?>
<hudson>
<disabledAdministrativeMonitors/>
<version>1.0</version>
<numExecutors>2</numExecutors>
<mode>NORMAL</mode>
<useSecurity>true</useSecurity><!-- セキュリティ有効化 -->
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy"/>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup><!-- ユーザにサインアップを許可 -->
@tkuchiki
tkuchiki / bats.log
Last active Aug 31, 2021
Example Bats
View bats.log
##### 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 / jq.md
Last active Jul 14, 2021
example of jq
View jq.md

JSON to LTSV

jq -r '.[] | to_entries | map("\(.key):\(.value)") | join("\t")'

aws ec2 describe-instances の Tags に特定の文字列が含まれている PrivateIP のみ出力する

Tags がないとき用に .Tags[]? にしておく

View calc-elapsed-times.rb
#!/usr/bin/env ruby
require 'time'
require 'optparse'
in_delim = "\t"
out_delim = "\t"
f = nil
opt = OptionParser.new
@tkuchiki
tkuchiki / Kohana with nginx
Last active Feb 17, 2021
Kohana nginx configuration
View Kohana with nginx
server {
listen 80;
server_name example.com;
access_log /path/to/access.log main;
error_log /path/to/error.log;
root /path/to/kohana/web;
location / {
index index.php;
if (-f $request_filename) {
@tkuchiki
tkuchiki / gist:543e277a2f7221a7833a
Last active Sep 4, 2020
install autoconf 2.69 for CentOS 6
View gist:543e277a2f7221a7833a
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 / install_mysql8_ubuntu.sh
Created Aug 29, 2020
Install mysql 8.0 on ubuntu 18.04
View install_mysql8_ubuntu.sh
#!/bin/bash
apt-get update
apt-get install -y debconf libaio1 apparmor-profiles lsb-release gnupg
DEB="/tmp/mysql.deb"
ROOT_PASSWORD=""
MYSQL_USER="testuser"
MYSQL_PASSWORD="testpass"
@tkuchiki
tkuchiki / _memo.md
Last active Aug 11, 2020
Recursive PURGE from BASE URL for Fastly
View _memo.md

Requirements

  • wget
  • curl

Usage

$ bash fastly-recursive-purge.sh https://example.com
@tkuchiki
tkuchiki / memo.md
Last active Jul 22, 2020
Jenkins の実行ユーザを変更する
View memo.md

実行ユーザ変更

/etc/sysconfig/jenkins

JENKINS_USER="USER"

を設定