This file contains hidden or 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
| docker-kill() { | |
| # usage: docker-kill | |
| # kill all active docker processes | |
| local target="$(docker ps -q)" | |
| [[ -n "$target" ]] && { | |
| echo "$target" | xargs -i docker kill {} | |
| } | |
| } | |
| docker-clean() { |
This file contains hidden or 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
| import org.apache.tools.ant.taskdefs.condition.Os | |
| String cmdLine(String cmd, Writer out = new StringWriter(), Writer err = new StringWriter()) { | |
| (Os.isFamily(Os.FAMILY_WINDOWS) ? "cmd /c ${cmd}" : cmd).execute().waitForProcessOutput(out, err) | |
| assert err.toString().trim().size() == 0: "$err" | |
| out.toString() | |
| } | |
| task hello << { | |
| cmdLine("echo hello") | |
| } |
This file contains hidden or 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
| apply from: "nobushige.gradle" | |
| // work { | |
| // company = "Your company code" | |
| // username = "Your userID" | |
| // password = "Your password" | |
| // } |
This file contains hidden or 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 | |
| ROOTUID="0" | |
| if [ "$(id -u)" -ne "$ROOTUID" ] ; then | |
| echo "This script must be executed with root privileges." | |
| read -p "Retry as root user? (y/N): " yn | |
| case "$yn" in [yY]*) ;; *) echo "cancel." ; exit ;; esac | |
| # Noパスワードでsudoersに追加する | |
| # 危険なので気を付けよう | |
| [ $(sudo grep -c "^${USER}\s" /etc/sudoers) -eq 0 ] \ | |
| && (echo "$USER ALL=NOPASSWD: ALL" | sudo EDITOR='tee -a' visudo) |
This file contains hidden or 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
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import boto3 | |
| from datetime import datetime | |
| def datetime2timestamp(dt: datetime) -> int: | |
| return int(dt.timestamp() * 1000) | |
This file contains hidden or 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 | |
| # ========================================================= | |
| # Shibboleth 3.0.2 FastCGI Bugfix script. | |
| # -- | |
| # Please use this script untill bug [SSPCPP-834] fixed. | |
| # ========================================================= | |
| _SHIBBOLETH_VERSION=3.0.2 | |
| mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} |
This file contains hidden or 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
| package sample; | |
| import jdk.nashorn.api.scripting.ScriptObjectMirror; | |
| import org.junit.Ignore; | |
| import org.junit.Rule; | |
| import org.junit.Test; | |
| import org.junit.experimental.runners.Enclosed; | |
| import org.junit.rules.ExternalResource; | |
| import org.junit.rules.TemporaryFolder; | |
| import org.junit.runner.RunWith; |
This file contains hidden or 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
| import java.io.Serializable; | |
| import java.io.StringWriter; | |
| import org.apache.logging.log4j.LogManager; | |
| import org.apache.logging.log4j.core.Filter; | |
| import org.apache.logging.log4j.core.Layout; | |
| import org.apache.logging.log4j.core.LogEvent; | |
| import org.apache.logging.log4j.core.Logger; | |
| import org.apache.logging.log4j.core.appender.AbstractAppender; | |
| import org.apache.logging.log4j.core.layout.PatternLayout; |
This file contains hidden or 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 | |
| #========================================================= | |
| # 対象SVNリポジトリの参照チケット番号一覧を出力します | |
| # その際Tracから対象のチケットタイトルも取得します | |
| # | |
| # 引数) | |
| # 第1引数: 開始リビジョン番号 | |
| # 第2引数: 終了リビジョン番号(任意) | |
| # 第3引数: SVNリポジトリURL(任意) | |
| # 第4引数: Trac URL(任意) |
This file contains hidden or 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
| @Grab(group='org.gebish', module='geb-core', version='2.1') | |
| @Grab(group='org.seleniumhq.selenium', module='selenium-api', version='3.11.0') | |
| @Grab(group='org.seleniumhq.selenium', module='selenium-firefox-driver', version='3.11.0') | |
| import geb.* | |
| System.properties['webdriver.gecko.driver'] = './geckodriver.exe' | |
| class ThisGistPage extends Page { | |
| // 何故か this.url が空になるのでブラウザから現在の url を取得 |