Skip to content

Instantly share code, notes, and snippets.

View mAster-rAdio's full-sized avatar

Master Radio mAster-rAdio

View GitHub Profile
@mAster-rAdio
mAster-rAdio / munin.psgi
Last active August 29, 2015 14:22 — forked from kamipo/gist:474214
Munin.pmがなくなって、設定ファイルの読み込みはMunin/Master/Utils.pmになり、munin_readconfigではなくmunin_readconfig_rawになった。
use strict;
use warnings;
use Plack::Builder;
use Plack::App::Directory;
use Munin::Master::Utils;
use Date::Manip;
use POSIX qw(strftime);
use File::Slurp;
my $GRAPHER = "/usr/share/munin/munin-graph";
@mAster-rAdio
mAster-rAdio / check_munin.pl
Created October 4, 2011 11:17
check_munin.pl に http://goo.gl/KpjnAhttp://goo.gl/9O0ii の対応を盛り込んだ。ver 0.9.1
#!/usr/bin/perl -w
# $Id: check_munin.pl
# 2011/10/03 17:34:54
#
# check_munin.pl Copyright (C) 2003 Julien Rottenberg <julien@rottenberg.info>
#
# check_munin.pl can check various modules of a server running munin-node.
#
#
# This program is free software; you can redistribute it and/or
@mAster-rAdio
mAster-rAdio / innobackupex-2.0.0.diff
Created June 4, 2012 13:11 — forked from kamipo/innobackupex-1.5.1.diff
percona-xtrabackup-2.0.0版
--- innobackupex.org 2012-04-04 03:49:34.000000000 +0900
+++ innobackupex 2012-06-04 22:08:17.000000000 +0900
@@ -1322,10 +1322,19 @@
print FILE "CHANGE MASTER TO MASTER_LOG_FILE='$filename', MASTER_LOG_POS=$position\n";
close(FILE);
+ my $orig_datadir = get_option(\%config, 'mysqld', 'datadir');
+
if ($option_stream) {
+ system("cd $orig_datadir; $stream_cmd master.info")
@mAster-rAdio
mAster-rAdio / innobackupex-2.1.3.diff
Last active December 18, 2015 16:39 — forked from kamipo/innobackupex-1.5.1.diff
percona-xtrabackup-2.1.3版
--- innobackupex.orig 2013-05-23 03:50:09.000000000 +0900
+++ innobackupex 2013-06-19 19:15:00.000000000 +0900
@@ -1593,10 +1593,19 @@
print FILE "CHANGE MASTER TO MASTER_LOG_FILE='$filename', MASTER_LOG_POS=$position\n";
close(FILE);
+ my $orig_datadir = get_option(\%config, 'mysqld', 'datadir');
+
if ($option_stream) {
+ system("cd $orig_datadir; $stream_cmd master.info")
@mAster-rAdio
mAster-rAdio / composer.json
Created July 12, 2016 09:17
composer.jsonにforkしたライブラリを指定する。
"repositories":[
{
"type":"vcs",
"url":"https://github.com/mAster-rAdio/composer-yaml"
}
],
"require":{
...,
"igorw/composer-yaml":"*@dev"
}
@mAster-rAdio
mAster-rAdio / xenserver_patcher.sh
Last active January 11, 2017 09:02
fork from patones/XenServer-Patcher-bash, exclude download list & sort list
#!/bin/sh
base_dir=`dirname $0`
patch_list="${base_dir}/patch_list.txt"
cd ${base_dir}
cat ${patch_list} | while read name url time uuid; do
# Save some typing
export short_url=`basename ${url}`
@mAster-rAdio
mAster-rAdio / centos-security-update.sh
Last active July 25, 2017 06:32
Get xml from github(stevemeier/cefs).
#!/bin/sh
#set -v # Output in Verbose: Print Command.
#set -x # Output in Verbose: Expand Variable.
#set -e # Fail on Error.
#set -u # Fail on Undefined variable.
readlink=`which greadlink 2> /dev/null || true`
test -z "${readlink}" && readlink=`which readlink 2> /dev/null || true`
if [ -n "${readlink}" ]; then
real_path=`${readlink} -fn "$0"`
@mAster-rAdio
mAster-rAdio / tfschema-install.md
Created August 6, 2019 04:13
tfschema最新版リリースバイナリを${HOME}のbinにDLして配置するワンライナー。

tfschema最新版リリースバイナリを ${HOME} のbinにダウンロードして配置するワンライナー。

  • ただし、アーキテクチャは自前指定。
curl -kLRs `curl -kLRs https://api.github.com/repos/minamijoyo/tfschema/releases/latest | grep browser_download_url | grep linux | grep amd64 | awk '{print($NF);}' | tr -d '"'` | tar -C ~/bin -zxf - tfschema
  • anyenvだと ${ANYENV_DEFINITION_ROOT}/tfenvinstall_plugin 指定すれば良いのだろうか…?
@mAster-rAdio
mAster-rAdio / install-envs.sh
Last active November 1, 2019 04:11
Install anyenv + pyenv + direnv, and certbot by using them, based on CentOS/RHEL.
#!/bin/bash
########################################
# functions
## function: add strings into file unress 'any-words'
addstr_unless () {
_subject="${1}"
_add_string="${2}"
_target_file="${3}"
test "${#}" -ne 3 && return 1
@mAster-rAdio
mAster-rAdio / chromium-updater.sh
Last active March 2, 2020 08:21
Ubuntu用Chromium更新スクリプト。http://paste.ubuntu.com/1110824/ からfork。
#!/usr/bin/env bash
# based on
# http://askubuntu.com/questions/112432/chromium-19-for-ubuntu
# http://paste.ubuntu.com/1110824/
# https://gist.github.com/uu59/4019433
set -e
set -u