% rpmbuild -bp --nodeps hoge.spec
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function alias_function(){ | |
[[ $(type -t "$1") = 'function' ]] || return 1; | |
local buf | |
buf="function ${2}()" | |
buf="${buf} $(declare -f "${1}" | tail -n +2)" | |
eval "$buf" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Dim objWMI, objShell, osInfo, os | |
' http://hitaki.net/diary/20090522.html | |
' Prompt UAC elevated privilege dialog. | |
do while WScript.Arguments.Count = 0 and WScript.Version >= 5.7 | |
Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\.\root\cimv2") | |
Set osInfo = objWMI.ExecQuery("SELECT * FROM Win32_OperatingSystem") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function ydump() { | |
# nm: namespace array | |
# lv: namespace level | |
# cidt: current indent depth | |
# lidt: last indent depth | |
# ac: array counter | |
awk -v lv=1 -v ac=0 -v cidt=1 -v lidt=1 'BEGIN{ nm[1]=""; } | |
function path_join(ary, _i,_r,_s) { _r=""; for(_i = 1; _i <= lv; _i++){ _r = _r "/" ary[_i];}; sub("/$", "", _r); sub("^/+", "", _r); return _r; } | |
# get the current indent depth. | |
{ match($0, /[^ ]+/); cidt=RSTART;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org/' | |
gem 'capybara' | |
#gem 'capybara-mechanize' | |
gem 'poltergeist' | |
gem 'rspec' | |
PHANTOM_JS='phantomjs-1.9.2-linux-x86_64' | |
PHANTOM_JS_DIR=unless ENV['PHANTOM_JS_DIR'] | |
ENV['PHANTOM_JS_DIR'] = File.join(Bundler.root, Bundler.settings[:path], PHANTOM_JS) |
online=0
is the secret key make this happen.
# tgtadm --lld iscsi --op update --mode logicalunit --tid=1 --lun=1 --params 'online=0,path=/mnt/work1/testvol/vol2.img'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://developer.github.com/v3/pulls/#create-a-pull-request | |
curl -u "unakatsuo:your_oauth_token" https://api.github.com/repos/axsh/wakame-vdc/pulls -d '{"issue": "325", "head":"fix-instance-monitor", "base":"master"}' |
RHEL系で新しいマイナーリリースができた時yum update
してしまうと、システムが大きく更新される。本番環境などではこれを固定したいことがあるので、その方法。
yum.repoファイルへ現れる、$releasever
変数を固定する。
例: CentOS6.4で以降のリリースがある場合でも6.4のまま固定化する。
--releasever
オプションを指定する。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Read dependency information from rpmbuild/SPECS/*.spec. | |
# % cat rpmbuild/SPECS/*.spec | rpmspec_depends | |
function rpmspec_depends() { | |
# 0. remove redhat meta variables. | |
# 1. convert space list to line list. | |
# 2. remove trailing spaces. | |
# 3. remove debian meta variables. i.e. ${shlib:Depends} | |
# 4. remove version conditions. | |
# 5. remove wakame-vdc packages. | |
awk -F: '$1 == "BuildRequires" || $1 == "Requires" { print substr($0, length($1)+2)}' | \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
awk 'BEGIN{blkline=0; skip=0; } | |
$0 ~ /^## EXAMPLE:$/ && blkline == 1 { skip=1; } | |
$0 ~ /^```$/ && blkline > 0 {blkline=0;} | |
blkline > 0 && skip == 0 {print $0; blkline++; } | |
$0 ~ /^```shell$/ && blkline == 0 {blkline=1; skip=0;} | |
' <<'EXAMPLE_MD' | |
## Title |